适用于iOS的GA和自定义尺寸 [英] GA for iOS and custom dimensions

查看:78
本文介绍了适用于iOS的GA和自定义尺寸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在iOS应用中设置了Google Analytics,该应用正在发送供应商标识符以区分报告中的用户。以下是我们所做的:

We've setup Google Analytics in an iOS app which is sending the vendor identifier to distinguish between users on the reports. Here's what we've done:

在Google Analytics中,我们已经设置了自定义维度,如下所示:

In Google Analytics we've setup a Custom Dimension as follows:

名称:用户标识符
作用域:用户
活动:真正的

Name: User identifier Scope: User Active: True

在AppDelegate中添加以下内容:

In the app we add the following in the AppDelegate:

[tracker set:[GAIFields customDimensionForIndex:1] value:uuidString]; // uuidString is the device identifier

在日志记录窗口中,我可以看到 cd1 是正确的值,但我们的自定义报告没有显示自定义维度的数据。

In the logging window I can see that the value of cd1 is the correct value yet our custom report shows no data for the custom dimension.

我们使用的是Google Analytics 3.02。

We are using Google Analytics 3.02.

有没有人知道我们要出错的地方?

Does anyone have any idea where we are going wrong?

推荐答案

您是否发送跟踪器?

这是 Custom Dimensions& iOS SDK的指标

// May return nil if a tracker has not yet been initialized with a property ID.
id tracker = [[GAI sharedInstance] defaultTracker];

// Set the custom dimension value on the tracker using its index.
[tracker set:[GAIFields customDimensionForIndex:1]
       value:@"Premium user"]

[tracker set:kGAIScreenName
       value:@"Home screen"];

// Send the custom dimension value with a screen view.
// Note that the value only needs to be sent once, so it is set on the Map,
// not the tracker.
[tracker send:[[[GAIDictionaryBuilder createAppView] set:@"premium"
                                                  forKey:[GAIFields customDimensionForIndex:1]] build]];

这篇关于适用于iOS的GA和自定义尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆