The problem was fixed in the simplest way.
The code I wrote is for AppDelegate . After the tracker has been initialized once with the tracking identifier, you just need to call it in every view that you use. (I'm not sure about this, but it worked for me anyway.)
So in AppDelegate :
// Optional: automatically send uncaught exceptions to Google Analytics. [GAI sharedInstance].trackUncaughtExceptions = YES; // Optional: set Google Analytics dispatch interval to eg 20 seconds. [GAI sharedInstance].dispatchInterval = 20; // Optional: set debug to YES for extra debugging information. [GAI sharedInstance].debug = YES; // Create tracker instance. self.tracker = [[GAI sharedInstance] trackerWithTrackingId:@"UA-TRACKINGID-2"];//UA-33873963-13 - My testing google analytics trackingId [self.tracker setSessionStart:YES]; [self.tracker setSessionTimeout:60];
Inside viewDidLoad view viewDidLoad :
[GAI sharedInstance] defaultTracker]; [self.tracker sendView:@"Some name"];
After that, it worked great.
source share