Sending custom data to google analytics in iOS

[亡魂溺海] 提交于 2019-12-13 08:31:43

问题


I have integrated google analytics in my iOS project its working propers for events, i also want to sent my

custom values (udid, userid, username..) with custom keys.

Is it possible to do this?

And if yes where can i find those value on Google dashboard?

i have tried

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


回答1:


Set a custom dimension value just before the send call to which you want the value applied.The defined scope of the custom dimension will determine at processing time which additional hits may be associated with that value.

That means a custom dimension is belong to a hit action(such as: sendView,sendAction)

Sample code for custom dimension:

// 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];

then you can see the output in Google analytics console, like this.

sample methods are already available in analytics page



来源:https://stackoverflow.com/questions/33031882/sending-custom-data-to-google-analytics-in-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!