# Google Play

> How WinWinKit tracks revenue directly from the Google Play Store.

WinWinKit supports tracking revenue from the [Google Play Store](https://play.google.com) directly via **Real-time Developer Notifications (RTDN)** — real-time messages delivered by Google through Cloud Pub/Sub as transactions happen.

## Real-time Developer Notifications

Once the integration is configured, Google sends a notification to WinWinKit each time a relevant event occurs in your app:

- **Initial purchase** — A user buys a subscription or one-time product for the first time.
- **Renewal** — A subscription auto-renews.
- **Refund** — Google issues a refund or voids a previous purchase.
- **Trial** — A user starts a free trial.

## What Gets Tracked

Each Google Play transaction recorded in WinWinKit includes:

- **Type** — Purchase, renewal, refund, or trial.
- **Amount** — Gross revenue (the actual amount paid by the user), normalized to USD.
- **Purchase token** — Used to link renewals and refunds back to the original purchase.
- **Product identifier** — The product or subscription SKU.
- **Environment** — Sandbox or production.

## User Attribution

Google Play transactions are attributed to a WinWinKit user via the **purchase token** and, when available, Google's **`obfuscatedAccountId`**.

## Setup

To enable Google Play revenue tracking:

1. In the WinWinKit dashboard, go to **Settings → Integrations → Google Play Server Notifications** and follow the on-screen instructions to obtain the Pub/Sub topic and service account credentials.
2. In the [Google Play Console](https://play.google.com/console), enable Real-time Developer Notifications for your app and point them at the Pub/Sub topic provided by WinWinKit.
3. In your app, use the WinWinKit SDK's method for registering or syncing transactions after a purchase completes, so WinWinKit can associate the transaction with the user.

<Info>
  If your app uses RevenueCat and you prefer tracking revenue from Google Play
  directly, you do not need to configure Real-time Developer Notifications in
  the Google Play Console. Instead, set the WinWinKit webhook URL in the
  RevenueCat dashboard — RevenueCat will forward the underlying Google Play
  events to WinWinKit.
</Info>
