Skip to content

Commit

Permalink
Adds GTM code.
Browse files Browse the repository at this point in the history
refs #3666
  • Loading branch information
justinlittman committed Jan 29, 2025
1 parent 5ea0c8b commit edf08f6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@

gtag('config', 'G-L3QLH9N3QH');
</script>

<!-- Google Tag Manager -->
<script>(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;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-WXBCLV2G');</script>
<!-- End Google Tag Manager -->
<% end %>

<title><%= content_for?(:title) ? yield(:title) : 'SDR | Stanford Digital Repository' %></title>
Expand All @@ -28,6 +36,12 @@
</head>

<body data-controller="help-how">
<% if Settings.google_analytics %>
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WXBCLV2G"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
<% end %>
<nav class="overflow-hidden" aria-label="Skip to main content">
<div class="container-xl">
<a class="visually-hidden-focusable d-inline-flex p-2 m-1" href="#content">Skip to main content</a>
Expand Down

0 comments on commit edf08f6

Please sign in to comment.