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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GatsbyJS + GTM] Events not being sent when pushed to DataLayer #44

Closed
igorbrasileiro opened this issue Dec 23, 2021 · 1 comment
Closed

Comments

@igorbrasileiro
Copy link

igorbrasileiro commented Dec 23, 2021

Hi, 馃憢 !

I'm trying to integrate the Partytown + Gatsby, but I'm facing some problems sending events.

Basically, I added the GTM and Partytown components in the head. Inside the components, call window.dataLayer.push. But I realized that just send page_view events.

// gatsby-ssr.js
export const onRenderBody = ({ setHeadComponents }) => {
  setHeadComponents([
    <GoogleTagManager
      key="gtm"
      containerId={storeConfig.analytics.gtmContainerId}
      enablePartytown
    />,
    <Partytown key="party" />,
  ])
}
// sending events to dataLayer
useAnalyticsEvent((event) => {
  console.log('EVENT', event)
  window.dataLayer.push(event)
})

I'm missing something?
I tried to use the debug flag, but I didn't see the console.logs 馃槥 .

For more information:

Partytown Version: 0.0.29
Gatsby Version: 3.14.3

@igorbrasileiro
Copy link
Author

I will close this issue because the problem was with the GTM settings.

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