HTTP status in Google Analytics -1 when sent on GET request https://ssl.google-analytics.com/collect

I am implementing Google Analytics. I can send Hit:

[self.tracker send:[[GAIDictionaryBuilder createEventWithCategory:@"Application" action:@"BecomeActive" label:@"WakeUp" value:NULL] build]]; 

Magazines:

 VERBOSE: GoogleAnalytics 3.12 -[GAIRequestBuilder requestPostUrl:payload:compression:] (GAIRequestBuilder.m:167): building URLRequest for https://ssl.google-analytics.com/batch VERBOSE: GoogleAnalytics 3.12 -[GAIBatchingDispatcher dispatchWithCompletionHandler:] (GAIBatchingDispatcher.m:632): Sending hit(s) POST: https://ssl.google-analytics.com/batch INFO: GoogleAnalytics 3.12 -[GAIBatchingDispatcher didSendHits:response:data:error:] (GAIBatchingDispatcher.m:226): Hit(s) dispatched: HTTP status 200 INFO: GoogleAnalytics 3.12 -[GAIBatchingDispatcher deleteHits:] (GAIBatchingDispatcher.m:529): hit(s) Successfully deleted INFO: GoogleAnalytics 3.12 -[GAIBatchingDispatcher didSendHits:] (GAIBatchingDispatcher.m:237): 2 hit(s) sent 

BUT!!! When I try to send an event like:

 id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker]; @try { [tracker set:kGAIScreenName value:@"XxxxxTableView"]; [tracker send:[[GAIDictionaryBuilder createScreenView] build]]; } @catch (NSException *exception) { NSLog(@"[ERROR] in Automatic screen tracking: %@", exception.description); } 

I got the following:

 VERBOSE: GoogleAnalytics 3.12 -[GAIRequestBuilder requestGetUrl:payload:] (GAIRequestBuilder.m:195): building URLRequest for https://ssl.google-analytics.com/collect VERBOSE: GoogleAnalytics 3.12 -[GAIBatchingDispatcher dispatchWithCompletionHandler:] (GAIBatchingDispatcher.m:632): Sending hit(s) GET: https://ssl.google-analytics.com/collect?av=3.5&cid=e4b9472c-bb43-48f8-8a99-b58a918cdfa9&tid=UA-47572144-2&a=1081489894&dm=iPhone7%2C2&cd=XxxxxTableView&t=screenview&aid=com.yyyyyyy.appName&ul=en&_u=.oK29L&ds=app&sr=640x1136&v=1&_s=65&_crc=0&an=App+Name&_v=mi3.1.2&ht=1432174659618&qt=5020&z=1540606593628258960 INFO: GoogleAnalytics 3.12 -[GAIBatchingDispatcher didSendHits:response:data:error:] (GAIBatchingDispatcher.m:226): Hit(s) dispatched: HTTP status -1 INFO: GoogleAnalytics 3.12 -[GAIBatchingDispatcher deleteHits:] (GAIBatchingDispatcher.m:529): hit(s) Successfully deleted INFO: GoogleAnalytics 3.12 -[GAIBatchingDispatcher didSendHits:] (GAIBatchingDispatcher.m:237): 1 hit(s) sent 

HTTP status is -1. And Google Analytics does not get this hit. I tried to send this request through a web browser, getting an HTTP status of 200. And Google Analytics got this hit.

So, how to send Hit (s) to GA when we use GET to request https://ssl.google-analytics.com/collect ...........?

+5
source share

All Articles