roh*_*tel 11 iphone google-analytics objective-c ios firebase-analytics
我决定在Flurry上使用Google Analytics,因为Flurry停止更新跟踪事件,Flurry支持团队的任何人都回复了我的查询.我的要求如下:

因此,在谷歌分析事件跟踪功能createEventWithCategory几乎是必要的,但它不允许我添加我的自定义参数,如用户ID,时间戳.
[tracker send:[[GAIDictionaryBuilder createEventWithCategory:@"ui_action" // Event category (required)
action:@"button_press" // Event action (required)
label:@"play" // Event label
value:nil] build]]; // Event value
Run Code Online (Sandbox Code Playgroud)
我尝试了两个解决方案和他们都不是高达了我的意料这使我对于每一个方法,我花了两个问题:
文档有一个示例代码,如下所示:
// 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]];
Run Code Online (Sandbox Code Playgroud)
[ 自定义尺寸值可以与任何Google Analytics匹配类型一起发送,包括屏幕视图,事件,电子商务交易,用户计时和社交互动.]
因此,我决定使用自定义维度与createEventWithCategory方法,最终做如下**,但有效但不显示数据,如Flurry所示.**
NSString *dimensionValue = @"USER_ID";
[tracker set:[GAIFields customDimensionForIndex:1] value:dimensionValue];
[tracker send:[[[GAIDictionaryBuilder createEventWithCategory:@"TAB_CLICK"
action:@"Tab Hit"
label:clickedTabName
value:nil]
set:currentUserEmail forKey:[GAIFields customDimensionForIndex:1]] build]];
Run Code Online (Sandbox Code Playgroud)

我按照文档并尝试将NSDictionary对象发送到- (void)send:(NSDictionary *)parameters;声明的方法GAITracker.h.
但我不知道这些数据将出现在仪表板中.行为不在实时中它既不显示任何更新.
id<GAITracker> tracker = [[GAI sharedInstance] trackerWithTrackingId:@"UA-XXXX-X"];
NSDictionary *dataToSendGoogleAnalytics = [NSDictionary dictionaryWithObjectsAndKeys:currentTime,@"TIME_STAMP",clickedTabName,@"TAB_NAME", currentUserEmail, @"USER_ID",nil];
[tracker send:dataToSendGoogleAnalytics];
Run Code Online (Sandbox Code Playgroud)

使用这样接受NSDictionary对象的简单函数?
[Flurry logEvent:@"TAB_CLICKED" withParameters:dataToSendFlurry timed:YES];
Run Code Online (Sandbox Code Playgroud)
任何建议或提示将不胜感激.谢谢.
我从未在 GA 中使用过自定义参数,无论如何我认为这可以帮助你。




| 归档时间: |
|
| 查看次数: |
5914 次 |
| 最近记录: |