From e0a9fdac0df681f4382c33548953d772cfc14788 Mon Sep 17 00:00:00 2001 From: Sam Collard Date: Fri, 4 Nov 2022 04:05:02 +0000 Subject: [PATCH] CLDC-1620 Extract GTM IDs to helper --- app/helpers/analytics_helper.rb | 13 +++++++++++++ app/views/layouts/application.html.erb | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 app/helpers/analytics_helper.rb diff --git a/app/helpers/analytics_helper.rb b/app/helpers/analytics_helper.rb new file mode 100644 index 000000000..e15849405 --- /dev/null +++ b/app/helpers/analytics_helper.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +module AnalyticsHelper + def get_gtm_container + # Additional environments tbc + "GTM-M6GS7FF" + end + + def get_gtm_id + # Additional environments tbc + "G-1RH26G5KVP" + end +end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 30175404e..2e5f66da1 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -22,8 +22,8 @@ <%= javascript_include_tag "vendor/polyfill-output-value.js" %> <%= javascript_include_tag "vendor/outerHTML.js" %> - <% gtm_container = "GTM-M6GS7FF" %> - <% gtm_id = "G-1RH26G5KVP" %> + <% gtm_container = get_gtm_container %> + <% gtm_id = get_gtm_id %>