In the AppDElegate.m file:
#import "AppDelegate.h" #import "GAI.h" - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [GAI sharedInstance].trackUncaughtExceptions = YES; [GAI sharedInstance].dispatchInterval = 1; [[[GAI sharedInstance] logger]setLogLevel:kGAILogLevelVerbose]; id<GAITracker> tracker = [[GAI sharedInstance] trackerWithTrackingId:@"TrackingId"]; [GAI sharedInstance].defaultTracker = tracker; return YES; }
In ViewController.h
#import <UIKit/UIKit.h> #import "GAITrackedViewController.h" @interface FirstViewController : GAITrackedViewController @end
In ViewController.m
- (void)viewDidLoad { [super viewDidLoad]; self.screenName = @"RED Screen"; }
Give it a try . It worked just fine for me. I tried more than three applications. And everyone works in real time. If your account for your application is new , you may need to wait 24 hours or more to see the result. Sometimes it takes time to display real-time data for no reason.
source share