Add code to delete old analytics cookies

This commit is contained in:
Tom Byers
2019-12-20 14:48:11 +00:00
parent 53ced660ac
commit 751cca9f7d
3 changed files with 26 additions and 0 deletions

View File

@@ -125,4 +125,13 @@
<script src="/static/javascripts/govuk-template.js"></script>
<script>
if (window.GOVUK.cookie('_ga') !== null) {
document.cookie = '_ga' + '=;expires=' + new Date() + ';domain=.' + window.location.hostname + ';path=/';
}
if (window.GOVUK.cookie('_gid') !== null) {
document.cookie = '_gid' + '=;expires=' + new Date() + ';domain=.' + window.location.hostname + ';path=/';
}
</script>
</body></html>

View File

@@ -235,4 +235,12 @@
<!--[if gt IE 8]><!-->
<script type="text/javascript" src="{{ asset_url('javascripts/all.js') }}"></script>
<!--<![endif]-->
<script>
if (window.GOVUK.cookie('_ga') !== null) {
document.cookie = '_ga' + '=;expires=' + new Date() + ';domain=.' + window.location.hostname + ';path=/';
}
if (window.GOVUK.cookie('_gid') !== null) {
document.cookie = '_gid' + '=;expires=' + new Date() + ';domain=.' + window.location.hostname + ';path=/';
}
</script>
{% endblock %}

View File

@@ -126,5 +126,14 @@
<script src="/static_503/govuk-template.js"></script>
<script>
if (window.GOVUK.cookie('_ga') !== null) {
document.cookie = '_ga' + '=;expires=' + new Date() + ';domain=.' + window.location.hostname + ';path=/';
}
if (window.GOVUK.cookie('_gid') !== null) {
document.cookie = '_gid' + '=;expires=' + new Date() + ';domain=.' + window.location.hostname + ';path=/';
}
</script>
</body></html>