Skip to content

Instantly share code, notes, and snippets.

@matthieu-D
Created June 29, 2017 20:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthieu-D/1f1931e324baa98621e11a4f2afb1870 to your computer and use it in GitHub Desktop.
Save matthieu-D/1f1931e324baa98621e11a4f2afb1870 to your computer and use it in GitHub Desktop.
import { GoogleAnalytics } from '@ionic-native/google-analytics';
export class HomePage {
constructor(public ga: GoogleAnalytics) {
this.ga.startTrackerWithId('UA-101858534-1')
.then(() => {
console.log('Google analytics is ready now');
this.ga.trackView('home');
})
.catch(e => console.log('Error starting GoogleAnalytics', e));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment