Google Ads conversion tracking

Google Tag Manager provides Google Ads conversion tracking tags to support flexible, rule-based Google Ads conversion tracking for Android apps.

This guide shows you how use Google Tag Manager to track Android app install conversions with Google Ads conversion tracking tags:

  1. Create a new conversion in Google Ads
  2. Create a trigger to fire a Google Ads conversion tracking tag
  3. Create a Google Ads conversion tracking tag
  4. Update file AndroidManifest.xml
  5. Push the conversion event to the data layer
  6. Record deep links
  7. Publish the container

1. Create a new conversion in Google Ads

To create a new conversion in Google Ads:

  1. Sign in to your Google Ads account.
  2. At the menu bar, select Tools > Conversions.
  3. Click + CONVERSION.
  4. Select App.
  5. Select Android and App installs (first open) and click Continue.
  6. Enter the following:
    • Click Name to the name of the Android app and click Done.
    • Click Value to enter a value for each install of the app, or select Don't assign a value to this install, and click Done.
    • Click Package name to enter the package name of your Android app within Google play and click Done.
    • Click Optimization, which is turned off by default. To turn on optimization, click OFF to toggle it to ON and click Done.
    • (Optional). Click Postback URL to enter the URL from your analytics provider where you’d like conversions to be posted and click Done.
  7. Click Save and continue.
  8. Review your conversion settings. To change them, click Edit settings.
  9. Under Set up your tracking method, select Put tracking code into the app.
  10. Click Save instructions and code or Email instructions and code to save the conversion ID and conversion label, which are required to create a Google Ads conversion tracking tag.
  11. Click Done.

2. Create a trigger to fire a Google Ads conversion tracking tag

To create a trigger in Google Tag Manager to fire the Google Ads conversion tracking tag:

  1. Sign in to your Google Tag Manager account.
  2. Select a mobile container.
  3. On the left navigation bar, click Triggers.
  4. Click New.
  5. Under Fire On, enter the following conditions:

    tracking method

  6. Click Create Trigger.
  7. Enter a trigger name.
  8. Click Save.

3. Create a Google Ads conversion tracking tag

To create a Google Ads conversion tracking tag:

  1. Sign in to your Google Tag Manager account.
  2. Select a mobile container.
  3. On the left navigation bar, click Tags.
  4. Click New.
  5. Choose product Google Ads.
  6. Choose tag type Google Ads Conversion Tracking.
  7. Enter the Conversion ID and Conversion Label.
  8. Select Unrepeatable.
  9. Click Continue.
  10. Under Fire On, select Custom event.
  11. Select the trigger created in step 2.
  12. Click Save.
  13. Click Create Tag.
  14. Enter a tag name (e.g. Android App Install Conversion).
  15. Click Save.

4. Update file AndroidManifest.xml

In Android Studio, open the AndroidManifest.xml file to add the following within the <application> tag:

<service android:name="com.google.android.gms.tagmanager.InstallReferrerService"/>
<receiver
   android:name="com.google.android.gms.tagmanager.InstallReferrerReceiver"
   android:exported="true">
   <intent-filter>
       <action android:name="com.android.vending.INSTALL_REFERRER" />
   </intent-filter>
</receiver>

5. Push the Google Ads conversion event to the data layer

First initialize Google Tag Manager (GTM). Then add the following code you to your app to push the Google Ads conversion event to the data layer, which will enable GTM to evaluate the trigger and fire the matching tag:

DataLayer dataLayer = TagManager.getInstance(context).getDataLayer();
dataLayer.pushEvent("appLaunch", DataLayer.mapOf());

If your app uses deep linking, to record a deep linking conversion, push the link to the data layer as "gtm.url" in the activities launched by your intents:

if (this.getIntent() != null && this.getIntent().getData() != null ) {
  TagManager.getInstance(this).getDataLayer().push("gtm.url", this.getIntent().getData().toString());
}

7. Publish the container

You can now publish your container to begin firing the Google Ads conversion tag. For details, see Adding, Updating and Publishing Tags on Setup and Workflow (Mobile Apps).