hof 20.2.23 → 20.2.24

Sign up to get free protection for your applications and to get access to all the features.
@@ -34,7 +34,6 @@
34
34
  ga('govuk_shared.send', 'pageview')
35
35
  {{/gaCrossDomainTrackingTagId}}
36
36
  }
37
-
38
37
  </script>
39
38
  {{/gaTagId}}
40
39
 
@@ -61,8 +60,11 @@
61
60
  {{/ga4TagId}}
62
61
 
63
62
  {{#gtmTagId}}
64
- <!-- Data Layer -->
63
+ <!-- Google Tag Manager Data Layer for ETA -->
65
64
  <script {{#nonce}}nonce="{{nonce}}"{{/nonce}}>
65
+ var preferences = JSON.parse(GOVUK.cookie('cookie_preferences'));
66
+
67
+ if (preferences !== null && preferences.usage === true) {
66
68
  window.dataLayer = window.dataLayer || [];
67
69
  dataLayer.push({
68
70
  'event': 'pageLoad',
@@ -70,14 +72,21 @@
70
72
  'applicationType': 'ETA | Customer Contact',
71
73
  'environmentType': '{{environmentType}}'
72
74
  });
75
+ }
73
76
  </script>
74
- <!-- End Data Layer -->
77
+ <!-- End Google Tag Manager Data Layer for ETA -->
75
78
 
76
79
  <!-- Google Tag Manager for ETA -->
77
- <script {{#nonce}}nonce="{{nonce}}"{{/nonce}}>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
80
+ <script {{#nonce}}nonce="{{nonce}}"{{/nonce}}>
81
+ var preferences = JSON.parse(GOVUK.cookie('cookie_preferences'));
82
+
83
+ if (preferences !== null && preferences.usage === true) {
84
+ (function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
78
85
  new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
79
- j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
80
- 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
81
- })(window,document,'script','dataLayer','{{gtmTagId}}');</script>
86
+ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
87
+ 'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
88
+ })(window,document,'script','dataLayer','{{gtmTagId}}');
89
+ }
90
+ </script>
82
91
  <!-- End Google Tag Manager for ETA -->
83
92
  {{/gtmTagId}}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hof",
3
3
  "description": "A bootstrap for HOF projects",
4
- "version": "20.2.23",
4
+ "version": "20.2.24",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
7
7
  "author": "HomeOffice",