Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorporate Google Tag Manager into live site #433

Closed
lizagarrison opened this issue May 26, 2020 · 3 comments
Closed

Incorporate Google Tag Manager into live site #433

lizagarrison opened this issue May 26, 2020 · 3 comments
Assignees
Labels
Release Note: Enhancement Shows on Release Notes under "Enhancements"
Milestone

Comments

@lizagarrison
Copy link
Member

lizagarrison commented May 26, 2020

Overview

Incorporate Google Tag Manager into live site to set up Google Analytics

Script

head

<!-- 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-PS74HS2’);</script>
<!-- End Google Tag Manager -->

body

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src=“https://www.googletagmanager.com/ns.html?id=GTM-PS74HS2”
height=“0" width=“0” style=“display:none;visibility:hidden”></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
@wesrowe
Copy link
Member

wesrowe commented May 27, 2020

@entrotech I did a little quick research, you probably already know React will make it a little less straightforward to add the GTM snippet. This medium article seemed on target to me. forgot we are talking about the legacy, non-React app

@wesrowe
Copy link
Member

wesrowe commented May 27, 2020

update: @entrotech The live-site codebase still has the code for GTM scripts, they are just commented out.

So GTM can be easily added back in by:

  1. uncommenting the include statements in the and of the main page layout _default.html.
  2. updating the GTM snippets for head and body that are in these /_includes templates:

@entrotech entrotech added the Release Note: Enhancement Shows on Release Notes under "Enhancements" label May 28, 2020
@lizagarrison lizagarrison added this to the 1 - Launch of FOLA MVP milestone Jun 3, 2020
@bbovenzi
Copy link
Contributor

Duplicate of #703

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release Note: Enhancement Shows on Release Notes under "Enhancements"
Projects
Archived in project
Development

No branches or pull requests

5 participants