Open jordanlambrecht opened 2 years ago
what npm version did you use to install the package
This works for me
export default function SomePage() {
window.dataLayer.push({
event: 'pageview',
page: {
url: document.location.origin + document.location.pathname + document.location.search,
title: 'SomePage',
},
})
return (
<>
...
</>
)
}
⚠️ In React strict mode (default for CRA) components render twice, so in DEV this will lead to two events firing
I'm a little confused on the steps for this. I have the following on my _app.tsx:
And the following on a component called JobPost:
The goal is to track page views for job postings as a datalayer so I can easily look at the most popular ones in GA4. How do I move this data into Tag Manager and then over to GA?