Browse Source

CLDC-1620 Extract GTM IDs to helper

pull/964/head
Sam Collard 4 years ago
parent
commit
e0a9fdac0d
  1. 13
      app/helpers/analytics_helper.rb
  2. 4
      app/views/layouts/application.html.erb

13
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

4
app/views/layouts/application.html.erb

@ -22,8 +22,8 @@
<%= javascript_include_tag "vendor/polyfill-output-value.js" %> <%= javascript_include_tag "vendor/polyfill-output-value.js" %>
<%= javascript_include_tag "vendor/outerHTML.js" %> <%= javascript_include_tag "vendor/outerHTML.js" %>
<% gtm_container = "GTM-M6GS7FF" %> <% gtm_container = get_gtm_container %>
<% gtm_id = "G-1RH26G5KVP" %> <% gtm_id = get_gtm_id %>
<!-- Google Tag Manager (doesn't store personal info until permission given) --> <!-- Google Tag Manager (doesn't store personal info until permission given) -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':

Loading…
Cancel
Save