Skip to content

Commit 2ed0646

Browse files
committed
Add some additional tracking so we know what people really read
1 parent e852490 commit 2ed0646

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

html/js/garden.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,18 @@ $(document).ready(function() {
4949
}
5050
selectNavigation(id, offset === 0);
5151
}
52+
var hash = document.location.hash.substr(1);
53+
if (hash !== '') {
54+
_gaq.push(['_trackEvent', hash, 'landed']);
55+
}
56+
$('nav ul li a').each(function() {
57+
$(this).bind('click', function() {
58+
var hash = document.location.hash.substr(1);
59+
if (hash !== '') {
60+
_gaq.push(['_trackEvent', hash, 'clicked']);
61+
}
62+
});
63+
});
5264

5365
var initSelection = setTimeout(highlightSection, 100);
5466
$(document).scroll(function() {

0 commit comments

Comments
 (0)