Do not track pageview etc. on localhost
This commit is contained in:
parent
7aae76e2bc
commit
e201771d4c
1 changed files with 5 additions and 3 deletions
|
@ -10,10 +10,12 @@
|
||||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var host = window.location.host;
|
var host = window.location.hostname;
|
||||||
|
|
||||||
|
if (host !== 'localhost') { // No tracking on localhost
|
||||||
ga('create', '{{ site.google_analytics }}', host);
|
ga('create', '{{ site.google_analytics }}', host);
|
||||||
ga('send', 'pageview');
|
ga('send', 'pageview');
|
||||||
|
}
|
||||||
})();
|
})();
|
||||||
</script>
|
</script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in a new issue