Set up Google Analytics 4
Google Analytics 4 is an analytics partner integrated with Adjust. Our integration lets Google Analytics 4 receive data measured in Adjust through automated callbacks. Use this data with the partners' tools for analytics and insights.
In this article, learn how to set up measurement with Google Analytics 4 for your app. This includes activating the integration and choosing what data Adjust can share with Google Analytics 4.
Before you begin
Requirements
- Admin, Editor, or Custom Editor permissions in Adjust.
- Adjust SDK v4.0.0 and later to map SDK parameters to Google Analytics 4 parameters. Follow the guides linked below to use this feature.
iOS | Android | Windows | Unity | React Native | Flutter | Adobe Air | Cordova | Marmalade | Xamarin | Cocos2d-x | Titanium | Corona
Credentials
Firebase App ID (for mobile apps), Measurement ID (for web apps), API Secret
- For help finding your credentials, contact your Google Analytics 4 representative.
In your Google Analytics 4 dashboard:
To get your Firebase App ID:
- Go to your Firebase Console
- Find your project and click on it
- Click on the gear icon > "Project settings" next to "Project Overview" on the left panel
- Under "Your apps", select your app and find the Firebase App ID under "App ID"
To get your API secret:
- Go to your Google Analytics dashboard
- Select Admin > Data collection and modification > Data streams
- Select the data stream of your app, and find your API secret under Measurement Protocol API secrets > Secret value
- If there's no existing API secret, under Measurement Protocol API secrets select Create, enter a name and select Create
Select Google Analytics 4 and your app in Campaign Lab
- Under Campaign Lab, select Partners.
- Select New partner > Google Analytics 4. Select Next to move to the next screen.
- In the App selection screen, choose the app for which you want to create the link, and enable the integration to share data with Google Analytics 4.
- Select Next.
Enable data sharing
Enable data sharing to activate the integration with Google Analytics 4. To enable data sharing:
- Enter your Firebase App ID (for mobile apps), Measurement ID (for web apps), API Secret.
Once you enable data sharing with Google Analytics 4, Adjust automatically sends Google Analytics 4 the following data, by default:
- install
- reattribution
Set your data sharing options
If you’re working with a multi-platform app with data sharing enabled for multiple platforms, you can:
- Separate data sharing options at the platform-level by selecting Use platform-specific settings.
- Set the same data sharing settings for multiple platforms by selecting Use global settings.
Now, under What will be shared by default?, review the activities that Adjust shares with Google Analytics 4 by default:
- install
- reattribution
Send additional data
Choose the amount and type of data that you want to share with Google Analytics 4 through callbacks. Google Analytics 4 may use this information to optimize performance.
To send additional data, you can review and customize the following:
In-app revenue (from in-app purchases)
Sharing in-app revenue lets Google Analytics 4 receive revenue amounts along with your revenue event data. You need to map events that generate revenue to share this data.
Map events
Map events that you want to share to the values that Google Analytics 4 can receive. Data for unmapped events is not shared with Google Analytics 4.
Map individual events
If you have a multi-platform app, you can choose to share different events per platform with Google Analytics 4. This lets you:
- Set individual events to manage campaign strategies for each platform.
- Customize data sharing per platform.
Under Map events, follow these steps to choose the in-app events you want to directly send to Google Analytics 4.
- Select Map event.
- In the Adjust event list, choose the Adjust event that you want to share with Google Analytics 4.
- Under Partner event, you need to select the Google Analytics 4 event that corresponds to the Adjust event.
- For single platform apps and multi-platform apps with data sharing enabled for a single platform only, you map events for that platform only. For multi-platform apps with data sharing enabled for multiple platforms, you can:
- Select Use platform-specific mapping to map separate events at the platform-level or to not map events for certain platforms.
- Select Use global mapping to map the same events for all platforms.
- In the Partner event list, choose or enter a custom event name, that you want to map the Adjust event to.
- For single platform apps and multi-platform apps with data sharing enabled for a single platform only, you map events for that platform only. For multi-platform apps with data sharing enabled for multiple platforms, you can:
- Select Apply.
Now Google Analytics 4 will receive in-app event data for each of your linked events.
Map all events
If Google Analytics 4 supports mapping all events automatically, under Map events, select Map all events. This saves time in mapping individual events.
Now Google Analytics 4 will receive in-app event data for all your linked events.
Map parameters
You usually need to map parameters to share custom data with Google Analytics 4.
Partner parameters (available in Adjust SDK version 4.0+) let Adjust collect custom data points from your app and send them to Google Analytics 4. This lets Google Analytics 4 receive custom event details for each of your linked events.
Before adding new partner parameters to the Adjust SDK, make sure no pre-existing partner parameters already fit your requirements.
To share partner parameters to Google Analytics 4, follow these steps.
- Set up partner parameters within the Adjust SDK.
- Check Before you begin for all SDK development platform links.
- Under Set your data sharing options, select Parameters.
- Under Map parameters, you can specify how you want to send partner parameters defined in the SDK to the network:
- Select Map parameter.
- In the SDK parameter field, enter the name of the SDK parameter you want to share with the network.
- In the Partner parameter field, enter the network parameter that corresponds to the SDK parameter.
If you set up partner parameters within the Adjust SDK without setting up parameter sharing in the dashboard, Adjust forwards the parameters as named in the Adjust SDK.
Enable Google Analytics 4 for your app
In the Setup review screen, you can review your choices. You can also go back and make changes to:
- Your selected app
- Data sharing options
Select Enable partner to enable Google Analytics 4 for your app. Analytics partners don't work with links for campaigns. Once enabled, our integration sends attribution and in-app event data via automated callbacks.
Partner specific setup instructions
Our Google Analytics 4 (GA4) integration allows Adjust to send cross-network attribution data to Google Analytics. You should enable this integration if you are already logging conversions with the Google Analytics for Firebase SDK or using Google Analytics 4 for web. Adjust leverages the campaign_details event of the Measurement Protocol API to send conversions along with attribution details.
Requirements
This integration supports both mobile apps and web-based apps:
- For mobile apps:
- The Firebase SDK must be integrated into your app.
- A Firebase App ID is required.
- You must implement session partner parameters within the Adjust SDK to capture and send Google Analytics 4’s app_instance_id.
- You should set app_instance_idbefore initializing the Adjust SDK.
- For web-based apps:
- A Measurement ID from your GA4 web property is required.
- You must implement session partner parameters within the Adjust SDK to capture and send Google Analytics 4’s client_id.
- You should set client_idbefore initializing the Adjust SDK.
These identifiers (app_instance_id for mobile, client_id for web) are essential because Google Analytics 4 uses them to uniquely identify each user or app instance. If these values are not properly tracked and passed, Adjust will not be able to fire callbacks to Google Analytics.
Follow the guides linked below to use this feature:
iOS / Android / Unity / Flutter / React Native
Supported in-app events
The Google Analytics 4 integration supports the following in-app events:
- Add to cart
- View cart
- Begin checkout
- Login
- Purchase
- Add to wishlist
- Sign up
Some events require additional values to be passed as SDK Partner Parameters:
| In-app event | Required SDK Partner Parameters |
| Add to cart | item_id or item_name |
| View cart | item_id or item_name |
| Begin checkout | item_id or item_name |
| Login | None |
| Purchase | item_id or item_name, and transaction_id |
| Add to wishlist | item_id or item_name |
| Sign up | None |
Make sure you pass the required SDK Partner Parameters when triggering these events. If the required parameters are missing, Adjust cannot send the event to Google Analytics 4 with the information required by the integration.
Additional Notes
- Organic traffic is not shared via this integration.
- Due to differences in attribution methodology, Google Analytics does not accept conversions older than 3 days.
- Depending on your Adjust Link attribution windows, you might see discrepancies because some conversions may not be reported in GA4.
About Session ID
You can send the Firebase Session ID through the session partner parameter ga4_session_id.
About User ID
You can send the Firebase User ID through the session partner parameter ga4_user_id.
List of all parameters forwarded to Google Analytics 4
Google Analytics 4 requires Adjust to send the following parameters (data points) with your callbacks:
| Placeholder | Information |
{currency} | Original ISO 4217 currency code sent from Adjust SDK |
{revenue_float} | Revenue, as sent from Adjust SDK, in whole currency units |
{adgroup_name} | Adgroup name, as taken from the tracker |
{campaign_name} | Campaign name, as taken from the tracker |
{creative_name} | Creative name, as taken from the tracker |
{engagement_time} | Engagement timestamp |
{network_name} | Network name, as taken from the tracker |