简体   繁体   English

Google Analytics iOS SDK v2-自定义维度

[英]Google Analytics iOS SDK v2 - Custom dimensions

I've recently integrated the latest release of the Google Analytics SDK for iOS. 我最近集成了最新版的iOS版Google Analytics(分析)SDK。 I'm tracking screen views and trying to send custom variables along. 我正在跟踪屏幕视图并尝试发送自定义变量。

The only way I figured out I could use to do that is to use setCustom before sending the screen tracking request, like: 我确定可以使用的唯一方法是在发送屏幕跟踪请求之前使用setCustom,例如:

[[GAI sharedInstance].defaultTracker setCustom:1 dimension:@"dimension"];
[[GAI sharedInstance].defaultTracker trackView:@"To screen one"];

Using the debug mode, I managed to see the custom dimension sent over with the screen view request: 使用调试模式,我设法看到了随屏幕视图请求一起发送的自定义尺寸:

Body: cd2&ul=de&an=MyApp&_v=asldkajsdlkj3l12kj&cd1=dimension&t=appview&sd=24-bit&cd=To+screen+one&sr=320x480&tid=UA-XXXXXXX-X&v=1&av=alpha+6&qt=16921&z=1029348723498274 正文:cd2&ul = de&an = MyApp&_v = asldkajsdlkj3l12kj&cd1 = dimension&t = appview&sd = 24位&cd = To + screen + one&sr = 320x480&tid = UA-XXXXXXX-X&v = 1&av = alpha + 6&qt = 16921&z = 1029348723

under the parameter "cd1". 在参数“ cd1”下。

The problem is: I can't see it anywhere in the dashboard. 问题是:我无法在仪表板上的任何位置看到它。 I've got all the screen views reported, but no custom dimension at all. 我已经报告了所有的屏幕视图,但是根本没有自定义尺寸。

Does anyone have a glimpse of what the problem could be? 是否有人瞥见可能是什么问题?

After asking in the Google Group , a guy named Dave pointed out the following: 向Google网上论坛提问后,一个叫Dave的人指出了以下几点:

Well, this document: 好吧,这份文件:
https://developers.google.com/analytics/devguides/collection/ios/v2/migration https://developers.google.com/analytics/devguides/collection/ios/v2/migration

says that custom variables aren't currently supported in the v2 SDK. 表示v2 SDK当前不支持自定义变量。 Custom dimensions are supported, which is what your code above is trying to set. 支持自定义尺寸,这是您上面的代码尝试设置的尺寸。 But, to use custom dimensions, this page: 但是,要使用自定义尺寸,请访问以下页面:

https://developers.google.com/analytics/devguides/platform/features/customdimsmets https://developers.google.com/analytics/devguides/platform/features/customdimsmets

says that you need to first define them in the GA admin UI. 说您需要首先在GA管理员界面中定义它们。 To explain how to do that, the page links to this page: 为了解释如何做到这一点,该页面链接到该页面:

http://support.google.com/analytics/bin/answer.py?hl=en&answer=2709829 http://support.google.com/analytics/bin/answer.py?hl=zh_CN&answer=2709829

and, unfortunately, those instructions don't match with reality. 不幸的是,这些说明与现实不符。 I don't have a "Custom Dimensions" tab under the "Custom Definitions" tab--I only have a "Custom Data Sources" one there. 我在“自定义定义”标签下没有“自定义维度”标签-我只有一个“自定义数据源”。 So something seems to be out of whack with the instructions or the GA admin UI at the moment--maybe there's beta flux, I don't know. 因此,目前说明或GA管理员UI似乎有些不合时宜了-也许是beta变化,我不知道。 I haven't found any way to define a custom dimension, and I think I've looked pretty much everywhere. 我还没有找到定义自定义维度的任何方法,而且我认为到处都看起来很像。

So, to answer your question: to use custom dimensions, you have to set those up in the GA admin UI before using them in your app. 因此,要回答您的问题:要使用自定义维度,必须先在GA管理员界面中进行设置,然后才能在应用中使用它们。 Currently, I don't see any way to do that, so I'm stuck on that step as well. 目前,我没有任何办法可以做到这一点,因此我也坚持这一步骤。

After contacting the support, looks like they fixed the problem and now it's possible to stup the custom dimenstions on the admin panel. 联系支持人员后,他们似乎解决了问题,现在可以在管理面板上添加自定义尺寸。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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