openhealthcare/angulartics-google-analytics

Name: angulartics-google-analytics

Owner: Open Health Care

Description: Google Analytics plugin for Angulartics

Created: 2015-09-14 10:42:35.0

Updated: 2015-09-14 10:42:35.0

Pushed: 2015-09-07 21:02:46.0

Homepage: null

Size: 147

Language: HTML

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

angulartics-google-analytics

NPM version NPM downloads Bower version Dependencies status MIT license Join the Slack chat

Google Analytics plugin for Angulartics.

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
install angulartics-google-analytics

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

ire('angulartics')

lar.module('myApp', [
ngulartics', 
quire('angulartics-google-analytics')

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

bower
r install angulartics-google-analytics

Add the <script> to your index.html:

ipt src="/bower_components/angulartics-google-analytics/dist/angulartics-google-analytics.min.js"></script>

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

lar.module('myApp', [
ngulartics', 
ngulartics.google.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
run build
License

MIT


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.