Set up Google Analytics 4

Google Analytics 4 is an analytics partner integrated with Adjust. Our integration allows Adjust to send cross-network attribution data to Google Analytics. You should enable the integration if you are already logging conversions with the Google Analytics for Firebase SDK. Adjust leverages the campaign_details event in the Measurement Protocol API to send conversions along with attribution details.

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

iOS | Android | Windows | Unity | React Native | Flutter | Adobe Air | Cordova | Marmalade | Xamarin | Cocos2d-x | Titanium | Corona

Credentials

Firebase App ID, API Secret

Find your credentials

To get your Firebase App ID:

  1. Go to your Firebase Console.
  2. Find and select your project.
  3. Select Settings (gear icon), then Project settings on the left-hand panel.
  4. Under Your apps, select your app and navigate to App ID.
  5. Find and copy your Firebase App ID.

To get your API secret:

  1. Go to your Google Analytics dashboard.
  2. Select Admin > Data collection and modification > Data streams.
  3. Select your app data stream, navigate to Measurement Protocol API secrets > Secret value.
  4. Find and copy your API secret.
    1. If you do not yet have an API secret, under Measurement Protocol API secrets select Create.
    2. Enter a name and select Create.

Set up key event in Google Analytics

You need to set up campaign_details as a key event in the Google Analytics dashboard so that Google can leverage the details shared by Adjust for attribution. For more information about key events, see Google Analytics documentation.

Integrate the Firebase SDK

You need to integrate the Firebase SDK in your app and implement session partner parameters within the Adjust SDK. This is required because Google Analytics 4 creates an app_instance_id for every instance of an app install containing the Firebase SDK. If app_instance_id is not recorded and passed accordingly, Adjust does not send callbacks to Google Analytics.

Follow the guides linked below to use this feature:

iOS | Android | Unity | Flutter | React Native

Session partner parameters allow the Adjust SDK to track Google Analytics 4’s app_instance_id and include it when sending data to Google Analytics 4. You should set app_instance_id before initialising the Adjust SDK.

Note:

Organic traffic is not shared via this integration. Due to differences in the attribution methodology, Google Analytics does not accept conversions older than 3 days. Depending on the attribution windows configured for your Links, you might see discrepancies as some conversions might not be reported in Google Analytics 4.

Select Google Analytics 4 and your app in Campaign Lab

  1. Under Campaign Lab, select Partners.
  2. Select New partner > Google Analytics 4. Select Next to move to the next screen.
  3. 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.
  4. Select Next.

Enable data sharing

Enable data sharing to activate the integration with Google Analytics 4. To enable data sharing:

  1. Enter your Firebase App ID, 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:

  1. Separate data sharing options at the platform-level by selecting Use platform-specific settings.
  2. Set the same data sharing settings for multiple platforms by selecting Use global settings.

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.

  1. Set up partner parameters within the Adjust SDK.
  2. Under Set your data sharing options, select Parameters.
  3. Under Map parameters, you can specify how you want to send partner parameters defined in the SDK to the network:
    1. Select Map parameter.
    2. In the SDK parameter field, enter the name of the SDK parameter you want to share with the network.
    3. In the Partner parameter field, enter the network parameter that corresponds to the SDK parameter.
Note:

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.

List of all parameters forwarded to Google Analytics 4

Google Analytics 4 requires Adjust to send the following parameters (data points) with your callbacks:

PlaceholderInformation
{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