From aa2e760ed2b24fb6a6fdda5e141d0a7d0a6c652f Mon Sep 17 00:00:00 2001 From: Sam Collard Date: Wed, 2 Nov 2022 17:30:04 +0000 Subject: [PATCH] CLDC-1620 Add Google Tag Manager scripts to layout --- app/views/layouts/application.html.erb | 35 ++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index f6111fce5..788cae9d9 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -21,6 +21,34 @@ <%= javascript_include_tag "vendor/polyfill-output-value.js" %> <%= javascript_include_tag "vendor/outerHTML.js" %> + + <% gtm_container = "GTM-M6GS7FF" %> + <% gtm_id = "G-1RH26G5KVP" %> + + + + + + <% if cookies[:accept_analytics_cookies] == "on" %> + + <% else %> + + <% end %> + + <%= javascript_include_tag "application", defer: true %> <% if content_for?(:head) %> @@ -44,6 +72,13 @@ document.body.className = ((document.body.className) ? document.body.className + " js-enabled" : "js-enabled"); + + <% if cookies[:accept_analytics_cookies] %> + + <% end %> + <%= govuk_skip_link %> <%= govuk_header(