Google Analytics for iOS does not send events

I use the latest version of the SDK and the base code to register and submit the pageview:

[[GANTracker sharedTracker] startTrackerWithAccountID:@"UA-MY_ACCOUNT_ID-1" dispatchPeriod:10 delegate:self]; NSError *error; if (![[GANTracker sharedTracker] trackPageview:@"/firstpage" withError:&error]) { NSLog(@"tracker failed: %@",error); } 

However, events are not dispatched from the device or simulator. There are no errors. When I turn on the debug flag, I can see the following:

 dispatch called dispatching 4 events [after 10 seconds] dispatch called ...dispatcher was busy [after 10 seconds] dispatch called ...dispatcher was busy 

My delegate method is never called:

 - (void)trackerDispatchDidComplete:(GANTracker *)tracker eventsDispatched:(NSUInteger)eventsDispatched eventsFailedDispatch:(NSUInteger)eventsFailedDispatch{ NSLog(@"success: %d failures: %d",eventsDispatched,eventsFailedDispatch); } 
  • I tried to create a new publisher id, but that didn't help either.
  • I have an internet connection from my device and simulator
  • I uninstalled the app before trying.
  • I played with the sending period - set it to -1 and manually displayed the newsletter

Nothing helped....: (

I've been struggling with this all day ... how can I get it to work?

+4
source share
2 answers

I had the same problem with the dispatcher ("... the dispatcher was busy"). In my case, this was because I ran my application, usually in the background, and it used a dispatcher. When I tried to connect the device to Xcode to start and debug the application, the console showed me this message. So the solution was easy:

  • Stop application in Xcode
  • Close application in background

What is it.

+1
source

you can put manual sending after calling GANTracker: [[GANTracker sharedTracker] sending]; and it works great

0
source

Source: https://habr.com/ru/post/915962/


All Articles