-
Notifications
You must be signed in to change notification settings - Fork 140
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
eventCallback not supported #102
Comments
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) Line 46 in b125740
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",
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
?The text was updated successfully, but these errors were encountered: