truncating referrer

This commit is contained in:
Abhinav Adduri 2017-06-21 14:30:14 -07:00
parent 246796edd7
commit 87bdb7ab4c

View File

@ -5,6 +5,13 @@
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', '{{{trackerId}}}', 'auto');
if (window.URL && document.referrer) {
ga("set", "referrer", (new URL(document.referrer)).origin);
} else {
ga("set", "referrer", "");
}
ga('set', 'anonymizeIp', true);
ga('send', 'pageview');
</script>