diff --git a/Application/Model/ManagerTypes.php b/Application/Model/ManagerTypes.php index 7ebda76..01c9db5 100644 --- a/Application/Model/ManagerTypes.php +++ b/Application/Model/ManagerTypes.php @@ -34,6 +34,8 @@ class ManagerTypes const CONSENTMANAGER = "CONSENTMANAGER"; + const COOKIEFIRST = "COOKIEFIRST"; + /** * @return array */ @@ -45,7 +47,8 @@ class ManagerTypes "net_cookie_manager" => self::NET_COOKIE_MANAGER, "oxps_usercentrics" => self::USERCENTRICS_MODULE, "usercentrics" => self::USERCENTRICS_MANUALLY, - "consentmanager" => self::CONSENTMANAGER + "consentmanager" => self::CONSENTMANAGER, + "cookiefirst" => self::COOKIEFIRST ]; } diff --git a/Application/views/admin/de/module_options.php b/Application/views/admin/de/module_options.php index 6f09746..76204bd 100755 --- a/Application/views/admin/de/module_options.php +++ b/Application/views/admin/de/module_options.php @@ -31,10 +31,17 @@ $aLang = [ // for cookie manager settings 'SHOP_MODULE_GROUP_d3_gtm_settings_cookiemanager' => 'Cookie Manager Einstellungen', 'SHOP_MODULE_d3_gtm_settings_hasOwnCookieManager' => 'Cookie Manager nutzen?', + 'HELP_SHOP_MODULE_d3_gtm_settings_HAS_STD_MANAGER' => 'Mehr Informationen zu den genannten Coookie-Manager finden Sie auf den folgenden Home-Pages
+ Consentmanager
+ Usercentrics
+ Cookiefirst
+ + Bei weiteren Fragen stehen wir gern zur Verfügung! Kontaktieren Sie uns einfach unter https://www.d3data.de/', 'SHOP_MODULE_d3_gtm_settings_HAS_STD_MANAGER' => 'Nutzen Sie eine der folgenden Einbindungen?
Dann wählen Sie bitte die zutreffende aus.', 'SHOP_MODULE_d3_gtm_settings_HAS_STD_MANAGER_NONE' => '---', 'SHOP_MODULE_d3_gtm_settings_HAS_STD_MANAGER_CONSENTMANAGER' => 'consentmanager', 'SHOP_MODULE_d3_gtm_settings_HAS_STD_MANAGER_USERCENTRICS' => 'usercentrics', + 'SHOP_MODULE_d3_gtm_settings_HAS_STD_MANAGER_COOKIEFIRST' => 'cookiefirst', 'SHOP_MODULE_d3_gtm_settings_cookieName' => 'CookieID', ]; diff --git a/Application/views/blocks/_gtm_js.tpl b/Application/views/blocks/_gtm_js.tpl index d3d1075..de0cb3e 100755 --- a/Application/views/blocks/_gtm_js.tpl +++ b/Application/views/blocks/_gtm_js.tpl @@ -4,28 +4,22 @@ [{if $oViewConf->D3blShowGtmScript()}] - [{if $oViewConf->getGtmContainerId()}][{strip}] - - - - - [{if $oViewConf->getTopActionClassName() === "alist" }] - [{* include file="ga4_view_item_list.tpl" gtmCategory=$oView->getActiveCategory() gtmProducts=$oView->getArticleList() listtype=$oView->getListType() *}] - [{elseif $oViewConf->getTopActionClassName() === "details" }] - [{* include file="ga4_view_item.tpl" gtmProduct=$oView->getProduct() *}] - [{elseif $oViewConf->getTopActionClassName() === "search" }] - [{elseif $oViewConf->getTopActionClassName() === "basket" }] - [{/if}] - [{/strip}][{/if}] + [{if $oViewConf->getGtmContainerId()}] + [{strip}] + + + + [{/strip}] [{/if}] +[{/if}] [{$smarty.block.parent}] \ No newline at end of file diff --git a/Application/views/blocks/checkout_s1.tpl b/Application/views/blocks/checkout_s1.tpl deleted file mode 100644 index 6b7fe88..0000000 --- a/Application/views/blocks/checkout_s1.tpl +++ /dev/null @@ -1,33 +0,0 @@ -[{$smarty.block.parent}] - -[{*$oxcmp_basket|get_class_methods|dumpvar*}] - -[{assign var="d3BasketPrice" value=$oxcmp_basket->getPrice()}] - -[{assign var='gtmCartArticles' value=$oView->getBasketArticles()}] -[{strip}][{capture assign=d3_ga4_view_cart}] - dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */ - dataLayer.push({ - 'event': 'view_cart', - 'eventLabel':'Checkout Step 1', - 'ecommerce': { - 'actionField': "step: 1", - 'currency': "[{$currency->name}]", - 'value': [{$d3BasketPrice->getPrice()}], - 'items': [ - [{foreach from=$oxcmp_basket->getContents() item=basketitem name=gtmCartContents key=basketindex}] - [{assign var="d3oItemPrice" value=$basketitem->getPrice()}] - { - 'item_id': '[{$gtmCartArticles[$basketindex]->getFieldData('oxartnum')}]', - 'item_name': '[{$gtmCartArticles[$basketindex]->getFieldData('oxtitle')}]', - 'item_variant': '[{$gtmCartArticles[$basketindex]->getFieldData('oxvarselect')}]', - 'price': [{$d3oItemPrice->getPrice()}], - 'quantity':[{$basketitem->getAmount()}], - 'position':[{$smarty.foreach.gtmCartContents.index}] - }[{if !$smarty.foreach.gtmCartContents.last}],[{/if}] - [{/foreach}] - ] - } - }); -[{/capture}][{/strip}] -[{oxscript add=$d3_ga4_view_cart}] \ No newline at end of file diff --git a/Application/views/blocks/checkout_s5.tpl b/Application/views/blocks/checkout_s5.tpl deleted file mode 100644 index 0531e42..0000000 --- a/Application/views/blocks/checkout_s5.tpl +++ /dev/null @@ -1,36 +0,0 @@ -[{$smarty.block.parent}] - -[{strip}] - -[{/strip}] diff --git a/Application/views/blocks/purchase.tpl b/Application/views/blocks/purchase.tpl new file mode 100644 index 0000000..b97219e --- /dev/null +++ b/Application/views/blocks/purchase.tpl @@ -0,0 +1,49 @@ +[{$smarty.block.parent}] + +[{strip}] + +[{/strip}] diff --git a/Application/views/blocks/view_cart.tpl b/Application/views/blocks/view_cart.tpl new file mode 100644 index 0000000..79279c0 --- /dev/null +++ b/Application/views/blocks/view_cart.tpl @@ -0,0 +1,42 @@ +[{$smarty.block.parent}] + +[{*$oxcmp_basket|get_class_methods|dumpvar*}] + +[{assign var="d3BasketPrice" value=$oxcmp_basket->getPrice()}] +[{assign var='gtmCartArticles' value=$oView->getBasketArticles()}] + +[{strip}][{capture assign=d3_ga4_view_cart}] + dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */ + dataLayer.push({ + 'event': 'view_cart', + 'eventLabel':'Checkout Step 1', + 'ecommerce': { + 'actionField': "step: 1", + 'currency': "[{$currency->name}]", + 'value': [{$d3BasketPrice->getPrice()}], + 'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]', + 'items': [ + [{foreach from=$oxcmp_basket->getContents() item=basketitem name=gtmCartContents key=basketindex}] + [{assign var="d3oItemPrice" value=$basketitem->getPrice()}] + [{assign var="gtmBasketItem" value=$basketitem->getArticle()}] + [{assign var="gtmBasketItemCategory" value=$gtmBasketItem->getCategory()}] + { + 'item_id': '[{$gtmCartArticles[$basketindex]->getFieldData('oxartnum')}]', + 'item_name': '[{$gtmCartArticles[$basketindex]->getFieldData('oxtitle')}]', + 'item_variant': '[{$gtmCartArticles[$basketindex]->getFieldData('oxvarselect')}]', + 'item_category': '[{$gtmBasketItemCategory->getSplitCategoryArray(0)}]', + 'item_category_2': '[{$gtmBasketItemCategory->getSplitCategoryArray(1)}]', + 'item_category_3': '[{$gtmBasketItemCategory->getSplitCategoryArray(2)}]', + 'item_category_4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3)}]', + 'item_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]', + 'price': [{$d3oItemPrice->getPrice()}], + 'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]', + 'quantity': [{$basketitem->getAmount()}], + 'position': [{$smarty.foreach.gtmCartContents.index}] + }[{if !$smarty.foreach.gtmCartContents.last}],[{/if}] + [{/foreach}] + ] + } + }); +[{/capture}][{/strip}] +[{oxscript add=$d3_ga4_view_cart}] \ No newline at end of file diff --git a/Application/views/blocks/view_item.tpl b/Application/views/blocks/view_item.tpl index 81e21b7..3e4b60a 100644 --- a/Application/views/blocks/view_item.tpl +++ b/Application/views/blocks/view_item.tpl @@ -5,6 +5,7 @@