简体   繁体   中英

Custom Dimensions in Google Analytics iOS

I have implemented 3 user level custom dimensions in Google Analytics iOS for my app in the following manner:

[tracker send:[[[GAIDictionaryBuilder createAppView] set:[DeviceType deviceType] forKey:[GAIFields customDimensionForIndex:1]] build]];
[tracker send:[[[GAIDictionaryBuilder createAppView] set:[[UIDevice currentDevice] systemVersion] forKey:[GAIFields customDimensionForIndex:2]] build]];
[tracker send:[[[GAIDictionaryBuilder createAppView] set:fullVersionUser forKey:[GAIFields customDimensionForIndex:3]] build]];

I've set up the dimensions properly in the control panel and all 3 list as active. I'm just wondering, how do I simply view these dimensions? I've tried generating a custom report and nothing seems to show. Is there anyway to make these dimensions appear in the regular report?

The issue was that I was executing the above line of code in the app delegate where I wasn't setting a screen view. When I changed the code to the following:

[tracker send:[[[[GAIDictionaryBuilder createAppView] set:@"App Delegate"  forKey:kGAIScreenName] set:[DeviceType deviceType] forKey:[GAIFields customDimensionForIndex:1]] build]];

it worked. You could also move the code to a view controller that subclasses GAITrackedViewController and does:

self.screenName = @"some screen name";

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM