Angulartics and Google analytics

I was able to add google analytics and Angulartics to my ionic project by

  1. adding the necessary Angulartics files to my project as instructed at http://luisfarzati.github.io/angulartics/

  2. 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

  3. 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.

For a phonegap project you could try

phonegap local plugin add com.analytics.google

You can find the documentation for the plugin here: https://github.com/appfeel/analytics-google

If you need it with PGB, you should use:

<gap:plugin name="com.analytics.google" source="plugins.cordova.io" />