diff --git a/_includes/header.html b/_includes/header.html index c1417e7..bfc92d0 100644 --- a/_includes/header.html +++ b/_includes/header.html @@ -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')";