Restore google analytics code

This commit is contained in:
2016-02-19 20:20:21 +00:00
parent 614de84f5c
commit fbe08062af

View File

@@ -34,7 +34,14 @@
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '{{ site.analytics }}']);
_gaq.push(['_trackPageview']);
window.onload = function() {
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
window.onload = function() {
var headers = ['{{ site.headers | join:"', '" }}'];
var header = headers[Math.floor(Math.random() * headers.length)];
document.getElementById('masthead').style.backgroundImage = "url('/asset/header/" + header + ".jpg')";