# Connect Google Play (native) (https://www.getfounderhq.com/docs/analytics/revenue/connect-google-play)

Connect Google Play directly, with no aggregator in between. You give FounderHQ
your package name. FounderHQ gives you two values to paste into Play Console.
That is the whole setup — no Google Cloud account, and nothing to configure
outside Play Console. Allow about ten minutes.

Already send notifications to RevenueCat or another tool? Keep your topic and
[read it side by side](#already-sending-notifications-to-another-tool).

<Callout title="Before you start">
  You need a [FounderHQ brand](/analytics/getting-started), the FounderHQ SDK in
  your app ([Android](/analytics/sdks/android) or [React
  Native](/analytics/sdks/react-native)), and a Play Console account that can
  edit users and monetization setup.
</Callout>

## 1. Create the connection in FounderHQ

In FounderHQ, open **Settings → Integrations → Revenue**. Choose Google Play
and the brand.

FounderHQ needs one value:

| Value        | Meaning                   | Example             |
| ------------ | ------------------------- | ------------------- |
| Package name | Your app's application ID | `com.acme.afteryou` |

Click Connect. FounderHQ prepares your app's notification mailbox and shows you
two values to copy: a **topic name** and a **FounderHQ address**.

## 2. Turn on notifications in Play Console

In Play Console, open **Monetization setup** for your app.

1. Paste the topic name from FounderHQ.
2. Choose **Subscriptions, voided purchases and all one-time products**.
3. Click **Save**.
4. Click **Send test notification**.

Refunds and chargebacks arrive as voided purchases, so keep that selection.

## 3. Invite FounderHQ to your app

A Google notification only says that something changed. It never carries the
money. FounderHQ reads the real purchase from the Play Developer API, so it
needs read access to your app.

In Play Console, open **Users and permissions** and invite the FounderHQ
address shown on the connection. Give it access to your app, with permission to
**view financial data and orders**.

Without this invite, notifications arrive and nothing can be confirmed.

## Already sending notifications to another tool?

Play Console holds one topic. RevenueCat, or another tool you already use, may
hold it. Keep it. A topic feeds as many readers as you like.

On the connect screen, under the package name, choose **My notifications
already go to another tool's topic**. Paste the topic's full name, which starts
with `projects/`. Find it in Google Cloud under **Pub/Sub → Topics**.

Then give FounderHQ permission to read it:

1. In Google Cloud, open **Pub/Sub → your topic → Permissions**.
2. Click **Add principal**.
3. Paste the FounderHQ address shown on the connection.
4. Choose the role **Pub/Sub Subscriber**. Save.

FounderHQ adds one reader of its own beside your other tool's. Both tools get
every notification.

<Callout title="Your other tool keeps working">
  Nothing changes in Play Console, and nothing changes on your topic. FounderHQ
  never edits your notification setup, and disconnecting removes only
  FounderHQ's own reader — your topic stays.
</Callout>

You still need step 3, the Play Console invite: the notification says that
something changed, and the invite is what lets FounderHQ read the money. Step 2
is the part you skip.

The connection turns on with the next notification for your app. Click **Send
test notification** in Play Console if you would rather not wait.

## 4. Pass the FounderHQ token on every purchase

Google carries one opaque ID through the purchase and returns it on the
verified purchase record. FounderHQ uses it to find the buyer.

```ts
const prepared = await founderhq.preparePurchase({ source: "google_play" });
// Pass prepared.obfuscatedExternalAccountId to your billing flow.
await founderhq.observePurchase({
  prepared,
  purchase: {
    source: "google_play",
    purchaseToken: purchase.purchaseToken,
    orderId: purchase.orderId,
  },
});
```

On Android, `applyPurchaseContext(builder, prepared)` sets
`setObfuscatedAccountId` for you. See
[mobile purchase claims](/analytics/revenue/mobile-purchase-claims).

## Already reporting this app through RevenueCat or Superwall?

Connect Google Play anyway. FounderHQ allows it, and from that moment Play's
amounts, taxes, and dates own the money for this app. The other connection
stays where it is: its events are kept as evidence and add nothing to your
totals, so nothing counts twice during the switch, and everything already
recorded stays in your reports. See
[multiple providers](/analytics/revenue/multiple-providers).

## Verify

1. The connection shows **Connected** in FounderHQ within a minute of the test
   notification. Keep the setup window open while you wait.
2. Buy a test subscription in your app with a licensed test account.
3. In FounderHQ, open Revenue. The purchase shows the channel that brought the
   customer.

## Troubleshoot

### The test notification never arrives

Check that you clicked **Save** in Monetization setup after pasting the topic
name — Play Console does not save on its own. Then click **Send test
notification** again. The test alone turns the connection on; the invite in
Users and permissions matters for real purchases, which FounderHQ confirms
against your app before recording money.

### Notifications arrive but no revenue appears

FounderHQ cannot read the purchase from the Play Developer API. Confirm the
FounderHQ address still has access to the app in Play Console, and that its
access includes financial data and orders.

### Purchases arrive without a channel

The billing flow ran without a prepared token. Call `preparePurchase` first and
apply the returned `obfuscatedExternalAccountId`.
