Closed apatt124 closed 5 years ago
I think you need to add/link tracking library like GA or GTM. React-tracking
is analytics platform agnostic.
The default dispatch should create the dataLayer array if it’s not there. Can you create a codesandbox repro? I’m not able to reproduce the issue
In my work project we initialize window.dataLayer as an empty array if it doesn't exist. e.g.
window.dataLayer = window.dataLayer || [];
It seems that the dataLayer is not being initialized in src/dispatchTrackingEvent.js. After I trigger events through any @track decorator, when I log
window.dataLayer
, it show up in the console asundefined
. See below: