问题
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