> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encorekit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure Analytics

> Set up Google Play Real-Time Developer Notifications so Encore can track subscription events and measure offer impact.

## Overview

Encore uses Google Play's **Real-Time Developer Notifications** (RTDN) to track subscription lifecycle events — trial starts, renewals, expirations, and cancellations. This data powers the **Analytics** section of your dashboard and enables Encore to measure **Net Conversion Lift**: the incremental subscription revenue attributable to Encore's win-back flow.

<Warning>
  Without this step, Encore cannot track subscription outcomes. Analytics will show no data.
</Warning>

***

## Choose Your Integration Method

<Tabs>
  <Tab title="Set Up RTDN (Recommended)">
    Configure Google Play to send real-time subscription notifications directly to Encore. This is the most reliable integration.

    ### Prerequisites

    * A **Google Cloud project** linked to your Google Play Console
    * **Cloud Pub/Sub API** enabled in the Google Cloud project

    ### Steps

    <Steps>
      <Step title="Enable Cloud Pub/Sub API">
        Go to the [Google Cloud Console](https://console.cloud.google.com/apis/library/pubsub.googleapis.com) and enable the **Cloud Pub/Sub API** for your project.
      </Step>

      <Step title="Create a Pub/Sub Topic">
        1. Go to **Cloud Pub/Sub > Topics**
        2. Click **Create Topic**
        3. Name it (e.g., `encore-play-notifications`)
        4. Click **Create**
      </Step>

      <Step title="Create a Push Subscription">
        1. On your topic, click **Create Subscription**
        2. Set **Delivery type** to **Push**
        3. Set the **Endpoint URL** to:

        ```
        https://api.encorekit.com/encore/webhooks/google
        ```

        4. Click **Create**
      </Step>

      <Step title="Grant Google Play Publisher Access">
        1. Select your topic and click **Show Info Panel**
        2. Click **Add Principal**
        3. Add `google-play-developer-notifications@system.gserviceaccount.com`
        4. Grant the **Pub/Sub Publisher** role
        5. Click **Save**
      </Step>

      <Step title="Configure in Google Play Console">
        1. Go to [Google Play Console](https://play.google.com/console)
        2. Navigate to **Monetization setup** (under Settings)
        3. In the **Real-time developer notifications** section, enter your topic name:

        ```
        projects/{your-project-id}/topics/encore-play-notifications
        ```

        4. Click **Send test notification** to verify
        5. Click **Save**
      </Step>
    </Steps>
  </Tab>

  <Tab title="Forward from Your Server">
    If you already have RTDN configured and don't want to change it, forward each notification to Encore from your existing handler.

    ### Example (Node.js)

    ```javascript theme={null}
    app.post('/webhooks/google-play', async (req, res) => {
      // Decode the Pub/Sub message
      const message = req.body.message;

      // Forward to Encore
      await fetch('https://api.encorekit.com/encore/webhooks/google', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify(req.body),
      });

      // Continue with your existing logic...
      res.sendStatus(200);
    });
    ```

    <Note>
      Encore verifies the notification payload independently — no shared secrets or additional configuration needed. Simply forward the raw request body as-is.
    </Note>
  </Tab>
</Tabs>

***

## Need Help?

If you have questions about configuring Google Play Real-Time Developer Notifications or need assistance with the forwarding setup, contact us at [admin@encorekit.com](mailto:admin@encorekit.com).

***

## Next Steps

You've completed the Encore integration! Here's what to explore next:

* [Encore Dashboard](https://dashboard.encorekit.com) - Monitor analytics and manage your app
* [User Management](./user-management) - Identify users and set attributes for personalized offers
