[Changed] twigger-behaviour view_item

This commit is contained in:
MaxBuhe01 2025-02-16 21:34:08 +01:00
parent a18bcd35c4
commit 048581f6f8

View File

@ -5,8 +5,10 @@
[{block name="d3_ga4_view_item_block"}]
[{capture name="d3_ga4_view_item"}]
[{strip}]
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
(function checkGTM() {
if (window.google_tag_manager && window.google_tag_manager.dataLayer && window.google_tag_manager.dataLayer.gtmDom === true) {
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
dataLayer.push({
'event': 'view_item',
'eventLabel':'Product View',
@ -35,6 +37,10 @@
'debug_mode': 'true'
[{/if}]
});
} else {
setTimeout(checkGTM, 100);
}
})();
[{/strip}]
[{/capture}]
[{oxscript add=$smarty.capture.d3_ga4_view_item}]