How to set page title in Google Analytics for iOS?

I am using the Google Analytics SDK for iOS in my iPhone application. It tracks β€œpages” perfectly, but I also need to track page names because they appear in my reports as β€œ(not installed)” right now. I think this is done automatically for the website, but I cannot figure out how to do this in the application.

Challenge for the Google Analytics SDK:

[[GANTracker sharedTracker] trackPageview:@"myPage" withError:&error]

Where "myPage" appears as the page name, but without the page name. Does anyone know how to do this? Maybe a user-defined variable or something else?

+4
source share
2 answers

I don’t know if you understand that you are right, but you can only set the name of the page on the Internet, you have the URL of the page and the page title, which is automatically read by google analytics. Inside ios, you only have the name or title of the page. Therefore, simply provide the name of your submission or the internal ios URL for the name of the file, which can then be identified inside Google Analytics.

I use google analytics inside my viewWillAppear UITableViewController method (you need to set the title, otherwise it will be zero) with this code:

[[GANTracker sharedTracker] trackPageview:[self.title] withError:&error]

Another idea is to simply use the class name if they are unique or perhaps the name of the xib loaded with the view:

[[GANTracker sharedTracker] trackPageview:NSStringFromClass([self class]) withError:&error]

0
source

Name the view with this string placed in your viewDidLoad.

 self.trackedViewName = @"Main App View"; 
0
source

All Articles