I was able to add google analytics and Angulartics to my ionic project by
-
adding the necessary Angulartics files to my project as instructed at http://luisfarzati.github.io/angulartics/
-
Added this code to my config file (coffescript)
.config ($analyticsProvider, googleAnalyticsCordovaProvider, $stateProvider, $urlRouterProvider) ->
$analyticsProvider.firstPageview(true)
googleAnalyticsCordovaProvider.trackingId = window.GOOGLE_ANALYTICS_ID
googleAnalyticsCordovaProvider.debug = true -
add in my config.xml file
<gap:plugin name="com.adobe.plugins.gaplugin" />
I am using phonegap build and it works. I get data on my google analytics page. What I want to know is how can I add this plugin to my local development or is there a better way to set up Angulartics with ionic and phonegap build?
When I do this
cordova plugin add https://github.com/phonegap-build/GAPlugin.git
or
cordova plugin add com.adobe.plugins.GAPlugin
It does not work.