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

36 google tag manager #37

Merged
merged 1 commit into from
Jan 24, 2024
Merged

36 google tag manager #37

merged 1 commit into from
Jan 24, 2024

Conversation

alishaevn
Copy link
Member

@alishaevn alishaevn commented Jan 23, 2024

Story

I installed "@next/third-parties" according to next js docs. the package docs show that it returns the necessary script tags. I was also able to see the tag in local dev, before I hid the gtmId behind an environment based conditional. (so that we only track on production)

Expected Behavior After Changes

  • google tag manager is installed for use in the production environment

Screenshots / Video

inspecting the page, we see that the script for google tag manager has been added. we also see that the gtmId value is blank, as it should be because this is local dev and not production.

image

I installed "@next/third-parties" according to [next js docs](https://nextjs.org/docs/pages/building-your-application/optimizing/third-party-libraries#google-tag-manager). the [package docs](https://github.com/vercel/next.js/blob/a7a403f4982c4ce8dc3988bf96de4238362a704f/packages/third-parties/src/google/gtm.tsx)
show that it returns the necessary script tags. I was also able to see
the tag in local dev, before I hid the gtmId behind an environment
based conditional. (so that we only track on production)

ref: #36
Copy link

vercel bot commented Jan 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
phenovista ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 23, 2024 6:05pm

@alishaevn alishaevn changed the title add google tag manager 36 google tag manager Jan 23, 2024
@alishaevn alishaevn linked an issue Jan 23, 2024 that may be closed by this pull request
1 task
@alishaevn alishaevn merged commit 6628081 into main Jan 24, 2024
6 of 7 checks passed
alishaevn added a commit that referenced this pull request Jan 24, 2024
since `GOOGLE_TAG_MANAGER_ID` was added as an environment variable, it
needs to be listed with the other env variables in the charts and ops
files. otherwise, the variable returns "undefined" in staging/production.

related: #37
alishaevn added a commit that referenced this pull request Jan 24, 2024
since `GOOGLE_TAG_MANAGER_ID` is being referenced through an environment
variable, it needed to be added as a deployment variable as well. we
only need this value accessible in production, so I was able to remove it
from the local env. the value should return as "undefined" and "" in the
local and staging environments, respectively.

related: #37
alishaevn added a commit to assaydepot/webstore that referenced this pull request Jan 24, 2024
since `GOOGLE_TAG_MANAGER_ID` is being referenced through an environment
variable, it needed to be added as a deployment variable as well. we
only need this value accessible in production, so I was able to remove it
from the local env. the value should return as "undefined" and "" in the
local and staging environments, respectively.

related: assaydepot/phenovista-digital-storefront#37
@alishaevn alishaevn deleted the 36-google-tag-manager branch January 24, 2024 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

google tag manager
3 participants