Skip to content

Commit

Permalink
Adds Google Tag Manager to website base.mako
Browse files Browse the repository at this point in the history
  • Loading branch information
mattclark authored and mfraezz committed Aug 30, 2023
1 parent f5c04d1 commit 744ec17
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions website/templates/base.mako
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,16 @@
</script>
% endif

% if settings.GOOGLE_TAG_MANAGER_ID:
<!-- 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',${ settings.GOOGLE_TAG_MANAGER_ID | sjson, n });</script>
<!-- End Google Tag Manager -->
% endif

<script>
// Mako variables accessible globally
window.contextVars = $.extend(true, {}, window.contextVars, {
Expand Down

0 comments on commit 744ec17

Please sign in to comment.