So i have Ecommerce code setup in GTM data layer, but after that is sent to Analytics i want the page to be redirected so i know i should be using eventCallback but it is no
Taken from: http://www.simoahava.com/gtm-tips/use-eventtimeout-eventcallback/
Always add the eventTimeout
parameter when using eventCallback
. The former takes a numerical value as its parameter, representing the number of milliseconds to wait before calling eventCallback
anyway. In other words, even if your Tags stall and never signal completion, after two seconds eventCallback
is invoked.
window.dataLayer.push({
'event' : 'processLink',
'eventCallback' : function() {
window.location = targetUrl
},
'eventTimeout' : 2000
});