0

I Have integrate Google analytics for screen tracking to my app but at time of initlisation tracker return nil

id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];

I added sdk in my project and i have used previous code to init tracker any one have idea why this happens.

1

1 Answer 1

0

In AppDelegate, Add following code in didFinishLaunchingWithOptions

// Optional: configure GAI options.
GAI *gai = [GAI sharedInstance];
gai.trackUncaughtExceptions = YES;  // report uncaught exceptions

Add these lines in view controller for screen tracking:

id<GAITracker> tracker = [[GAI sharedInstance] defaultTracker];
[tracker set:kGAIScreenName value:name];
[tracker send:[[GAIDictionaryBuilder createScreenView] build]];

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.