Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update google analytics tracking code

  • Loading branch information...
commit dd753cda400b9f570d8e828d583f0bb6ca5d3997 1 parent d5683f6
@mightybyte mightybyte authored
View
2  snaplets/heist/templates/wrap.tpl
@@ -15,7 +15,7 @@
</div><!--end footer-->
<script type="text/javascript"
- src="/media/js/site.js"> </script>
+ src="/media/js/site.js?v=1"> </script>
</body>
</html>
View
14 static/media/js/init.js
@@ -13,11 +13,13 @@ $(document).ready(function(){
}
});
+var _gaq = _gaq || [];
+_gaq.push(['_setAccount', 'UA-15984160-1']);
+_gaq.push(['_trackPageview']);
-var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
-document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+(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);
+})();
-try {
- var pageTracker = _gat._getTracker("UA-15984160-1");
- pageTracker._trackPageview();
-} catch(err) {}
View
15 static/media/js/site.js
@@ -179,10 +179,13 @@ jQuery.url=function(){var segments={};var parsed={};var options={url:window.loca
});
-var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
-document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+var _gaq = _gaq || [];
+_gaq.push(['_setAccount', 'UA-15984160-1']);
+_gaq.push(['_trackPageview']);
+
+(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);
+})();
-try {
- var pageTracker = _gat._getTracker("UA-15984160-1");
- pageTracker._trackPageview();
-} catch(err) {}
Please sign in to comment.
Something went wrong with that request. Please try again.