Google Play subscription tracking
Этот контент еще не доступен на вашем языке.
Integration overview
Anchor link toReal-Time Developer Notifications (RTDN) is Google Play’s server-to-server service that sends a real-time message whenever a subscription’s status changes.
By connecting Google Play RTDN to Pushwoosh, you can react to cancellations without building your own backend infrastructure. When a user turns off auto-renewal for a subscription in their Google Play account, Google notifies Pushwoosh, and Pushwoosh fires a PW_SubscriptionCancel event on the matching user profile.
Integration type
Anchor link toSource: Real-Time Developer Notifications are sent from Google Play to Pushwoosh.
Synchronized event
Anchor link to| Event name | Description | Attributes |
|---|---|---|
PW_SubscriptionCancel | Fired when a user turns off auto-renewal for a Google Play subscription. | productID — the Google Play product identifier of the canceled subscription. |
How it works
Anchor link toA Google Play notification carries no Pushwoosh identifier. It includes only a purchase token and the app’s packageName. So your app tags each purchase with the identifier Pushwoosh needs, and Pushwoosh reads it back from the purchase when a cancellation arrives.
- A user disables auto-renewal for their subscription in Google Play.
- Google Play publishes an RTDN message to Pushwoosh’s shared topic.
- Pushwoosh reads the purchase’s
obfuscatedAccountId, which your app set to<AppCode>:<hwid>at purchase time. - Pushwoosh resolves the device whose HWID matches, finds the user bound to it, and posts the
PW_SubscriptionCancelevent for that user.
Use case: Win back churning subscribers
Anchor link toA cancellation is rarely instant. A user who disables auto-renewal keeps their subscription until the end of the paid period. That window is your best chance to win them back.
With the PW_SubscriptionCancel event, you can launch a Customer Journey the moment auto-renewal is turned off. Send a push notification with a retention offer, follow up with an email highlighting features the user would lose, or show an in-app message with a discount on their next renewal. You can reach users before the subscription actually lapses.
Setting up the integration
Anchor link toBefore you start, make sure you have a Pushwoosh app with FCM configured (already required for push), a Google Play app with a subscription, and Play Console admin access.
Set the account identifier at purchase
Anchor link toPushwoosh identifies the right user from the device’s HWID, combined with your Application Code. The Pushwoosh Android SDK exposes a helper, getSubscriptionAccountId(), that returns this value already formatted as <AppCode>:<hwid>. Pass it to BillingFlowParams.setObfuscatedAccountId() when you launch the Google Play billing flow.
val billingParams = BillingFlowParams.newBuilder() .setProductDetailsParamsList(productDetailsParamsList) // Tag the purchase with the Pushwoosh account identifier "<AppCode>:<hwid>" .setObfuscatedAccountId(Pushwoosh.getInstance().subscriptionAccountId) .build()
billingClient.launchBillingFlow(activity, billingParams)BillingFlowParams billingParams = BillingFlowParams.newBuilder() .setProductDetailsParamsList(productDetailsParamsList) // Tag the purchase with the Pushwoosh account identifier "<AppCode>:<hwid>" .setObfuscatedAccountId(Pushwoosh.getInstance().getSubscriptionAccountId()) .build();
billingClient.launchBillingFlow(activity, billingParams);Point Real-Time Developer Notifications at Pushwoosh
Anchor link to- In Google Play Console, go to Monetize → Monetization setup.
- Find Real-time developer notifications and set the Topic name to:
projects/pw-playstore-subscriptions/topics/play-rtdn- Click Save. Publish permission is already granted to Google’s notification service, so there’s nothing else to configure here.
Grant Pushwoosh’s service account
Anchor link to- In Google Play Console, go to Users and permissions → Invite new user.
- Enter the Pushwoosh service account email:
play-api@pw-playstore-subscriptions.iam.gserviceaccount.com- Under App permissions, add your app and grant View financial data, orders, and cancellation survey responses (plus the read-only app information permission).
- Click Save. A service account doesn’t need to accept the invite. Access is active immediately.
Confirm the event in Pushwoosh
Anchor link toWhen Pushwoosh processes the first Google Play notification, it registers PW_SubscriptionCancel in your project with a string attribute productID. After a test cancellation, open Audience → Events to verify the event appears. It is then ready for segmentation, statistics, and Customer Journeys.
Build your win-back campaign
Anchor link toCreate a Customer Journey with a trigger-based entry on the PW_SubscriptionCancel event, and add the messages you want to send to users who are about to churn.
Testing
Anchor link toTo verify the integration end to end:
- In Google Play Console, open Monetization setup and click Send test notification. It should report success, confirming the topic is wired correctly.
- Make a subscription purchase with the account identifier set as described above, then cancel it from Play Store → Subscriptions → Cancel.
- In Pushwoosh Control Panel, open the user profile and go to Events history.
- Confirm that
PW_SubscriptionCancelappears within a few moments.