[Changed] capture implementation
reworked to a safer path-through to get the data
This commit is contained in:
parent
9ea5408e44
commit
e2564f613a
@ -1,7 +1,7 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{block name="d3_ga4_purchase_block"}]
|
||||
[{capture assign=d3_ga4_purchase}]
|
||||
[{capture name="d3_ga4_purchase"}]
|
||||
[{strip}]
|
||||
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
||||
[{assign var="gtmOrder" value=$oView->getOrder()}]
|
||||
@ -52,5 +52,5 @@
|
||||
})
|
||||
[{/strip}]
|
||||
[{/capture}]
|
||||
[{oxscript add=$d3_ga4_purchase}]
|
||||
[{oxscript add=$smarty.capture.d3_ga4_purchase}]
|
||||
[{/block}]
|
@ -6,7 +6,7 @@
|
||||
[{assign var='gtmCartArticles' value=$oView->getBasketArticles()}]
|
||||
|
||||
[{block name="d3_ga4_view_cart_block"}]
|
||||
[{capture assign=d3_ga4_view_cart}]
|
||||
[{capture name="d3_ga4_view_cart"}]
|
||||
[{strip}]
|
||||
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
||||
dataLayer.push({
|
||||
@ -46,5 +46,5 @@
|
||||
});
|
||||
[{/strip}]
|
||||
[{/capture}]
|
||||
[{oxscript add=$d3_ga4_view_cart}]
|
||||
[{oxscript add=$smarty.capture.d3_ga4_view_cart}]
|
||||
[{/block}]
|
@ -4,7 +4,7 @@
|
||||
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
|
||||
|
||||
[{block name="d3_ga4_view_item_block"}]
|
||||
[{capture assign=d3_ga4_view_item}]
|
||||
[{capture name="d3_ga4_view_item"}]
|
||||
[{strip}]
|
||||
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
||||
|
||||
@ -36,5 +36,5 @@
|
||||
});
|
||||
[{/strip}]
|
||||
[{/capture}]
|
||||
[{oxscript add=$d3_ga4_view_item}]
|
||||
[{oxscript add=$smarty.capture.d3_ga4_view_item}]
|
||||
[{/block}]
|
@ -3,7 +3,7 @@
|
||||
[{block name="d3_ga4_remove_from_cart_block"}]
|
||||
[{if $hasBeenReloaded}]
|
||||
[{assign var="d3BasketPrice" value=$oxcmp_basket->getPrice()}]
|
||||
[{capture assign=d3_ga4_remove_from_cart}]
|
||||
[{capture name="d3_ga4_remove_from_cart"}]
|
||||
[{strip}]
|
||||
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
||||
dataLayer.push({
|
||||
@ -43,6 +43,6 @@
|
||||
});
|
||||
[{/strip}]
|
||||
[{/capture}]
|
||||
[{oxscript add=$d3_ga4_remove_from_cart}]
|
||||
[{oxscript add=$smarty.capture.d3_ga4_remove_from_cart}]
|
||||
[{/if}]
|
||||
[{/block}]
|
@ -6,7 +6,7 @@
|
||||
|
||||
[{block name="d3_ga4_view_item_list_block"}]
|
||||
[{if $gtmProducts|@count}]
|
||||
[{capture assign=d3_ga4_view_item_list}]
|
||||
[{capture name="d3_ga4_view_item_list"}]
|
||||
[{strip}]
|
||||
dataLayer.push({ecommerce: null});
|
||||
dataLayer.push({
|
||||
@ -41,6 +41,6 @@
|
||||
});
|
||||
[{/strip}]
|
||||
[{/capture}]
|
||||
[{oxscript add=$d3_ga4_view_item_list}]
|
||||
[{oxscript add=$smarty.capture.d3_ga4_view_item_list}]
|
||||
[{/if}]
|
||||
[{/block}]
|
@ -4,7 +4,7 @@
|
||||
|
||||
[{block name="d3_ga4_view_search_result_block"}]
|
||||
[{if $gtmProducts|@count}]
|
||||
[{capture assign=d3_ga4_view_search_result}]
|
||||
[{capture name="d3_ga4_view_search_result"}]
|
||||
[{strip}]
|
||||
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
||||
dataLayer.push({
|
||||
@ -39,6 +39,6 @@
|
||||
});
|
||||
[{/strip}]
|
||||
[{/capture}]
|
||||
[{oxscript add=$d3_ga4_view_search_result}]
|
||||
[{oxscript add=$smarty.capture.d3_ga4_view_search_result}]
|
||||
[{/if}]
|
||||
[{/block}]
|
Loading…
Reference in New Issue
Block a user