Search code examples
iosxcodegoogle-analyticstracking

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'"


Solution

  • 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