Permalink
Browse files

add event tracking for link clicking

  • Loading branch information...
1 parent b4cad8b commit 6f5a3ef181865fe7816f93019af4693f6d4c41b9 @ratbeard committed May 26, 2011
Showing with 9 additions and 0 deletions.
  1. +9 −0 public/javascripts/app.js
@@ -21,6 +21,15 @@ $(function () {
old.fadeOut(function () {
now.fadeIn()
})
+
+ // Fire tracking - See who is most popular :)
+ if (window._gaq) {
+ var type, who
+ type = el.closest('section').attr('class')
+ who = el.find('a').attr('href').slice(1)
+ console.log('track', type, who)
+ _gaq.push(['_trackEvent', type, who])
+ }
}
})

0 comments on commit 6f5a3ef

Please sign in to comment.