When I tried to implement the Google Analytics SDK for iOS, I ran into two brick walls.
The first is that after executing this code in application:DidFinishLaunchingWithOptions:
[[GANTracker sharedTracker] startTrackerWithAccountID:@"UA-XXXXXXX-YY" dispatchPeriod:10 delegate:self]; [[GANTracker sharedTracker] setDebug:YES];
.. and then try to track something or call dispatch
, no debug messages are logged at all. I added NSLog
lines before and after call tracking, and the code is definitely reached.
Secondly, when I try to send manually, it returns NO
. All the other problems that I have seen on the Internet is where dispatch
returns YES
, but it somehow does not work properly. What if dispatch
really returns NO
?
I tried adding an NSError *
reference to the track methods, and those that actually succeed (no errors, the function returns YES
). But events, of course, are not sent periodically, since we no longer see anything on the GA account in more than 24 hours.
EDIT: I also have NSLog
calls in both delegate methods ( hitDispatched:
and trackerDispatchDidComplete:eventsDispatched:eventsFailedDispatch:
, and none of them are called.
source share