Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Integrate Google Analytics Tracking Into IOS App

I would like to Integrate Google Analytics Tracking into my IOS APP.

I have integrated Google Analytics Library and Add It To my Application.

cf. https://developers.google.com/analytics/devguides/collection/ios/v2/

into my code to tracking my view contact

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.trackPageView = @"Contact Screen";
    //
}

A have this error "Property 'TrackPageView' not found on object of the type 'ContactViewController'"

like image 959
user1781040 Avatar asked Dec 07 '22 11:12

user1781040


2 Answers

Today I got the same error, and despite what the setup documentation stated, the property is called screenName. so Just write this line in your viewDidLoad:

self.screenName = @"A name";
like image 163
whtlnv Avatar answered Jan 05 '23 04:01

whtlnv


You are trying to set the wrong property (trackPageView) in your viewDidLoad: where you should actually be setting the trackedViewName property. The code should be as follows:

self.trackedViewName = @"Contact Screen";

Also in your header (.h) file, make sure your @interface inherits from the GAITrackedViewController class like so:

@interface YourContactScreenController : GAITrackedViewController
like image 39
Suhail Patel Avatar answered Jan 05 '23 04:01

Suhail Patel