我使用GA跟踪我的应用中的屏幕视图。问题在于,尽管调试日志表明命中已成功发送,但它们并未出现在GA中。它不仅仅是实时视图。他们根本不会出现。我在iOS7和iOS8上尝试过GA v3.0.2,3.0.3c和3.0.9。我尝试在GA上创建新帐户或使用之前的帐户(它在GA v2中工作)。
我正在这样初始化GA:
[GAI sharedInstance].dispatchInterval = GOOGLE_ANALYTICS_DISPATCH_INTERVAL;
[GAI sharedInstance].trackUncaughtExceptions = YES;
[[[GAI sharedInstance] logger] setLogLevel:kGAILogLevelVerbose];
self.tracker = [[GAI sharedInstance] trackerWithTrackingId:GOOGLE_ANALYTICS_ID_IPHONE];
[[GAI sharedInstance] setDefaultTracker:self.tracker];
[[GAI sharedInstance].defaultTracker set:kGAISampleRate value:GOOGLE_ANALYTICS_SAMPLE_RATE];
[[GAI sharedInstance].defaultTracker set:kGAIAnonymizeIp value:GOOGLE_ANALYTICS_ANONYMIZE];
[[GAI sharedInstance].defaultTracker set:[GAIFields customDimensionForIndex:1] value:@""];
[[GAI sharedInstance].defaultTracker set:[GAIFields customDimensionForIndex:3] value:[[GAI sharedInstance].defaultTracker get:kGAIClientId]];
[[GAI sharedInstance].defaultTracker send:[[[GAIDictionaryBuilder createEventWithCategory:@"UX"
action:@"appstart"
label:nil
value:nil] set:@"start" forKey:kGAISessionControl] build]];
日志(使用v3.09捕获)
2014-10-08 11:56:38.752 Lauritz[321:45873] VERBOSE: GoogleAnalytics 3.09 -[GAIBatchingDispatcher persist:] (GAIBatchingDispatcher.m:431): Saved hit: {
parameters = {
"&_crc" = 0;
"&_u" = ".ojL";
"&_v" = "mi3.0.9";
"&a" = 2011837377;
"&aid" = "com.lauritz.ios.chair";
"&aip" = YES;
"&an" = Lauritz;
"&av" = "1.2.1";
"&cd" = "lauritzapp/view/loading-page";
"&cd1" = "a8f7a271770289ac72babc1cfad2966ef8e02c757de427fffbbc702845253e30-test";
"&cd3" = "3d6b3c54-650d-4501-9d1f-0a6078d921fc";
"&cid" = "3d6b3c54-650d-4501-9d1f-0a6078d921fc";
"&sf" = 100;
"&sr" = 320x568;
"&t" = timing;
"&tid" = "UA-948120-10";
"&ul" = en;
"&utc" = API;
"&utl" = Success;
"&utt" = "0.2104618549346924";
"&utv" = "http://193.238.185.163/json/api/v1.1/downtime/prod/eng/1026790";
"&v" = 1;
"&z" = 2286094286496569613;
gaiVersion = "3.09";
};
timestamp = "2014-10-08 09:56:38 +0000";
}
2014-10-08 11:56:39.128 Lauritz[321:45817] INFO: GoogleAnalytics 3.09 -[GAIBatchingDispatcher didSendHits:response:data:error:completionHandler:] (GAIBatchingDispatcher.m:161): Hit(s) dispatched: HTTP status 200
2014-10-08 11:56:39.130 Lauritz[321:45873] INFO: GoogleAnalytics 3.09 -[GAIBatchingDispatcher deleteHits:] (GAIBatchingDispatcher.m:443): hit(s) Successfully dispatched
2014-10-08 11:56:39.133 Lauritz[321:45873] INFO: GoogleAnalytics 3.09 -[GAIBatchingDispatcher didSendHits:sendMore:] (GAIBatchingDispatcher.m:174): 1 hit(s) sent
2014-10-08 11:56:39.136 Lauritz[321:45873] VERBOSE: GoogleAnalytics 3.09 -[GAIRequestBuilder requestGetUrl:payload:] (GAIRequestBuilder.m:195): building URLRequest for https://ssl.google-analytics.com/collect
2014-10-08 11:56:39.136 Lauritz[321:45873] VERBOSE: GoogleAnalytics 3.09 -[GAIBatchingDispatcher dispatchWithCompletionHandler:] (GAIBatchingDispatcher.m:536): Sending hit(s) GET: https://ssl.google-analytics.com/collect?an=Lauritz&cd1=a8f7a271770289ac72babc1cfad2966ef8e02c757de427fffbbc702845253e30-test&a=2011837377&cd=lauritzapp%2Fview%2Floading-page&av=1.2.1&t=screenview&_crc=0&ul=en&cd3=3d6b3c54-650d-4501-9d1f-0a6078d921fc&tid=UA-948120-10&cid=3d6b3c54-650d-4501-9d1f-0a6078d921fc&sr=320x568&aip=YES&v=1&_u=.K-L&aid=com.lauritz.ios.chair&_v=mi3.0.9&sf=100&ht=1412762194460&qt=4675&z=2286094286496569612
2014-10-08 11:56:39.229 Lauritz[321:45817] INFO: GoogleAnalytics 3.09 -[GAIBatchingDispatcher didSendHits:response:data:error:completionHandler:] (GAIBatchingDispatcher.m:161): Hit(s) dispatched: HTTP status 200
2014-10-08 11:56:39.230 Lauritz[321:45873] INFO: GoogleAnalytics 3.09 -[GAIBatchingDispatcher deleteHits:] (GAIBatchingDispatcher.m:443): hit(s) Successfully dispatched
2014-10-08 11:56:39.232 Lauritz[321:45873] INFO: GoogleAnalytics 3.09 -[GAIBatchingDispatcher didSendHits:sendMore:] (GAIBatchingDispatcher.m:174): 1 hit(s) sent
2014-10-08 11:56:39.236 Lauritz[321:45873] VERBOSE: GoogleAnalytics 3.09 -[GAIRequestBuilder requestGetUrl:payload:] (GAIRequestBuilder.m:195): building URLRequest for https://ssl.google-analytics.com/collect
2014-10-08 11:56:39.236 Lauritz[321:45873] VERBOSE: GoogleAnalytics 3.09 -[GAIBatchingDispatcher dispatchWithCompletionHandler:] (GAIBatchingDispatcher.m:536): Sending hit(s) GET: https://ssl.google-analytics.com/collect?utv=http%3A%2F%2F193.238.185.163%2Fjson%2Fapi%2Fv1.1%2Fdowntime%2Fprod%2Feng%2F1026790&utc=API&ul=en&cd3=3d6b3c54-650d-4501-9d1f-0a6078d921fc&tid=UA-948120-10&utt=0.2104618549346924&_v=mi3.0.9&cid=3d6b3c54-650d-4501-9d1f-0a6078d921fc&an=Lauritz&cd1=a8f7a271770289ac72babc1cfad2966ef8e02c757de427fffbbc702845253e30-test&a=2011837377&_crc=0&sr=320x568&t=timing&utl=Success&cd=lauritzapp%2Fview%2Floading-page&aip=YES&v=1&_u=.ojL&sf=100&aid=com.lauritz.ios.chair&av=1.2.1&ht=1412762198748&qt=487&z=2286094286496569613
2014-10-08 11:56:39.325 Lauritz[321:45817] INFO: GoogleAnalytics 3.09 -[GAIBatchingDispatcher didSendHits:response:data:error:completionHandler:] (GAIBatchingDispatcher.m:161): Hit(s) dispatched: HTTP status 200
2014-10-08 11:56:39.326 Lauritz[321:45873] INFO: GoogleAnalytics 3.09 -[GAIBatchingDispatcher deleteHits:] (GAIBatchingDispatcher.m:443): hit(s) Successfully dispatched
2014-10-08 11:56:39.329 Lauritz[321:45873] INFO: GoogleAnalytics 3.09 -[GAIBatchingDispatcher didSendHits:sendMore:] (GAIBatchingDispatcher.m:174): 1 hit(s) sent
这是我用来发送匹配的代码:
[[GAI sharedInstance].defaultTracker set:kGAIScreenName value:@"page"];
[[GAI sharedInstance].defaultTracker send:[[GAIDictionaryBuilder createAppView] build]];
据我所知,一切正常,点击成功发送。问题是他们没有在GA中展示。正如我所说,它不仅适用于实时视图。昨天的点击也没出现,所以这不是等待谷歌处理它们的问题。
有什么想法吗?