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

Adding default values to the dataLayer through the plugin ends up in the html as body text #4

Open
gl0gl0 opened this issue Aug 17, 2021 · 0 comments

Comments

@gl0gl0
Copy link

gl0gl0 commented Aug 17, 2021

Hi,

I was trying to add a default value on the dataLayer object through the plugin options like:

    new GoogleTagManagerPlugin({
        id: "..",
        auth: "..",
        preview: "..",
        dataLayerName: 'dataLayer',
        dataLayer: {
          propName: 'some value'
        }
      }),

And it gets printed on the DOM as html inside the body tag like:

<body>
    window.dataLayer=window.dataLayer||[];window.dataLayer.push({"propName":"Some value"});
    <!-- Google Tag Manager -->
    ....
</body>

Is there anything I'm doing wrong?

Thanks!

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

No branches or pull requests

1 participant