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');
|
||||
|
||||
(function() {
|
||||
var host = window.location.host;
|
||||
var host = window.location.hostname;
|
||||
|
||||
ga('create', '{{ site.google_analytics }}', host);
|
||||
ga('send', 'pageview');
|
||||
if (host !== 'localhost') { // No tracking on localhost
|
||||
ga('create', '{{ site.google_analytics }}', host);
|
||||
ga('send', 'pageview');
|
||||
}
|
||||
})();
|
||||
</script>
|
||||
{% endif %}
|
||||
|
|
Loading…
Reference in a new issue