0

I'm trying to track my Ionic app with Google Analytics by using the @ionic-native/google-analytics package, but whenever I try to track a page view with this code:

constructor( //Constructor of each Page component
    ...
    public platform: Platform,
    public analytics: GoogleAnalytics
) {
    platform.ready().then(() => {
        analytics.trackView("Home Page");
    });
    ...
}

No matter which title I write on the first parameter of trackView I always get a / as Active Page (I guess this is because the actual URI doesn't change) and the same Page Title for every page I visit (the one I define at index.html title tag). I also tried without the platform.ready() wrapper, just in case, with no luck as well.

I already configured everything as said in this guide, so I'm not sure what I'm missing here. Any help?

Thank you in advance.

kikus
  • 31
  • 3
  • `analytics.trackView("Home Page");` will send an event to GA. Do you call this method on any of your other pages? – Adam Hughes Jul 24 '17 at 12:20
  • Yes, I call it on the constructor of each page but changing the title parameter, for example `analytics.trackView("Login Page")`. I detect the event in GA but the title does not change at all. – kikus Jul 24 '17 at 13:04

0 Answers0