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.