Chrome Platform Analytics plugin for Angulartics
HTML JavaScript
Pull request Compare This branch is 5 commits ahead, 65 commits behind angulartics:master.
Latest commit 38dd367 Dec 9, 2016 @paulhitz committed on GitHub Merge pull request #1 from brentchow/patch-1
Fix typo
Permalink
Failed to load latest commit information.
dist
example
lib
.bowerrc
.gitignore
.npmignore
LICENSE
README.md
bower.json
package.json

README.md

angulartics-chrome-platform-analytics

NPM version Bower version MIT license

Chrome Platform Analytics plugin for Angulartics.

(Chrome Platform Analytics is a Javascript library supporting the use of Google Analytics from Chrome Platform Applications)

Please see the Chrome Platform Analytics wiki for more information.

Install

First make sure you've read installation and setup instructions for Angulartics.

Then you can install this package either with npm or with bower.

npm

npm install angulartics-chrome-platform-analytics

Then add angulartics-chrome-platform-analytics as a dependency for your app:

require('angulartics')

angular.module('myApp', [
  'angulartics',
  require('angulartics-chrome-platform-analytics')
]);

Please note that core Angulartics doesn't export the name yet, but it will once we move it into the new organization.

bower

bower install angulartics-chrome-platform-analytics

Add the <script> to your index.html:

<script src="/bower_components/angulartics-chrome-platform-analytics/dist/angulartics-chrome-platform-analytics.min.js"></script>

Then add angulartics.chrome.platform.analytics as a dependency for your app:

angular.module('myApp', [
  'angulartics',
  'angulartics.chrome.platform.analytics'
]);

Changes in the Google Analytics snippet

The snippet code provided by Google Analytics does an automatic pageview hit, but this is already done by Angulartics (unless you disable it) so make sure to delete the tracking line:

      ...
      ga('create', 'UA-XXXXXXXX-X', 'none'); // 'none' while you are working on localhost
      ga('send', 'pageview');  // DELETE THIS LINE!
    </script>

Done. Open your app, browse across the different routes and check the realtime GA dashboard to see the hits.

Documentation

Documentation is available on the Angulartics site.

Development

npm run build

License

MIT