angular-ga-tracking

Angular Directives for Google Analytics Tracking

Added by: Sam Deering

GitHub

Repository

dwolfhub/angular-ga-tracking

Stats

Stars: 7

Watchers: 7

Forks: 1

Author

Daniel Wolf
Daniel Wolf

Module Description

angular-ga-tracking

Angular Directives for Google Analytics Tracking

Usage

Including the module

var app = angular.module("app", ["ga.tracker"]);

Use the directives

Tracking Page Views

When the directive is used, it registers a page view at the current $location.path();. I like to add it once in each of my templates.

<div class="home-template" ga-pageview tracking-id="XX-XXXXXXXX-XX">

Tracking Events (clicks)

When you add the diretive to an HTML element and that element is clicked, the event will be registered with GA.

<a href="/#/prizes" ga-event event-name="some event" event-value="some value" tracking-id="XX-XXXXXXXX-XX">Submit Event!</a>

Module stats last updated: 2016-10-29 03:17:11

Disclaimer: Some data on this page may have been gathered from the authors GitHub respository. If you see any mistakes or outdated information please let us know. Thanks!