我遵循GTM-IO的官方示例。如果有效则进行抽样;我做了一个愚蠢的方法,恢复了:
TAGDataLayer * dataLayer = tagManager.dataLayer;
id trac = [[GAI sharedInstance] defaultTracker];
[trac push:@{@"event": @"openScreen", @"screenName": @"Home Screen"}];
[trac send:@{@"event": @"openScreen", @"screenName": @"Home Screen"}];
[dataLayer push:@{@"event": @"openScreen", @"screenName": @"Home Screen"}];
[tagManager dispatch];
我的控制台日志告诉我这些;但没有收到任何回复:
2015-06-23 17:57:56.907 uterque [15487:184150] GTM:详细:GoogleAnalytics 3.12 - [GAIRequestBuilder requestPostUrl:payload:compression:](GAIRequestBuilder.m:167):构建{{3}的URLRequest } 2015-06-23 17:57:56.907 uterque [15487:184150] GTM:详细:GoogleAnalytics 3.12 - [GAIBatchingDispatcher dispatchWithCompletionHandler:](GAIBatchingDispatcher.m:632):发送命中POST:https://ssl.google-analytics.com/batch 2015-06-23 17:57:57.147 uterque [15487:184093] GTM:Info:GoogleAnalytics 3.12 - [GAIBatchingDispatcher didSendHits:response:data:error:](GAIBatchingDispatcher.m:226):Hit(s)dispatched:HTTP status 200 2015-06-23 17:57:57.147 uterque [15487:184150] GTM:Info:GoogleAnalytics 3.12 - [GAIBatchingDispatcher deleteHits:](GAIBatchingDispatcher.m:529):hit(s)已成功删除 2015-06-23 17:57:57.148 uterque [15487:184150] GTM:信息:GoogleAnalytics 3.12 - [GAIBatchingDispatcher didSendHits:](GAIBatchingDispatcher.m:237):2个点击发送