Skip to content

Conversation

@brianjgeiger
Copy link
Contributor

@brianjgeiger brianjgeiger commented Aug 8, 2023

Purpose

You can't just pull something into the index.html from runtime, it has to happen build time. So we'll try doing this the way raven works instead.

Summary of Changes

  1. Initialize GTM in a way that works runtime.
  2. Add environment variable for the gtm id
  3. Types

Screenshot(s)

Screenshot 2023-08-08 at 4 35 06 PM

@coveralls
Copy link

Pull Request Test Coverage Report for Build 5801713357

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 72.473%

Totals Coverage Status
Change from base Build 5798317883: 0.0%
Covered Lines: 5711
Relevant Lines: 7667

💛 - Coveralls

if (configObject.googleTagManagerId) {
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is relevant, but on prod it looks like this is gtm.js and not js 🤷

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

¯\(ツ)

@brianjgeiger brianjgeiger merged commit c767345 into CenterForOpenScience:develop Aug 8, 2023
@brianjgeiger brianjgeiger deleted the feature/ga4-round-three branch August 8, 2023 21:07
@brianjgeiger brianjgeiger added this to the 23.09.0 milestone Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants