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

# Google Analytics Integration Setup

> Configure GA4 streams and connect events to web and app sessions

## Configure the destination

1. Open your Google Analytics destination in Masivo's CDP connections.
2. Configure at least one complete stream. Web uses its `G-...` Measurement ID
   and API Secret. Android and iOS each use their Firebase App ID and the
   API Secret from the corresponding GA4 app data stream.
3. Enable Sync events and/or Sync purchases. Include the event names you need
   when restricting the allowed-events list.
4. Use Test connection to validate sample payloads. This checks formatting,
   not credentials or actual collection; verify receipt in the real stream.

The existing web configuration remains valid. App streams are optional, and
an app-only setup is supported. Keep all API secrets in Masivo, not in links
or the app.

## Connect client context

Your website/app captures the real analytics identity and session and supplies
an optional `ga4` object with events. For purchases, pass that context through
your checkout backend, which sends the protected PURCHASE event to Masivo.

Web uses the Google tag's `client_id`; Android/iOS use Firebase's
`app_instance_id`. Set `session_id` from the same session. Masivo does not
collect these values automatically or replace the Google/Firebase SDK.

Events without a real identity continue using the previous customer-ID
fallback on the web stream. They cannot be used to confirm that session
attribution is fixed. An app with an identity but an unconfigured stream
produces a configuration error instead of being rerouted.

## Validate acquisition and purchases

Use one labelled link and one purchase for each of Meta, Braze and Masivo.
Check the final URL, the app's campaign handling, the identity/session and the
purchase received by GA4. Test Android installation referrers separately from
installed-app opens and iOS deferred resolution. Select one purchase emitter
per flow to avoid sending the purchase through both the client and Masivo.

The [integration reference](https://docs.masivo.ai/integrations/google-analytics.md) contains the
request format, UTM precedence, channel defaults, Firebase handoff and
reporting acceptance checks.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.