-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
feat(gatsby-plugin-google-tagmanager): Add plugin option for custom dataLayer name #12783
feat(gatsby-plugin-google-tagmanager): Add plugin option for custom dataLayer name #12783
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for adding this @spwisner
Left a small comment!
Holy buckets, @spwisner — we just merged your PR to Gatsby! 💪💜 Gatsby is built by awesome people like you. Let us say “thanks” in two ways:
If there’s anything we can do to help, please don’t hesitate to reach out to us: tweet at @gatsbyjs and we’ll come a-runnin’. Thanks again! |
Published in gatsby-plugin-google-tagmanager@2.0.11 |
…ed (#12920) <!-- Have any questions? Check out the contributing docs at https://gatsby.dev/contribute, or ask in this Pull Request and a Gatsby maintainer will be happy to help :) --> ## Description <!-- Write a brief description of the changes introduced by this PR --> For the `gatsby-plugin-google-tagmanager` this PR/release: #12783, has introduced a bug where by default the `'dataLayer'` is being set to `'datalayer'` (all lower case). Which means that by default this will not work with GTM. This PR just updates to use the correct form, `dataLayer` as the default. It is possibly the smallest PR I've ever made, but it will prevent a lot of people from being confused why they can't push to the dataLayer... ## Related Issues issue i filed for this: #12921
…ed (#12920) <!-- Have any questions? Check out the contributing docs at https://gatsby.dev/contribute, or ask in this Pull Request and a Gatsby maintainer will be happy to help :) --> ## Description <!-- Write a brief description of the changes introduced by this PR --> For the `gatsby-plugin-google-tagmanager` this PR/release: gatsbyjs/gatsby#12783, has introduced a bug where by default the `'dataLayer'` is being set to `'datalayer'` (all lower case). Which means that by default this will not work with GTM. This PR just updates to use the correct form, `dataLayer` as the default. It is possibly the smallest PR I've ever made, but it will prevent a lot of people from being confused why they can't push to the dataLayer... ## Related Issues issue i filed for this: gatsbyjs/gatsby#12921
Description
This pull request provides a plugin option that will make data in a renamed dataLayer accessible (see #12782 for details). The value assigned to "dataLayerName" is simply the renamed dataLayer (e.g. "bzDataLayer"). Then, any data pushed to a renamed dataLayer (e.g. "bzDataLayer") will also be pushed to dataLayer, thereby making it accessible through a standard GTM configuration.
Related Issues
Addresses #12782