Open iskrenvankov opened 2 years ago
what npm version did you use to install the package
what npm version did you use to install the package
npm version 7.11.2
1+
@iskrenvankov as i read the code base there is a workaround to that (but you should use ts-ignore flag if you are using type script)
as we can see in this line you should add it to dataLayer object, like this:
TagManager.dataLayer({
dataLayer: {
event: "event",
eventCallback : function() {
window.location = targetUrl;
},
eventTimeout: 2000
},
dataLayerName: "name",
});
Hi,
I am trying to execute some code only after the data layer event has been successfully pushed. The usual way to do this with the plain js gtm library is to use the
eventCallback
andeventTimeout
properties. For instance, checkout this SO answer here: https://stackoverflow.com/a/38976722/1507558 which shows this snippet:Using
react-gtm
now, I can't find a way to use theeventCallback
property. If I pass a function, it gets dropped and is not present in the dataLayer event object passed.Could you advise on how to solve this situation using
react-gtm
?