在iOS中发送自定义数据到谷歌分析

我已经整合了谷歌分析在我的iOS项目的工作propers事件,我也想发送我的

使用自定义键的自定义值(udid,userid,username ..)。

是否有可能做到这一点?

如果是,我可以在Google仪表板上find这些价值吗?

我努力了

https://developers.google.com/analytics/devguides/collection/ios/v3/customdimsmets

在您希望应用值的发送调用之前设置自定义维度值。自定义维度的定义范围将在处理时间确定哪些附加匹配可能与该值相关联。

这意味着一个自定义维度属于一个命中行为(如:sendView,sendAction)

自定义维度的示例代码:

// Get the tracker object. id tracker = [[GAI sharedInstance].defaultTracker; // Set the dimension value for index 1. [tracker setCustom:1 dimension:@"key1"]; // Dimension value is associated and sent with this hit. [tracker sendView:screenName]; 

那么您可以在Google分析控制台中看到输出,就像这样 。

样本方法已经在分析页面中可用