Integrate Google Analytics Tracking in iOS App

I would like to integrate Google Analytics tracking into my IOS-APP.

I have a built-in Google Analytics library and added to my application.

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

into my contact tracking code with my view

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

A has this error "TrackPageView property not found on object of type ContactViewController

+4
source share
3 answers

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

 self.trackedViewName = @"Contact Screen"; 

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

 @interface YourContactScreenController : GAITrackedViewController 
+1
source

Today I got the same error, and despite what is indicated in the installation documentation, the property is called screenName . so just write this line in viewDidLoad:

 self.screenName = @"A name"; 
+14
source

If you use automatic screen tracking, you need to do the following:

@Objective C:

  • Add #import "GAITrackedViewController.h" to XXX.h
  • extension of the current class from GAITrackedViewController [for example. @interface ClockViewController: GAITrackedViewController]
  • Add this line to the file XXX.m viewDidLoad () self.screenName = @ "Login";

Note. I hope you have correctly initialized and configured GAI in your project.

0
source

Source: https://habr.com/ru/post/1442618/


All Articles