Sha256: b5eb8f1ad23bd615e57bb06be6ae8b9e82b464d51597dfc2097b3e22aaeec57f

Contents?: true

Size: 684 Bytes

Versions: 32

Compression:

Stored size: 684 Bytes

Contents

<%
  gtm_auth ||= nil
  gtm_preview ||= nil

  gtm_attributes = %w(gtm_cookies_win=x)
    gtm_attributes << "gtm_auth=" + gtm_auth if gtm_auth
    gtm_attributes << "gtm_preview=" + gtm_preview if gtm_preview
  gtm_attributes = gtm_attributes.join('&')
%>
<%= javascript_tag nonce: true do -%>
(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+'&<%= raw gtm_attributes %>';f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','<%= gtm_id %>');
<% end -%>

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
govuk_publishing_components-39.2.2 app/views/govuk_publishing_components/components/_google_tag_manager_script.html.erb
govuk_publishing_components-39.2.1 app/views/govuk_publishing_components/components/_google_tag_manager_script.html.erb
govuk_publishing_components-39.2.0 app/views/govuk_publishing_components/components/_google_tag_manager_script.html.erb
govuk_publishing_components-39.1.0 app/views/govuk_publishing_components/components/_google_tag_manager_script.html.erb
govuk_publishing_components-39.0.0 app/views/govuk_publishing_components/components/_google_tag_manager_script.html.erb
govuk_publishing_components-38.4.2 app/views/govuk_publishing_components/components/_google_tag_manager_script.html.erb
govuk_publishing_components-38.1.1 app/views/govuk_publishing_components/components/_google_tag_manager_script.html.erb
govuk_publishing_components-38.1.0 app/views/govuk_publishing_components/components/_google_tag_manager_script.html.erb
govuk_publishing_components-38.0.1 app/views/govuk_publishing_components/components/_google_tag_manager_script.html.erb
govuk_publishing_components-38.0.0 app/views/govuk_publishing_components/components/_google_tag_manager_script.html.erb
govuk_publishing_components-37.10.0 app/views/govuk_publishing_components/components/_google_tag_manager_script.html.erb
govuk_publishing_components-37.9.1 app/views/govuk_publishing_components/components/_google_tag_manager_script.html.erb
govuk_publishing_components-37.9.0 app/views/govuk_publishing_components/components/_google_tag_manager_script.html.erb
govuk_publishing_components-37.8.1 app/views/govuk_publishing_components/components/_google_tag_manager_script.html.erb
govuk_publishing_components-37.8.0 app/views/govuk_publishing_components/components/_google_tag_manager_script.html.erb
govuk_publishing_components-37.7.1 app/views/govuk_publishing_components/components/_google_tag_manager_script.html.erb
govuk_publishing_components-37.7.0 app/views/govuk_publishing_components/components/_google_tag_manager_script.html.erb
govuk_publishing_components-37.6.1 app/views/govuk_publishing_components/components/_google_tag_manager_script.html.erb
govuk_publishing_components-37.6.0 app/views/govuk_publishing_components/components/_google_tag_manager_script.html.erb
govuk_publishing_components-37.5.1 app/views/govuk_publishing_components/components/_google_tag_manager_script.html.erb