Google AnalyticsAPI v3未知错误。(Google Analytics API v3 unknown error. createEventWithCategory: not comp

编程入门 行业动态 更新时间:2024-10-26 15:23:09
Google AnalyticsAPI v3未知错误。(Google Analytics API v3 unknown error. createEventWithCategory: not compiling)

GAIDictionaryBuilder设置forKey:GAISessionControl错误读取:值的键表示它不符合代码。

GAIDictionaryBuilder *dictionary = [GAIDictionaryBuilder createEventWithCategory:@"UX" action:@"App started" label:nil value:nil]; [dictionary setValue:@"start" forKey:kGAISessionControl]; [[GAI sharedInstance].defaultTracker send:dictionary.build];

我直接从他们的网站上关注Google的文档,并且仍然不知道错误来自哪里? https://developers.google.com/analytics/devguides/collection/ios/v3/migration#setting-data

GAIDictionaryBuilder set forKey:GAISessionControl error reads: key for value says it's not code compliant.

GAIDictionaryBuilder *dictionary = [GAIDictionaryBuilder createEventWithCategory:@"UX" action:@"App started" label:nil value:nil]; [dictionary setValue:@"start" forKey:kGAISessionControl]; [[GAI sharedInstance].defaultTracker send:dictionary.build];

I am following Google's documentation directly from their site, & still have no idea where the error is coming from? https://developers.google.com/analytics/devguides/collection/ios/v3/migration#setting-data

最满意答案

Google Analytics文档存在错误(与通常一样)。 我通过将“setValue:”替换为“set:”来消除错误

来自:[字典setValue:@“start”forKey:kGAISessionControl];

to:[字典集:@“start”forKey:kGAISessionControl];

现在工作得很好。

GAIDictionaryBuilder *dictionary = [GAIDictionaryBuilder createEventWithCategory:@"UX" action:@"App started" label:nil value:nil]; [dictionary setValue:@"start" forKey:kGAISessionControl]; [[GAI sharedInstance].defaultTracker send:dictionary.build];

Google Analytics documentation has an error (like usual). I got rid of the error by replacing "setValue:" with "set:"

from: [dictionary setValue:@"start" forKey:kGAISessionControl];

to: [dictionary set:@"start" forKey:kGAISessionControl];

Works perfectly now.

GAIDictionaryBuilder *dictionary = [GAIDictionaryBuilder createEventWithCategory:@"UX" action:@"App started" label:nil value:nil]; [dictionary setValue:@"start" forKey:kGAISessionControl]; [[GAI sharedInstance].defaultTracker send:dictionary.build];

更多推荐

本文发布于:2023-07-05 01:02:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1031235.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   Analytics   Google   AnalyticsAPI   createEventWithCategory

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!