Skip to content

mattymess/angular-google-analytics

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

angular-google-analytics

A simple service that let you integrate google analytics tracker in your AngularJS applications.

Proudly brought to you by the @revolunet team.

features

  • configurable
  • automatic page tracking
  • events tracking

example

var app = angular.module('app', ['angular-google-analytics'])
    .config(function(AnalyticsProvider, function() {
        // initial configuration
        AnalyticsProvider.setAccount('UA-XXXXX-xx');

        // track all routes (or not)
        AnalyticsProvider.trackPages(true);
    }))
    .controller('SampleController', function(Analytic) {
        // create a new pageview event
        Analytic.trackPage('/video/detail/XXX');

        // create a new tracking event
        Analytic.trackEvent('video', 'play', 'django.mp4');
    });

configuration

// setup your account
AnalyticsProvider.setAccount('UA-XXXXX-xx');
// automatic route tracking (default=true)
AnalyticsProvider.trackPages(false);

Licence

As AngularJS itself, this module is released under the permissive MIT license. Your contributions are always welcome.

About

Google Analytics tracking for your AngularJS apps

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors