Firebase and Google Analytics
Adapty can pass subscription events — purchases, renewals, refunds, trial starts — to Firebase and Google Analytics, so a single integration delivers data to both.
You need both a Firebase project and a linked Google Analytics property — even if you only use one. Firebase and Google Analytics are the same data in two consoles.
Purchase and refund events arrive with revenue, currency, and product details attached. The same data feeds Firebase’s mobile tools (Audiences, Remote Config, etc.) and reporting in Google Analytics.
This is an analytics integration, not a Google Ads attribution tool — see Limitations.
What you can do with this integration
Adapty groups users by subscription_state (subscribed, active_trial, never_subscribed, etc.) and forwards subscription lifecycle events to Firebase and Google Analytics.
- Audiences: Build subscriber audiences in Firebase and Google Analytics for external channels — Google Ads retargeting, FCM campaigns, lookalike modeling.
- Google Ads conversions (Google Analytics): Use
purchaseandrefundas Google Ads conversion goals. - Firebase Remote Config: Change usage limits, copy, or feature flags without an app update — condition them on subscription state. (Not to be confused with Adapty Remote Config, which configures flow/paywall content.)
- Cloud Messaging: Push notifications to lapsed subscribers when the app is closed.
- Cross-device tracking (Google Analytics): Adapty sends
customer_user_idto Google Analytics so Google Ads can track the same person across devices. - Conversion funnels (Google Analytics): See what users did in your app before converting or churning.
- Predictions: Forecast churn and spending using purchase history.
- A/B Testing: Test app features on subscriber cohorts — for example, roll out a new navigation pattern to trial users and measure session length. (For paywall variants, use Adapty A/B Tests.)
How the integration works
- When a user first opens your app, the Firebase SDK creates a unique identifier for the installation — the Firebase App Instance ID. Firebase and Google Analytics use this ID to identify the installation responsible for each event.
- Your app passes the Firebase App Instance ID to Adapty’s SDK. Adapty links the user’s profile to this Firebase installation.
- When the user makes a purchase, Adapty’s servers forward the event to Firebase with the Firebase App Instance ID attached. The data is exchanged server-to-server, outside the app.
- Firebase matches the purchase to the installation, so you can see purchases alongside everything else the user did in the app.
A Firebase App Instance ID is device-specific. When the same Adapty user opens the app on another device, the new Firebase ID overwrites the previous one. Use a customer user ID to maintain user identity across devices.
Stripe purchases
A Stripe purchase reaches Firebase only if the buyer launched your mobile app first. The Firebase App Instance ID must be set before the Stripe purchase fires.
For App Store and Play Store purchases, this happens automatically. They originate inside your mobile app, alongside the setIntegrationIdentifier call. The Firebase ID is present when the purchase fires.
Stripe purchases originate outside the app, on your server. Your mobile app must call setIntegrationIdentifier on launch — before any Stripe purchase fires. Otherwise Adapty has no ID to attach, and the Stripe purchase never reaches Firebase.
Limitations
- Not a Google Ads attribution tool. This integration sends Adapty events into Firebase and Google Analytics for analytics. It doesn’t attribute app installs to Google Ads campaigns (UAC / Universal App Campaigns) or separate paid traffic from organic. For install attribution, use Adapty’s built-in Adapty Attribution.
- No historical backfill. Adapty forwards events from the time you enable the integration — past purchases, renewals, and refunds never reach Firebase. (Past data lives in Adapty’s S3 / GCS exports, but importing it into Firebase isn’t part of this integration.)
- Web-only buyers don’t reach Firebase. Adapty forwards purchases to Firebase via the Firebase App Instance ID set by your mobile app. Buyers who never installed the app have no ID — their purchases don’t reach Firebase. See Stripe purchases above for details, and consider FunnelFox’s Firebase integration or a Google Analytics web data stream for web tracking.
- Paddle purchases aren’t included. This integration doesn’t currently support Paddle. Paddle purchases stay in Adapty Analytics and don’t reach Firebase via this path.
- Stripe purchases inherit Stripe-specific limitations. See Stripe integration limitations.
Setup instructions
Configure Firebase
-
Open Firebase Console and select or create a project. To keep production analytics clean from sandbox events, use a separate Firebase project for development builds.
-
Link the project to a Google Analytics property. Firebase prompts you during project creation, or add it later via Project settings > Integrations > Google Analytics.
-
In Project settings > General > Your apps, add an entry for each platform you ship on (iOS / Android / Web). For Stripe, add a Web app entry — there’s no native Stripe app type. Each entry generates a unique Firebase App ID and a corresponding data stream in Google Analytics. You’ll paste the ID into Adapty’s Firebase integration settings during the setup.
Configure Adapty
-
Open Integrations > Firebase in the Adapty Dashboard.
-
Enable the Firebase integration toggle.
-
Enter credentials for each platform you ship on. Adapty needs both a Firebase App ID and a Google Analytics secret for each platform — each value differs across iOS, Android, and Stripe.
Adapty Dashboard Google Analytics Where to find it Firebase App ID App ID Firebase Console > Project settings > General > Your apps Google Analytics secret Measurement Protocol API secret Google Analytics > Admin > Data streams > Measurement Protocol API secrets > Create
-
Configure how Adapty forwards revenue and user data. The four controls share one row in the dashboard:
- Revenue definition dropdown: Gross revenue, Proceeds after store commission, or Proceeds after store commission and taxes.
- Send user properties toggle: When on, events include
subscription_stateandsubscription_product_id. To use them in reports or audiences, see Use subscription data in reports. - Report user’s currency toggle: When on, Adapty converts every transaction’s local currency to your account’s reporting currency before forwarding to Google Analytics.
- Send trial price toggle: Trial starts are valuable — most paying users often start with a trial. But Google Ads’ bid optimization only treats events with revenue as worth chasing. Turn this on to assign a placeholder price to each trial so Google sees them as conversions and optimizes ad spend toward acquiring trial starters. When on, the Trial price percentage field appears. Set it to the share of the full subscription price that Google should treat each trial as worth — for example,
50%reports half the subscription price during trial.
-
Map Adapty events to Firebase/Google Analytics event names. Adapty exposes separate event maps for iOS and Android so you can use different names per platform. Stripe purchases use the iOS event map — there’s no separate Stripe map.
Google Analytics enforces strict Measurement Protocol limits — 40-character event names, 24-character user-property names, and 36-character values. Google Analytics silently drops custom events that exceed these limits.
Some events use the reserved ecommerce vocabulary in Firebase and Google Analytics —
purchaseandrefund. Google Ads conversion import, Google Analytics revenue reports, and predictive audiences depend on these exact strings. Override the defaults only if you don’t need those features.
-
Click Save. Adapty starts forwarding events to Firebase within a few minutes.
Configure your app code
Adapty needs to include the Firebase App Instance ID with each event — otherwise nothing reaches Firebase (MISSING_INTEGRATION_ID).
After FirebaseApp.configure() and Adapty.activate(), ask the Firebase SDK for the App Instance ID. Pass it to Adapty via setIntegrationIdentifier. Run this once per app launch, before any purchase flow.
Third-party SDKs generate user IDs asynchronously. The ID may not be ready when Adapty.activate() runs. If your Customer User ID comes from one of these SDKs, call Adapty.activate() without it. Once the ID arrives, call setIntegrationIdentifier(), then identify() with the CUID.
Verify the integration
The fastest way to confirm events are flowing is Firebase DebugView:
- On a test device, run your app with Firebase debug mode enabled.
- Trigger a sandbox purchase or any event you’ve enabled in the Adapty Dashboard.
- Open Firebase Console > Analytics > DebugView. Events appear within seconds, with all parameters.
Standard reports — Realtime, Reports, audiences — populate within minutes to 24 hours, depending on the report. DebugView is the only place to confirm in real time.
Use subscription data in reports and audiences
Turn on Send user properties in the Adapty dashboard (Configure Adapty, step 4). Without it, Adapty doesn’t forward subscription_state or subscription_product_id — and the rest of this section won’t do anything.
By default, Firebase and Google Analytics don’t expose user properties. Register each as a custom dimension. That makes subscription_state and subscription_product_id available in reports, Explorations, and audiences. Configure dimensions in Google Analytics Admin. You can then query them in both Firebase and Google Analytics — they share a backend.
Useful for building Google Ads audiences of paying users or feeding predictive models.
When you complete the setup, Adapty will populate these properties for upcoming events. Existing events won’t be updated.
-
In Google Analytics, open Admin > Custom definitions.
-
Click Create custom dimensions.
-
For each property, set:
- Dimension name: Any human-readable name, for example “Subscription state”.
- Scope: User.
- User property:
subscription_stateorsubscription_product_id. The name must match exactly — Google Analytics is case-sensitive.
Troubleshooting
Events don’t appear in Firebase
- Confirm the Firebase App Instance ID is set before the first purchase is made. Events without a Firebase ID do not reach Firebase, and yield an error.
- Confirm the Google Analytics property linked in the Firebase Console matches the data stream.
- Confirm that the set of credentials (ID + secret) in Adapty match the platform.
access_level_updated shows as failed in the Event Feed
access_level_updated is a webhook-only event. Adapty never attempts to deliver it to Firebase — but the Event Feed still lists it as a failed delivery. Ignore the line. Your integration is fine. To use this event, configure the webhook integration.
Sandbox events pollute production data
Adapty forwards sandbox and production transactions to the same Firebase project. See Configure Firebase — using a separate Firebase project for development builds avoids this entirely.
Firebase undercounts revenue for StoreKit 2 apps
Firebase auto-logs an in_app_purchase event for every StoreKit 1 purchase — no code required. StoreKit 2 uses a different API. Firebase never sees those transactions.
The fallout: SK2-heavy apps without a separate revenue pipeline under-report by half or more — in Firebase, in Google Analytics, and in every Google Ads campaign downstream. Bid optimization runs against the wrong number. Revenue reports show half the picture.
The fix: pass firebase_app_instance_id to Adapty (see Configure your app code). Adapty forwards every purchase via the Measurement Protocol — revenue, currency, and product attached.
Adapty Analytics and Firebase numbers diverge
- StoreKit 2: By far the biggest cause. See Firebase undercounts revenue for StoreKit 2 apps.
- SDK adoption: Firebase only counts events from users whose app sends a Firebase App Instance ID. Older app versions don’t make that call. Adapty still counts those users; Firebase doesn’t.
- Sandbox events: Adapty forwards sandbox transactions to Firebase too. Use a separate Firebase project for development builds to keep them apart.
- Sampling: Google Analytics Explorations sample large datasets. For unsampled counts, check the Realtime view or standard reports.
Custom event names are rejected by Google Analytics
Google Analytics limits event names to 40 characters, alphanumeric and underscores only, starting with a letter. Rename any custom Adapty events in the dashboard that violate these limits.