Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add ga tracking if available

  • Loading branch information...
commit aa03dcbd2ebad46bd23eb2c45b4fac9a5d0186d1 1 parent bc9036a
@caolan authored
Showing with 22 additions and 0 deletions.
  1. +22 −0 ui/app.js
View
22 ui/app.js
@@ -7,6 +7,28 @@ exports.init = function (url) {
'/login/*': require('./views/login'),
'/profile/*': require('./views/profile')
});
+ router.configure({
+ on: function () {
+ if (typeof _gaq !== 'undefined') {
+ // report page view to google analytics
+ _gaq.push([
+ '_trackPageview',
+ location.pathname + location.search + location.hash
+ ]);
+ }
+ }
+ });
+ router.configure({
+ on: function () {
+ if (typeof _gaq !== 'undefined') {
+ // report page view to google analytics
+ _gaq.push([
+ '_trackPageview',
+ location.pathname + location.search + location.hash
+ ]);
+ }
+ }
+ });
router.init();
if (!window.location.hash || window.location.hash === '#') {
window.location = '#/';
Please sign in to comment.
Something went wrong with that request. Please try again.