Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Don't load GA on localhost

  • Loading branch information...
commit 7ccffa3ec291944879566bedf0a8b6da656776f6 1 parent 06e0308
@michaelklishin michaelklishin authored
Showing with 22 additions and 22 deletions.
  1. +11 −11 _layouts/article.html
  2. +11 −11 _layouts/default.html
View
22 _layouts/article.html
@@ -14,17 +14,17 @@
<meta content='text/html;charset=utf-8' http-equiv='Content-Type' />
<script type="text/javascript">
-
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', 'UA-31282324-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);
- })();
-
+ if(!(window.location.hostname === "localhost")) {
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-31282324-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);
+ })();
+ }
</script>
</head>
<body>
View
22 _layouts/default.html
@@ -14,17 +14,17 @@
<meta content='text/html;charset=utf-8' http-equiv='Content-Type' />
<script type="text/javascript">
-
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', 'UA-31282324-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);
- })();
-
+ if(!(window.location.hostname === "localhost")) {
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-31282324-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);
+ })();
+ }
</script>
</head>
<body style='height: 100%'>
Please sign in to comment.
Something went wrong with that request. Please try again.