google-analytics-plugin icon indicating copy to clipboard operation
google-analytics-plugin copied to clipboard

trackView not tracking

Open damianclem opened this issue 6 years ago • 3 comments

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

damianclem avatar Jan 24 '19 18:01 damianclem

This is not working for me either. Is there any other configuration that needs to be done?

Shadayy avatar Feb 21 '19 03:02 Shadayy

Same issue.

joao-jr avatar Apr 04 '19 13:04 joao-jr

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

Shadayy avatar Apr 04 '19 14:04 Shadayy