google-analytics-plugin
google-analytics-plugin copied to clipboard
trackView not tracking
Hello,
I've been able to successfully install the latest version of the AG plugin on my Cordova / Ionic / Angular application. I'm able to Track Events using the TrackEvent() method.
However, I'm having trouble getting TrackView() to work in a most simplest form. I've tried the following. And I'm not seeing any errors getting thrown.
import { GoogleAnalytics } from '@ionic-native/google-analytics'; private ga: GoogleAnalytics;
ga.startTrackerWithId('UA-XXXXXXX-X', 30).then(() => {}).catch(e => alert('Error starting GoogleAnalytics == '+ e));
ga.trackView('Hop Create Page').catch(e => alert('Error Track View == '+ e)); ga.trackView('Hop Create Page', '', true).catch(e => alert('Error Track View == '+ e)); ga.trackEvent("Hop", "Created Hop", "Hop", 1).then(()=> {}).catch(e => alert('Error Track Event == '+ e));;
Thanks for any help you can provide!
Damian
This is not working for me either. Is there any other configuration that needs to be done?
Same issue.
I figured out why it didn't work for me. My Android Ionic project is connected to Firebase therefore is using Firabase Analytics which is different from the conventional Google Analytics.
This plugin is not suitable for those connected to Firebase. I solved my problem by using this plugin instead: https://github.com/chemerisuk/cordova-plugin-firebase-analytics