Hi,
I'm having trouble using the google analytics cordova plugin. I followed exactly the procedure explained here:
https://blog.nraboy.com/2014/06/using-google-analytics-ionicframework/
However, when I do so, I get a "Uncaught ReferenceError: analytics is not defined". Should I load any js file somewhere, besides just doing "cordova plugin add https://github.com/danwilson/google-analytics-plugin.git"?
Here is my app.js:
angular.module('myapp', ['ionic','ionic.service.core', 'ngCordova', 'ionic.service.push'])
.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
if(typeof window.analytics !== undefined) {
analytics.startTrackerWithId("UA-XXX-X");
} else {
console.log("Google Analytics Unavailable");
}
});
})
Thanks in advance for your help!