I have a GTM code where I'm able to push data but eventCallback
is not working.
I have tries eventCallback
and hitCallback
but both are not working. I have also referred following post google analytics send event callback function, but still no luck.
Following is by GTM Code:
utils.gtm_push = function(event, category, action, label, params, callback) {
var data = {
"event": event,
"category": category,
"action": action,
"label": label,
};
for (param in params) {
data[param] = params[param]
}
if (callback) {
data.eventCallback = callback;
}
if (window.dataLayer) {
dataLayer.push(data);
}
};
Note: I'm looking for a proper way and not setTimeout
.
Can someone point me in the right direction?