[working-state] rebuilding meta structure

This commit is contained in:
MaxBUhe 2023-08-03 15:55:07 +02:00
parent 71b743ddcc
commit 0f15df8364
7 changed files with 246 additions and 226 deletions

View File

@ -1,7 +1,8 @@
[{$smarty.block.parent}]
[{block name="d3_ga4_purchase_block"}]
[{capture assign=d3_ga4_purchase}]
[{strip}]
<script>
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
[{assign var="gtmOrder" value=$oView->getOrder()}]
[{assign var="gtmBasket" value=$oView->getBasket()}]
@ -47,5 +48,7 @@
]
}
})
</script>
[{/strip}]
[{/capture}]
[{oxscript add=$d3_ga4_purchase}]
[{/block}]

View File

@ -5,7 +5,9 @@
[{assign var="d3BasketPrice" value=$oxcmp_basket->getPrice()}]
[{assign var='gtmCartArticles' value=$oView->getBasketArticles()}]
[{strip}][{capture assign=d3_ga4_view_cart}]
[{block name="d3_ga4_view_cart_block"}]
[{capture assign=d3_ga4_view_cart}]
[{strip}]
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
dataLayer.push({
'event': 'view_cart',
@ -40,5 +42,7 @@
]
}
});
[{/capture}][{/strip}]
[{/strip}]
[{/capture}]
[{oxscript add=$d3_ga4_view_cart}]
[{/block}]

View File

@ -3,7 +3,9 @@
[{assign var="gtmCategory" value=$gtmProduct->getCategory()}]
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
<script>
[{block name="d3_ga4_view_item_block"}]
[{capture assign=d3_ga4_view_item}]
[{strip}]
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
dataLayer.push({
@ -30,4 +32,7 @@
]
}
});
</script>
[{/strip}]
[{/capture}]
[{oxscript add=$d3_ga4_view_item}]
[{/block}]

View File

@ -6,8 +6,9 @@
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
[{assign var="gtmCategory" value=$gtmProduct->getCategory()}]
[{block name="d3_ga4_add_to_cart_block"}]
[{capture assign=d3_ga4_add_to_cart}]
[{block name="d3_ga4_add_to_basket"}]
[{strip}]
$("#toBasket").click(function(event) {
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
@ -43,6 +44,7 @@
}
});
});
[{/block}]
[{/strip}]
[{/capture}]
[{oxscript add=$d3_ga4_add_to_cart}]
[{/block}]

View File

@ -1,10 +1,10 @@
[{$smarty.block.parent}]
[{assign var="d3BasketPrice" value=$oxcmp_basket->getPrice()}]
[{block name="d3_ga4_remove_from_cart_block"}]
[{if $hasBeenReloaded}]
[{assign var="d3BasketPrice" value=$oxcmp_basket->getPrice()}]
[{capture assign=d3_ga4_remove_from_cart}]
[{strip}]
[{capture assign=d3_ga4_view_cart}]
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
dataLayer.push({
'isRemoveFromCart': true,
@ -39,7 +39,8 @@
]
}
});
[{/capture}]
[{/strip}]
[{oxscript add=$d3_ga4_view_cart}]
[{/capture}]
[{oxscript add=$d3_ga4_remove_from_cart}]
[{/if}]
[{/block}]

View File

@ -4,10 +4,10 @@
[{assign var="breadCrumb" value=''}]
[{block name="d3_ga4_view_item_list_block"}]
[{if $gtmProducts|@count}]
[{capture assign=d3_ga4_view_item_list}]
[{strip}]
<script>
/* ga4 */
dataLayer.push({ecommerce: null});
dataLayer.push({
'event':'view_item_list',
@ -37,6 +37,8 @@
]
}
});
</script>
[{/strip}]
[{/capture}]
[{oxscript add=$d3_ga4_view_item_list}]
[{/if}]
[{/block}]

View File

@ -2,9 +2,10 @@
[{assign var="gtmProducts" value=$oView->getArticleList()}]
[{block name="d3_ga4_add_to_cart_block"}]
[{if $gtmProducts|@count}]
[{capture assign=d3_ga4_add_to_cart}]
[{strip}]
<script>
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
dataLayer.push({
'event': 'view_search_result',
@ -34,6 +35,8 @@
]
}
});
</script>
[{/strip}]
[{/capture}]
[{oxscript add=$d3_ga4_add_to_cart}]
[{/if}]
[{/block}]