Skip to content

Commit

Permalink
Merge pull request #19 from tsak/master
Browse files Browse the repository at this point in the history
README update for automatic page tracking caveat
  • Loading branch information
Julien Bouquillon committed Mar 27, 2014
2 parents 2b7ac6b + 48d38c4 commit 878f3d5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ var app = angular.module('app', ['angular-google-analytics'])
// change page event name
AnalyticsProvider.setPageEvent('$stateChangeSuccess');
}))
.run(function(Analytics) {
// In case you are relying on automatic page tracking, you need to inject Analytics
// at least once in your application (for example in the main run() block)
})
.controller('SampleController', function(Analytics) {
// create a new pageview event
Analytics.trackPage('/video/detail/XXX');
Expand Down

0 comments on commit 878f3d5

Please sign in to comment.