Merge pull request #3230 from alphagov/remove-analytics

Remove analytics
This commit is contained in:
Rebecca Law
2019-12-20 16:14:23 +00:00
committed by GitHub
3 changed files with 22 additions and 43 deletions

View File

@@ -125,21 +125,13 @@
<script src="/static/javascripts/govuk-template.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-75215134-1', 'auto');
ga('set', 'anonymizeIp', true);
ga('set', 'displayFeaturesTask', null);
ga('set', 'transport', 'beacon');
// strip UUIDs
page = (window.location.pathname + window.location.search).replace(
/[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}/g, '…'
)
ga('send', 'pageview');
</script>
<script>
if (window.GOVUK.cookie('_ga') !== null) {
document.cookie = '_ga' + '=;expires=' + new Date() + ';domain=' + window.location.hostname.replace(/^www\./, '.') + ';path=/';
}
if (window.GOVUK.cookie('_gid') !== null) {
document.cookie = '_gid' + '=;expires=' + new Date() + ';domain=' + window.location.hostname.replace(/^www\./, '.') + ';path=/';
}
</script>
</body></html>

View File

@@ -236,18 +236,11 @@
<script type="text/javascript" src="{{ asset_url('javascripts/all.js') }}"></script>
<!--<![endif]-->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-75215134-1', 'auto');
ga('set', 'anonymizeIp', true);
ga('set', 'displayFeaturesTask', null);
ga('set', 'transport', 'beacon');
// strip UUIDs
page = (window.location.pathname + window.location.search).replace(
/[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}/g, '…'
)
ga('send', 'pageview', page);
if (window.GOVUK.cookie('_ga') !== null) {
document.cookie = '_ga' + '=;expires=' + new Date() + ';domain=' + window.location.hostname.replace(/^www\./, '.') + ';path=/';
}
if (window.GOVUK.cookie('_gid') !== null) {
document.cookie = '_gid' + '=;expires=' + new Date() + ';domain=' + window.location.hostname.replace(/^www\./, '.') + ';path=/';
}
</script>
{% endblock %}

View File

@@ -126,20 +126,14 @@
<script src="/static_503/govuk-template.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-75215134-1', 'auto');
ga('set', 'anonymizeIp', true);
ga('set', 'displayFeaturesTask', null);
ga('set', 'transport', 'beacon');
page = (window.location.pathname + window.location.search).replace(
/[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}/g, '…'
)
ga('send', 'pageview', page);
</script>
<script>
if (window.GOVUK.cookie('_ga') !== null) {
document.cookie = '_ga' + '=;expires=' + new Date() + ';domain=' + window.location.hostname.replace(/^www\./, '.') + ';path=/';
}
if (window.GOVUK.cookie('_gid') !== null) {
document.cookie = '_gid' + '=;expires=' + new Date() + ';domain=' + window.location.hostname.replace(/^www\./, '.') + ';path=/';
}
</script>
</body></html>