Skip to content

Commit

Permalink
Update cookie avoider script
Browse files Browse the repository at this point in the history
- returns random client_id rather than storing anything.
  • Loading branch information
ajparsons committed Jun 7, 2023
1 parent bc9eff5 commit 4210cdf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions www/includes/easyparliament/templates/html/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@
<?php if (!DEVSITE): ?>

<!-- Google tag (gtag.js) -->
<script defer>var capturedCookies={};Object.defineProperty(document,"cookie",{get:function(){var t=Object.getOwnPropertyDescriptor(Document.prototype,"cookie").get.call(document);for(var e in capturedCookies)t+=" "+e+"="+capturedCookies[e]+";";return t},set:function(t){var e=t.split("="),o=e[0].trim(),r=e[1].trim();o.startsWith("_ga")?capturedCookies[o]=r:Object.getOwnPropertyDescriptor(Document.prototype,"cookie").set.call(document,t)}});</script>
<script defer>Object.defineProperty(document,"cookie",{get:function(){var t=Object.getOwnPropertyDescriptor(Document.prototype,"cookie").get.call(document);return t.trim().length>0&&(t+="; "),t+="_ga=GA1.1."+Math.floor(1e9*Math.random())+"."+Math.floor(1e9*Math.random())},set:function(t){t.trim().startsWith("_ga")||Object.getOwnPropertyDescriptor(Document.prototype,"cookie").set.call(document,t)}});</script>
<script defer src="https://www.googletagmanager.com/gtag/js?id=G-W8M9N1MJFT"></script>

<script>
var client_id = Math.floor(Math.random() * 1000000000) + '.' + Math.floor(Math.random() * 1000000000);
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config','G-W8M9N1MJFT', {'client_id': client_id, 'cookie_expires': 0 });
gtag('config','G-W8M9N1MJFT', {'client_id': client_id, 'cookie_expires': 1 });
</script>

<script>
Expand Down

0 comments on commit 4210cdf

Please sign in to comment.