Skip to content

dwolfhub/angular-ga-tracking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

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>

About

Angular Directives for Google Analytics Tracking

Resources

License

Stars

Watchers

Forks

Packages

No packages published