2
votes

We are trying to use the AdWords conversion tracking through Google Tag Manager, but we can't get the tracking status to change to verified. Probably the events aren't firing properly..

Has anyone got it to work?

Here is our process:

  1. Create the Adwords campaign.
  2. Create a iOS conversion tag in tag manager.
  3. Integrate the Tag Manager.

This is the integration code:

// used for the container preview
NSURL *launchURL = launchOptions[UIApplicationLaunchOptionsURLKey];
[TAGManager.instance previewWithUrl:launchURL];

#if DEBUG
[[TAGManager instance].logger setLogLevel:kTAGLoggerLogLevelVerbose];
#endif

// https://developers.google.com/tag-manager/ios/v3/
[TAGContainerOpener openContainerWithId:@"GTM-TAAAAG"
                             tagManager:[TAGManager instance]
                               openType:kTAGOpenTypePreferNonDefault
                                timeout:nil
                               notifier:self];

#pragma mark - TAGContainerOpenerNotifier

- (void)containerAvailable:(TAGContainer *)container
{
    TAGDataLayer *dataLayer = [TAGManager instance].dataLayer;
    [dataLayer pushValue:@"appLaunch" forKey:@"event"];
}

Additional info:

enter image description here

1
Out of curiosity, when this "wasn't working", were you getting any error messages similar to "_aid has no backing implementation."? - faridghar

1 Answers

3
votes

Freaking Google...

The SDK was implemented by another developer, so I deleted and downloaded it again. After downloading the SDK, I RTFM that comes with it, as should any developer, and found this:

In order to ensure that the libAdIdAccess.a code doesn't get dead-stripped from your executable during linking, you'll need to either add the -all_load or -ObjC flag to the "Other Linker Flags", or, for finer-grained control, add the -force_load flag (followed by a full pathname to libAdIdAccess.a).

I mean.. C'mon. Can't there be a useful error message that points out I was missing this? We can't use the -ObjC in our app due to a rogue library, so it was causing GTM to not work, and using the -force_load did the trick.

Now, I see the following log, which I didn't see before:

GoogleTagManager verbose: Successfully sent hit: http://www.googleadservices.com/pagead/conversion/...

And now, I am a happy panda.