Tracking AppView events in GA via Google Tag Manager from iOS

I am trying to get GA Screens working through Google Tag Manager in iOS. I have configured GTM tag with App View tracking type and I can see events go but screen name is always (not set)

GA view

I tried to set different variables / parameters in GTM but failed so far. Any ideas?

Thank.

+3


source to share


3 answers


It was very difficult and totally undocumented from Google. You have to configure the tag as an application view and add a & cd field and set its value to your screen name. It can be tracked in real time. gtm panel configuration



Look for some more context: Google Docs for Google Analytics

+3


source


Here is the working code I am using.

id tracker = [[GAI sharedInstance] defaultTracker];
[tracker set:kGAIScreenName value:NSStringFromClass([self class])];
[tracker send:[[GAIDictionaryBuilder createAppView] build]];

      



You should probably use this:

NSString *screenName = /* YOUR SCREEN NAME HERE */
id tracker = [[GAI sharedInstance] defaultTracker];
[tracker set:kGAIScreenName value:screenName];
[tracker send:[[GAIDictionaryBuilder createAppView] build]];

      

0


source


code:

[dataLayer push:@{@"event": @"screenView",@"screenName":name}]

      

enter image description here

-2


source







All Articles