Skip to content

Commit

Permalink
Merge pull request #2222 from alphagov/add-google-tag-manager
Browse files Browse the repository at this point in the history
Add Google Tag Manager snippet
  • Loading branch information
ollietreend authored Nov 6, 2023
2 parents 476e71e + a7bd776 commit e9ecdd8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/views/layouts/_google_tag_manager.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<% if ENV["GOOGLE_TAG_MANAGER_ID"] %>
<% content_for :head do %>
<%= render "govuk_publishing_components/components/google_tag_manager_script", {
gtm_id: ENV["GOOGLE_TAG_MANAGER_ID"],
gtm_auth: ENV["GOOGLE_TAG_MANAGER_AUTH"],
gtm_preview: ENV["GOOGLE_TAG_MANAGER_PREVIEW"],
} %>
<% end %>
<% end %>
1 change: 1 addition & 0 deletions app/views/layouts/design_system.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<% product_name = "Manuals Publisher" %>
<% environment = GovukPublishingComponents::AppHelpers::Environment.current_acceptance_environment %>
<% render "layouts/google_tag_manager" %>

<%= render "govuk_publishing_components/components/layout_for_admin", {
environment: environment,
Expand Down

0 comments on commit e9ecdd8

Please sign in to comment.