How to Integrate AppsFlyer with Google Analytics

  • Advertisers
  • Ad Networks


The purpose of this article is to describe how to integrate AppsFlyer with Google Analytics. Once integrated AppsFlyer data is presented in the Google Analytics dashboard.

The integration can be performed in three different ways:

1. Integrating AppsFlyer’s Data with Google Analytics

2. Custom Dimensions on Google Analytics

3. UTM Parameters (not recommended)

1. Integrating AppsFlyer's Data with Google Analytics

Advertisers who are used to working with Google Analytics (GA) can easily supplement GA information with rich mobile attribution data from AppsFlyer, for both iOS and Android apps. 

For every new install or in-app event AppsFlyer can automatically send a postback with the following attribution data to GA:

  • Media source name (utm_source)
  • Campaign name (utm_campaign)
  • Google search Keywords (utm_term)
  • Country code (Geo)
  • App ID
  • App Name
  • Bundle ID
  • App version
  • CID (Advertising ID for Android or IDFA for iOS)
  • Type (install / in-app event)
  • Event name (as sent from AF SDK)

AppsFlyer also sends all organic installs and events data to GA. Please note that organic data has no source information associated with it.

Setting Up Google Analytics

Go to the dashboard of your app and click on Integrated Partners on the left bar.


Enter "Google Analytics" in the search field and click on its logo to open the Google Analyticsconfiguration window.

The Google Analytics configuration window includes 4 tabs: Integration, Tracking link, Data enrichment and Permissions. Click on the items below to read about the tabs setup. 

For a detailed description of the Partner Configuration Window Header, click here.

Integration Tab

The Integration Tab is divided into different sections as described below. 

General Settings

Account ID

Google Analytics connects with AppsFlyer via a unique Account ID. If you don't already have it, you must obtain it from Google Analytics to continue with the integration or follow the steps below.


Obtaining the Account ID

From the Google Analytics admin window, copy your Tracking ID


From AppsFlyer's Partner Integration Configuration window select Enable to integrate and send all installs to Google Analytics.

Paste the Tracking ID in the Account_ID field.

Click Save to finish if you only want to send mobile installations data to GA.

AppsFlyer and Google Analytics SDKs

If your app has both the AppsFlyer and GA SDKs integrated in it, then you must set the Client ID (CID) parameter value to match between the two SDKs. GA’s SDK creates a unique CID upon initialization, while for AppsFlyer the value sent as CID is the unique Device ID (GAID for Android and IDFA for iOS). If these values are not matched, data reported on GA’s platform is duplicated.

To avoid duplicate data reporting you must perform ONE of the following options:

If you choose the first option leave the Enable sending CustomerUserID button toggled to off (see below).
For the second option you must toggle the button to "On".

The correct time to perform the tracking, as described, is after the new version has been submitted and updated by the majority of your active users.

If your app has only the AppsFlyer’s SDK, then no code changes are required.

Migrating from the Old UTM Parameters System

AppsFlyer also supports an older integration method with Google Analytics. For details, click here.

If your app is already using the older integration method it has to be disabled first or the result is duplicate results on GA when both methods are activated at the same time. Contact AppsFlyer Support or your CSM to perform the switch over between the two methods to avoid any duplicates or loss of data.

Default Postbacks

AppsFlyer can send automatic postbacks to Google Analytics user installs. Use this section to define sending these postbacks. 

Select Events attributed to any partner or organic to send postbacks for any user that downloads the app to Google Analytics. 


According to both Facebook and Twitter Terms and Conditions, we cannot share user level data with any 3rd party. Therefore, all Facebook and Twitter installs are sent to Google Analytics as organic.

For details on sharing data with 3rd parties, click here.

In-App Event Settings

Enter the Account ID again to enable in-app event postbacks.

In-App Event Postbacks

Toggle to ON to enable sending in app event postbacks for this partner.


Tracking Link Tab

Tracking Links are not available for Google Analytics.

Data Enrichment Tab

Data Enrichment is not available for Google Analytics.

Permissions Tab

Permissions are not available for Google Analytics.

2. Custom Dimensions on Google Analytics

There is another available method for sending AppsFlyer's attribution data to Google analytics, that is set up on GA and not on AppsFlyer's dashboard. 

Advertisers that use the new integration with Google Analytics don't need to use the custom dimensions method. 

Setting Media Source as Custom Dimension on Google Analytics

Google Analytics has a powerful tool to track user-level segmentation called custom dimensions. The custom dimension values are sent from mobile devices and your reports are generated, based on these dimensions from your Google Analytics dashboard.


Some media sources prohibit the sending of user level data to 3rd parties as described in their terms of service, e.g. Facebook, Twitter, Snapchat etc.

Step 1 - Define it on Google Analytics

  • Select your app from the GA menu.
  • Select Admin at the top bar on GA dashboard.
  • On the PROPERTY column select Custom Definition 
  • Select Custom Dimensions

  • Create a new dimension. Call it AppsFlyer Media Source and make sure you select User scope. This ensures the data is saved over multiple sessions.


Every dimension is created with an index which you must remember so you can later use it in the GA API from your app. In this example the index of our new dimension is 10.

Repeat this step and create another dimension and call it AppsFlyer Campaign

Step 2 - Setting and Sending the Data from the App

First we need to get the media source value from AppsFlyer SDK. This can be performed on the AppsFlyerTrackerDelegate method onConversionDataReceived.

Android iOS
private static Tracker sTracker;
public void onInstallConversionDataLoaded(Map<String, String> conversionData) {
if (conversionData.get("af_status") == "Non-organic"){
String mediaSource = conversionData.get("media_source");
String campaign = conversionData.get("campaign");
sTracker.set(Fields.customDimension(10), mediaSource);
sTracker.set(Fields.customDimension(1), campaign);
} else if (conversionData.get("af_status") == "Organic"){
sTracker.set(Fields.customDimension(10), "Organic");

Step 3 - Generate Reports

Most of GA reports have a drill-down option called Secondary Dimension. You can select the new dimensions from this drill-down:


You can also generate custom reports based on this dimension. 

3. UTM Parameters

UTM parameters is a method for sending AppsFlyer's attribution data to Google Analytics.
UTM parameters are tags added to a URL — when the AppsFlyer Tracking Link is clicked, the tags are added to the Google Play URL.

However, UTM parameters don't work in most cases. Ad Networks with a server-to-server integration (i.e. Facebook, Twitter, etc.) are currently not supported. Also, if AppsFlyer is not the last party redirecting to Google Play this method does not work.

If you are still using UTM parameters it is highly recommended to use one of the preferred methods detailed above.

UTM Parameters Details


  • To enable UTM parameters to be added to the link, contact your AppsFlyer Customer Success Manager.
  • This article is relevant for Android apps only. 

When enabled, we automatically add two parameters to the click URL when forwarding the traffic to the Google Play Store (as a part of the 'referrer' value):

Set to the media source name (i.e. the value of the 'pid' parameter on the click URL)
Set to the campaign name (i.e. the value of the 'c' parameter on the click URL)

In addition, when one of the following parameters explicitly appears on the AppsFlyer tracking link, we add it to the Google Play redirected link:

  • utm_source (overrides the 'pid' value)
  • utm_campaign (overrides the 'c' value)
  • utm_medium
  • utm_term
  • utm_content

There are two ways to retrieve these values from Google Analytics or the Google Play Campaigns Measurement API:

Was this article helpful?
1 out of 1 found this helpful