Skip to content

Commit

Permalink
[Kingston] Add cookie control and analytics code.
Browse files Browse the repository at this point in the history
  • Loading branch information
dracos committed Jun 30, 2022
1 parent 0d1cbd5 commit e8c63b3
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
6 changes: 6 additions & 0 deletions templates/web/kingston/before_wrapper.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[% IF c.config.BASE_URL == "https://www.fixmystreet.com" %]
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-57VJDBT"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
[% END %]
1 change: 1 addition & 0 deletions templates/web/kingston/header_extra.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[% INCLUDE 'tracking_code.html' %]
<link rel="stylesheet" href="/vendor/govuk-frontend/forms.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
Expand Down
41 changes: 41 additions & 0 deletions templates/web/kingston/tracking_code.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[% IF c.config.BASE_URL == "https://www.fixmystreet.com" %]
<script src="https://cc.cdn.civiccomputing.com/9/cookieControl-9.x.min.js" type="text/javascript"></script>
<script>
var config = {
apiKey: '67e66ced473704b266e9c82015018ff0030f92ca',
product: 'PRO',
optionalCookies: [
{
name: 'analytics',
label: 'Analytics',
description: 'Analytical cookies help us to improve our website by collecting and reporting information on its usage.',
cookies: ['_ga', '_gid', '_gat', '_gat_UA-*', '_ga_*', '_hjid', '__hjTLDTest', 'mc', 'd'],
onAccept : function(){
(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-57VJDBT');},
onRevoke: function(){}
},{
name: 'marketing',
label: 'Marketing',
description: 'We use marketing cookies to help us improve the relevancy of advertising campaigns you receive.',
cookies: [],
onAccept : function(){},
onRevoke: function(){}
},{
name: 'preferences',
label: 'Preferences',
description: 'Your preferences will apply to this website only. Please note that some processing of your personal data may not require your consent, but you have a right to object to such processing. You can change your preferences at any time by returning to this site or visit our privacy policy.',
cookies: [],
onAccept : function(){},
onRevoke: function(){}
}
],
position: 'LEFT',
theme: 'LIGHT'
};
CookieControl.load( config );
</script>
[% END %]

0 comments on commit e8c63b3

Please sign in to comment.