Google Ads Conversion Tracking

Google Tag Manager supports flexible, trigger-based Google Ads conversion tracking in iOS 6 using Google Ads Conversion Tracking tags. This guide uses an iOS app download conversion to show you how to configure and implement a Google Ads conversion tracking tag with Google Tag Manager.

To configure and implement Google Ads conversion tracking for an iOS app download:

  1. Create a new conversion in Google Ads
  2. Create blocking and firing triggers
  3. Create an Google Ads conversion tracking tag
  4. Push conversion event to data layer
  5. Record deep links
  6. Publish the container
  7. Access identifier for advertisers (IDFA)

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 App downloads and iOS and click Continue.
  6. Enter the following:
    • Click Name to enter the name of the iOS app and click Done.
    • Click Value to enter a value for each download, or select Don't assign a value to this download, and click Done.
    • Click Optimization, which is selected by default. To turn off optimization, click ON to toggle it to OFF 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 the settings, 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 instruction and code to save the conversionId and label values.
  11. Click Done.

2. Create blocking and firing triggers

In the Google Tag Manager interface, create blocking and firing triggers that will determine when the conversion tracking tag will be fired.

Because Google Ads conversion tags are only supported on iOS v6.0 or higher, you need to create two triggers:

To create a blocking trigger in Google Tag Manager:

  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. Click Untitled Trigger to enter the trigger name osVersionPre6.
  6. Under Fire On, enter the following condition:

    iOS version pre 6.0

  7. Click Create Trigger.

To create a firing trigger in Google Tag Manager:

  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 and select Custom Trigger.
  5. Click Untitled Trigger to enter the trigger name fire when event equals appLaunch and platform equals iOS.
  6. Under This trigger fires on, select Some Events and enter the following conditions:

    app launch on iOS

  7. Click Create Trigger.

3. Create a Google Ads conversion tag

In the Google Tag Manager Interface, use the following configuration values to create a new Google Ads conversion tracking tag to track an app download as a conversion:

Tag Name : iOS App Download Conversion
Tag Type : Google Ads Conversion Tracking
Conversion ID : Copy conversionId from Google Ads Snippet
Conversion Label : Copy label from Google Ads Snippet
Conversion Value : Does not need to match Google Ads Snippet
Unrepeatable : Yes
Firing Trigger: fire when event equals appLaunch and platform equals iOS
Blocking Trigger: osVersionPre6

4. Push the conversion event into the data layer

Add code to your app to push the event that will trigger the conversion to the data layer. For example, to track an app download, push an event with the value appLaunch to the data layer one time after your app launches and the Tag Manager container is available.

//
// MyNotifier.h
//
#import "TAGContainerOpener.h"

@interface MyNotifier : NSObject<TAGContainerOpenerNotifier>

@end

//
// MyNotifier.m
//
#import "AppDelegate.h"
#import "MyNotifier.h"
#import "TAGDataLayer.h"
#import "TAGManager.h"

@implementation MyNotifier

- (void)containerAvailable:(TAGContainer *)container {

  AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];

  if (appDelegate.appLaunchEventPushed == NO) {
    // Push the app launch event once after the container is opened.
    [[TAGManager instance].dataLayer push:@{@"event": @"appLaunch"}];
    appDelegate.appLaunchEventPushed = YES;
  }
}

@end

//
// AppDelegate.m
//
#import "AppDelegate.h"
#import "MyNotifier.h"
#import "TAGDataLayer.h"
#import "TAGManager.h"

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

   // MyNotifier::containerAvailable: is called when the container is opened.
  [TAGContainerOpener openContainerWithId:@"GTM-XXXX"
                               tagManager:[TAGManager instance]
                                 openType:kTAGOpenTypePreferNonDefault
                                  timeout:nil
                                 notifier:[[MyNotifier alloc] init]];

  // Rest of the method implementation.
  return YES:
}

// Rest of the AppDelegate implementation

@end

If your app uses deep linking, to record a deep linking conversion, push the link to the data layer as "gtm.url" inside the application:handleOpenURL in the AppDelegate:

[[TAGManager instance].dataLayer push:@{@"gtm.url": [url absoluteString]}];
[[TAGManager instance] previewWithURL:url];

6. Publish the container

You can now publish your container to begin sending conversion tracking pings to Google Ads. See Publishing and Versions for details.

For additional information about Google Ads conversion tracking, including any questions about how conversions are reported, see Understanding conversion tracking.

7. Access identifier for advertisers (IDFA)

To enable your iOS application to access the identifier for advertisers (IDFA):

  • Include library libAdIdAccess.a in the actual target.
  • In the linker options, specify -ObjC or -force_Load for the actual target.
  • Include AdSupport.framework in the actual target.