Skip to content

Commit ba720c1

Browse files
committed
Merge remote-tracking branch 'cvogt/tmp/download-analytics' into download-analytics
2 parents d8cd455 + d26c8b8 commit ba720c1

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

_includes/headerbottom.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,18 @@
3131
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
3232
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
3333
})();
34-
34+
var f = function(event){
35+
_gaq.push(['_trackEvent','Downloads','Download',$(this).attr('href')]);
36+
};
37+
function endsWith(str, suffix) {
38+
return str.indexOf(suffix, str.length - suffix.length) !== -1;
39+
}
40+
$(function(){
41+
$('a').filter(function(){
42+
var href = $(this).attr('href');
43+
return !endsWith(href,'/') && !endsWith(href,'html');
44+
}).on('click',f);
45+
});
3546
</script>
3647
</head>
3748
<body onload="styleCode()">

0 commit comments

Comments
 (0)