[英]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: 我已通过以下方式在Google Analytics iOS中为我的应用实施了3个用户级自定义维度:
[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. 我已在控制面板中正确设置尺寸,并将所有3个列表设置为活动状态。 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. 问题是我在app委托中执行上面的代码行,我没有设置屏幕视图。 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: 您还可以将代码移动到GAITrackedViewController
子类的视图控制器,并执行以下操作:
self.screenName = @"some screen name";
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.