diff --git a/Application/Extend/.ide-helper.php b/Application/Extend/.ide-helper.php new file mode 100644 index 0000000..75eb3c4 --- /dev/null +++ b/Application/Extend/.ide-helper.php @@ -0,0 +1,5 @@ + - **/ + */ -class oxviewconf_blatm extends oxviewconf_blatm_parent +namespace VanillaThunder\GoogleTagManager\Application\Extend; + +use OxidEsales\Eshop\Application\Controller\FrontendController; +use OxidEsales\Eshop\Core\Registry; +use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory; +use OxidEsales\EshopCommunity\Internal\Framework\Module\Configuration\Bridge\ModuleSettingBridgeInterface; + +class ViewConfig extends ViewConfig_parent { - // google tag manager stuff - private $_sBlaGTMid = null; - public function getGTMid() + // Google Tag Manager Container ID + private $sContainerId = null; + public function getGtmContainerId() { - if ( $this->_sBlaGTMid === null ) $this->_sBlaGTMid = oxRegistry::getConfig()->getConfigParam("bla_gtm_id"); - return $this->_sBlaGTMid; - } - - private $_productlistcategories; - public function getGTMproductListPerformanceSetting() - { - if ( $this->_productlistcategories === null ) $this->_productlistcategories = oxRegistry::getConfig()->getConfigParam("bla_tm_productlistcategories"); - return $this->_productlistcategories; - } - - // matomo tag manager id - private $_sBlaMTMid = null; - public function getMTMid() - { - if ( $this->_sBlaMTMid === null ) $this->_sBlaMTMid = oxRegistry::getConfig()->getConfigParam("bla_mtm_id"); - return $this->_sBlaMTMid; - } - - // yandex metrica id - private $_sBlaYMid = null; - public function getYMid() - { - if ( $this->_sBlaYMid === null ) $this->_sBlaYMid = oxRegistry::getConfig()->getConfigParam("bla_ym_id"); - return $this->_sBlaYMid; + if ( $this->sContainerId === null ) { + $this->sContainerId = ContainerFactory::getInstance() + ->getContainer() + ->get(ModuleSettingBridgeInterface::class) + ->get('vt_gtm_containerid', 'vt-gtm'); + } + return $this->sContainerId; } - private $_blTagmanagerEnabled = null; - public function isTagmanagerEnabled() - { - if ( $this->_blTagmanagerEnabled === null ) $this->_blTagmanagerEnabled = (bool) $this->getGTMid() || $this->getMTMid() || $this->getYMid(); - return $this->_blTagmanagerEnabled; - } - public function getDataLayer() + + public function getGtmDataLayer() { - if( !$this->isTagmanagerEnabled() ) return false; + if( !$this->getGtmContainerId() ) return "[]"; - $oConfig = oxRegistry::getConfig(); /** @var oxConfig $oConfig */ - $oView = $oConfig->getActiveView(); /** @var oxUbase $oShop */ + $oConfig = Registry::getConfig(); + $oView = $oConfig->getTopActiveView(); /** @var FrontendController $oShop */ //$oShop = oxRegistry::getConfig()->getActiveShop(); /** @var oxShop $oShop */ $oUser = $oConfig->getUser(); $dataLayer = [ - 'user' => array_merge( - ['country' => ($oUser ? $oUser->getUserCountry() : 'unknown')], - (oxRegistry::getSession()->getVariable("bla_refs") ? oxRegistry::getSession()->getVariable("bla_refs") : []) - ), - 'page' => [ - "type" => "default", - "class"=> $oView->getClassName(), - "title" => (class_exists("matomo") ? oxRegistry::get("matomo")->getDocumentTitle($oView) : $oView->getTitle() ) - ] + 'page_title' => $oView->getTitle(), + 'controller' => $this->getTopActionClassName(), + 'user' => ( $oUser ? "true" : "false" ) ]; + return json_encode([$dataLayer],JSON_PRETTY_PRINT); + unset($dataLayer["user"]["http"]); // das brauchen wir hier nicht $cl = $this->getActiveClassName(); @@ -108,4 +87,11 @@ class oxviewconf_blatm extends oxviewconf_blatm_parent */ } + public function isPromotionList($listId) + { + $oConfig = Registry::getConfig(); + $aPromotionListIds = $oConfig->getConfigParam("") ?? [ 'bargainItems', 'newItems', 'topBox', 'alsoBought', 'accessories', 'cross' ]; + + + } } \ No newline at end of file diff --git a/copy_this/modules/bla/tag-manager/application/translations/de/blagtm_lang.php b/Application/translations/de/module_lang.php similarity index 59% rename from copy_this/modules/bla/tag-manager/application/translations/de/blagtm_lang.php rename to Application/translations/de/module_lang.php index 01fae7b..ed0a7ab 100644 --- a/copy_this/modules/bla/tag-manager/application/translations/de/blagtm_lang.php +++ b/Application/translations/de/module_lang.php @@ -18,22 +18,22 @@ $aLang = [ // das hier wird nicht mehr benötigt, aber ich lasse es drin, falls doch // leserliche Namen für product list performance (GA) - 'BLA_GTM_EE_productList' => 'Kategorie', - 'BLA_GTM_EE_categoryList' => 'Kategorie', - 'BLA_GTM_EE_searchList' => 'Suchergebnisse', - 'BLA_GTM_EE_cross' => 'Crossselling', - 'BLA_GTM_EE_accessories' => 'Zubehör', - 'BLA_GTM_EE_alsoBought' => 'Kunden kaufen auch', - 'BLA_GTM_EE_last' => 'Zuletzt angesehen', - 'BLA_GTM_EE_bargainItems' => 'Angebot der Woche', - 'BLA_GTM_EE_newItems' => 'Frisch eingetroffen', - 'BLA_GTM_EE_topBox' => 'Topseller', + 'VT_GTM_EE_productList' => 'Kategorie', + 'VT_GTM_EE_categoryList' => 'Kategorie', + 'VT_GTM_EE_searchList' => 'Suchergebnisse', + 'VT_GTM_EE_cross' => 'Crossselling', + 'VT_GTM_EE_accessories' => 'Zubehör', + 'VT_GTM_EE_alsoBought' => 'Kunden kaufen auch', + 'VT_GTM_EE_last' => 'Zuletzt angesehen', + 'VT_GTM_EE_bargainItems' => 'Angebot der Woche', + 'VT_GTM_EE_newItems' => 'Frisch eingetroffen', + 'VT_GTM_EE_topBox' => 'Topseller', // ab hier wird wieder benötigt // Dimensionen im checkout - 'BLA_GTM_EE_LOGINOPTION' => 'Bestandskunde', - 'BLA_GTM_EE_LOGINOPTION1' => 'Gastbestellung', - 'BLA_GTM_EE_LOGINOPTION2' => 'Bestandskunde', - 'BLA_GTM_EE_LOGINOPTION3' => 'Neukunde' + 'VT_GTM_EE_LOGINOPTION' => 'Bestandskunde', + 'VT_GTM_EE_LOGINOPTION1' => 'Gastbestellung', + 'VT_GTM_EE_LOGINOPTION2' => 'Bestandskunde', + 'VT_GTM_EE_LOGINOPTION3' => 'Neukunde' ]; diff --git a/copy_this/modules/bla/tag-manager/application/translations/en/blagtm_lang.php b/Application/translations/en/blagtm_lang.php similarity index 64% rename from copy_this/modules/bla/tag-manager/application/translations/en/blagtm_lang.php rename to Application/translations/en/blagtm_lang.php index d1ee513..84293dc 100644 --- a/copy_this/modules/bla/tag-manager/application/translations/en/blagtm_lang.php +++ b/Application/translations/en/blagtm_lang.php @@ -19,19 +19,19 @@ $aLang = [ // das hier wird nicht mehr benötigt, aber ich lasse es drin, falls doch // leserliche Namen für product list performance (GA) - 'BLA_GTM_EE_productList' => 'Category', - 'BLA_GTM_EE_searchList' => 'Search', - 'BLA_GTM_EE_cross' => 'Crossselling', - 'BLA_GTM_EE_accessories' => 'Accessories', - 'BLA_GTM_EE_last' => 'Last Seen', - 'BLA_GTM_EE_bargainItems' => 'Offer of the Week', - 'BLA_GTM_EE_newItems' => 'Just Arrived', - 'BLA_GTM_EE_topBox' => 'Topseller', + 'VT_GTM_EE_productList' => 'Category', + 'VT_GTM_EE_searchList' => 'Search', + 'VT_GTM_EE_cross' => 'Crossselling', + 'VT_GTM_EE_accessories' => 'Accessories', + 'VT_GTM_EE_last' => 'Last Seen', + 'VT_GTM_EE_bargainItems' => 'Offer of the Week', + 'VT_GTM_EE_newItems' => 'Just Arrived', + 'VT_GTM_EE_topBox' => 'Topseller', // ab hier wird wieder benötigt // Dimensionen im checkout - 'BLA_GTM_EE_LOGINOPTION' => 'Existing Customer', - 'BLA_GTM_EE_LOGINOPTION1' => 'Guest', - 'BLA_GTM_EE_LOGINOPTION2' => 'Existing Customer', - 'BLA_GTM_EE_LOGINOPTION3' => 'New Customer' + 'VT_GTM_EE_LOGINOPTION' => 'Existing Customer', + 'VT_GTM_EE_LOGINOPTION1' => 'Guest', + 'VT_GTM_EE_LOGINOPTION2' => 'Existing Customer', + 'VT_GTM_EE_LOGINOPTION3' => 'New Customer' ]; diff --git a/Application/views/admin/de/module_options.php b/Application/views/admin/de/module_options.php new file mode 100644 index 0000000..bb0a054 --- /dev/null +++ b/Application/views/admin/de/module_options.php @@ -0,0 +1,31 @@ + + */ + +$style = ''; +$aLang = [ + 'charset' => 'UTF-8', + 'SHOP_MODULE_GROUP_vt_gtm_settings' => $style . 'Einstellungen', + 'SHOP_MODULE_vt_gtm_containerid' => 'Container ID', + 'SHOP_MODULE_vt_gtm_promotionlistids' => 'Promotion Produktlisten IDs
Weitere Infos zu dieser Einstellung: Modui-Wiki
', +]; diff --git a/Application/views/blocks/_gtm_js.tpl b/Application/views/blocks/_gtm_js.tpl new file mode 100644 index 0000000..46e65c2 --- /dev/null +++ b/Application/views/blocks/_gtm_js.tpl @@ -0,0 +1,24 @@ +[{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}] +[{$smarty.block.parent}] diff --git a/Application/views/blocks/_gtm_nojs.tpl b/Application/views/blocks/_gtm_nojs.tpl new file mode 100644 index 0000000..fa191b0 --- /dev/null +++ b/Application/views/blocks/_gtm_nojs.tpl @@ -0,0 +1,8 @@ +[{if $oViewConf->getGtmContainerId()}][{strip}] + + + [{/strip}][{/if}] +[{$smarty.block.parent}] \ No newline at end of file diff --git a/Application/views/blocks/_impression.tpl b/Application/views/blocks/_impression.tpl new file mode 100644 index 0000000..362f469 --- /dev/null +++ b/Application/views/blocks/_impression.tpl @@ -0,0 +1,66 @@ +[{$smarty.block.parent}] +[{* +[{strip}] + [{assign var="gtmProduct" value=$oView->getProduct()}] + [{assign var="gtmCategory" value=$gtmProduct->getCategory()}] + [{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}] + + [{if !$head }] + [{assign var=$head value=$oView->getViewParameter('head')}] + [{/if}] + +[{/strip}] +*}] \ No newline at end of file diff --git a/Application/views/blocks/add_to_cart.tpl b/Application/views/blocks/add_to_cart.tpl new file mode 100644 index 0000000..0202833 --- /dev/null +++ b/Application/views/blocks/add_to_cart.tpl @@ -0,0 +1,5 @@ +[{if $oxcmp_basket->isNewItemAdded() && $smarty.session._newitem}] + + [{* include file="ga4_add_to_cart.tpl" gtmProduct=$smarty.session._newitem *}] +[{/if}] +[{$smarty.block.parent}] diff --git a/Application/views/blocks/checkout_s1.tpl b/Application/views/blocks/checkout_s1.tpl new file mode 100644 index 0000000..26d293a --- /dev/null +++ b/Application/views/blocks/checkout_s1.tpl @@ -0,0 +1,57 @@ +[{strip}] + [{assign var='gtmCartArticles' value=$oView->getBasketArticles()}] + +[{/strip}] +[{$smarty.block.parent}] \ No newline at end of file diff --git a/Application/views/blocks/checkout_s2.tpl b/Application/views/blocks/checkout_s2.tpl new file mode 100644 index 0000000..dcb7c7d --- /dev/null +++ b/Application/views/blocks/checkout_s2.tpl @@ -0,0 +1,18 @@ +[{strip}] + +[{/strip}] +[{$smarty.block.parent}] \ No newline at end of file diff --git a/Application/views/blocks/checkout_s3.tpl b/Application/views/blocks/checkout_s3.tpl new file mode 100644 index 0000000..701d486 --- /dev/null +++ b/Application/views/blocks/checkout_s3.tpl @@ -0,0 +1,9 @@ + +[{$smarty.block.parent}] \ No newline at end of file diff --git a/Application/views/blocks/checkout_s4.tpl b/Application/views/blocks/checkout_s4.tpl new file mode 100644 index 0000000..108e59d --- /dev/null +++ b/Application/views/blocks/checkout_s4.tpl @@ -0,0 +1,9 @@ + +[{$smarty.block.parent}] \ No newline at end of file diff --git a/Application/views/blocks/checkout_s5.tpl b/Application/views/blocks/checkout_s5.tpl new file mode 100644 index 0000000..3129ac6 --- /dev/null +++ b/Application/views/blocks/checkout_s5.tpl @@ -0,0 +1,37 @@ +[{strip}] + +[{/strip}] +[{$smarty.block.parent}] diff --git a/Application/views/blocks/detail.tpl b/Application/views/blocks/detail.tpl new file mode 100644 index 0000000..072f5bf --- /dev/null +++ b/Application/views/blocks/detail.tpl @@ -0,0 +1,27 @@ +[{$smarty.block.parent}] +[{assign var="gtmProduct" value=$oView->getProduct()}] +[{assign var="gtmCategory" value=$gtmProduct->getCategory()}] +[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}] +[{strip}][{/strip}] + \ No newline at end of file diff --git a/Application/views/blocks/impression.tpl b/Application/views/blocks/impression.tpl new file mode 100644 index 0000000..4438bd6 --- /dev/null +++ b/Application/views/blocks/impression.tpl @@ -0,0 +1,35 @@ +[{$smarty.block.parent}] +[{assign var="gtmProduct" value=$oView->getProduct()}] +[{assign var="gtmCategory" value=$gtmProduct->getCategory()}] +[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}] + + \ No newline at end of file diff --git a/Application/views/ga4/add_to_cart.tpl b/Application/views/ga4/add_to_cart.tpl new file mode 100644 index 0000000..a3d5e3a --- /dev/null +++ b/Application/views/ga4/add_to_cart.tpl @@ -0,0 +1,41 @@ +[{strip}] + [{$gtmProduct|@var_dump}] + [{* variable $gtmProduct is passed from parent tempalte *}] + [{* + [{assign var="gtmCurrency" value=$oView->getActCurrency()}] + [{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}] + [{assign var="gtmCategory" value=$gtmProduct->getCategory()}] + + *}] +[{/strip}] \ No newline at end of file diff --git a/Application/views/ga4/view_item.tpl b/Application/views/ga4/view_item.tpl new file mode 100644 index 0000000..e44d842 --- /dev/null +++ b/Application/views/ga4/view_item.tpl @@ -0,0 +1,26 @@ +[{strip}] + [{* variable $gtmProduct is passed from parent tempalte *}] + [{assign var="gtmCurrency" value=$oView->getActCurrency()}] + [{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}] + [{assign var="gtmCategory" value=$gtmProduct->getCategory()}] + +[{/strip}] \ No newline at end of file diff --git a/Application/views/ga4/view_item_list.tpl b/Application/views/ga4/view_item_list.tpl new file mode 100644 index 0000000..13d9ce6 --- /dev/null +++ b/Application/views/ga4/view_item_list.tpl @@ -0,0 +1,51 @@ +[{if $gtmProducts|@count}] +[{strip}] + +[{/strip}] +[{/if}] \ No newline at end of file diff --git a/Application/views/ua/impression.tpl b/Application/views/ua/impression.tpl new file mode 100644 index 0000000..09dcacc --- /dev/null +++ b/Application/views/ua/impression.tpl @@ -0,0 +1,29 @@ +[{strip}] + [{assign var="gtmCategory" value=$gtmProduct->getCategory()}] + [{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}] + +[{/strip}] diff --git a/copy_this/modules/bla/tag-manager/application/views/blocks/ee/s1_cart.tpl b/Application/views/ua/s1_cart.tpl similarity index 92% rename from copy_this/modules/bla/tag-manager/application/views/blocks/ee/s1_cart.tpl rename to Application/views/ua/s1_cart.tpl index 6a81e43..d590b9f 100644 --- a/copy_this/modules/bla/tag-manager/application/views/blocks/ee/s1_cart.tpl +++ b/Application/views/ua/s1_cart.tpl @@ -1,8 +1,9 @@ [{strip}] [{assign var="gtmCartArticles" value=$oView->getBasketArticles()}] - [{/strip}] -[{/if}] -[{$smarty.block.parent}] diff --git a/copy_this/modules/bla/tag-manager/application/views/blocks/ee/detail.tpl b/copy_this/modules/bla/tag-manager/application/views/blocks/ee/detail.tpl deleted file mode 100644 index b4995af..0000000 --- a/copy_this/modules/bla/tag-manager/application/views/blocks/ee/detail.tpl +++ /dev/null @@ -1,57 +0,0 @@ -[{strip}] - [{assign var="_cur" value=$oView->getActCurrency()}] - [{assign var="_tmProduct" value=$oView->getProduct()}] - [{assign var="_tmManufacturer" value=$_tmProduct->getManufacturer()}] - [{assign var="_tmCategory" value=$_tmProduct->getCategory()}] - -[{/strip}] -[{$smarty.block.parent}] \ No newline at end of file diff --git a/copy_this/modules/bla/tag-manager/application/views/blocks/ee/impression.tpl b/copy_this/modules/bla/tag-manager/application/views/blocks/ee/impression.tpl deleted file mode 100644 index 42f408e..0000000 --- a/copy_this/modules/bla/tag-manager/application/views/blocks/ee/impression.tpl +++ /dev/null @@ -1,34 +0,0 @@ -[{$smarty.block.parent}] -[{strip}] - [{assign var="_tmProduct" value=$oView->getProduct()}] - [{assign var="_tmCategory" value=$_tmProduct->getCategory()}] - [{* assign var="_tmManufacturer" value=$_tmProduct->getManufacturer() *}] - [{* setting: [{ $oViewConf->getGTMproductListPerformanceSetting() }] || id: [{$listId}] *}] - -[{/strip}] diff --git a/copy_this/modules/bla/tag-manager/application/views/blocks/email_html_order_owner_orderemail.tpl b/copy_this/modules/bla/tag-manager/application/views/blocks/email_html_order_owner_orderemail.tpl deleted file mode 100644 index 61f7d38..0000000 --- a/copy_this/modules/bla/tag-manager/application/views/blocks/email_html_order_owner_orderemail.tpl +++ /dev/null @@ -1,23 +0,0 @@ -[{$smarty.block.parent}] -[{if $order->oxorder__blaref->value || $order->oxorder__blasubref->value || $order->oxorder__blahttpref->value}] - - [{if $order->oxorder__blaref->value}] - - - - - [{/if}] - [{if $order->oxorder__blasubref->value}] - - - - - [{/if}] - [{if $order->oxorder__blahttpref->value}] - - - - - [{/if}] -
REF:[{$order->oxorder__blaref->value}]
SUB-REF:[{$order->oxorder__blasubref->value}]
HTTP REF:[{$order->oxorder__blahttpref->value}]
-[{/if}] \ No newline at end of file diff --git a/copy_this/modules/bla/tag-manager/application/views/blocks/theme_svg_icons.tpl b/copy_this/modules/bla/tag-manager/application/views/blocks/theme_svg_icons.tpl deleted file mode 100644 index ee7a610..0000000 --- a/copy_this/modules/bla/tag-manager/application/views/blocks/theme_svg_icons.tpl +++ /dev/null @@ -1,8 +0,0 @@ -[{if $oViewConf->getGTMid() || $oViewConf->getYMid() }][{strip}] - -[{/strip}][{/if}] -[{$smarty.block.parent}] \ No newline at end of file diff --git a/copy_this/modules/bla/tag-manager/metadata.php b/copy_this/modules/bla/tag-manager/metadata.php deleted file mode 100644 index 085708a..0000000 --- a/copy_this/modules/bla/tag-manager/metadata.php +++ /dev/null @@ -1,181 +0,0 @@ - - **/ - -$sMetadataVersion = '1.1'; -$aModule = [ - 'id' => 'tag-manager', - 'title' => 'bestlife Tag Manager', - 'description' => 'Tag Manager integration for OXID eShop: Google, Matomo and Yandex', - 'thumbnail' => '../bestlife.png', - 'version' => '0.2.0 ( 2018-12-04 )', - 'author' => 'Marat Bedoev, bestlife AG', - 'email' => 'oxid@bestlife.ag', - 'url' => 'https://github.com/vanilla-thunder/oxid-module-tag-manager', - 'extend' => [ - // http ref & co - 'oxorder' => 'bla/tag-manager/application/extend/oxorder_blatm', - 'oxsession' => 'bla/tag-manager/application/extend/oxsession_blatm', - // ref Anpassung für Shopgate - 'ShopgatePluginOxid' => 'bla/tag-manager/application/extend/ShopgatePluginOxid_blatm', - // ecommerce tracking - 'oxviewconfig' => 'bla/tag-manager/application/extend/oxviewconf_blatm' - ], - 'files' => [ - 'blatm_events' => 'bla/tag-manager/application/files/blatm_events.php', - ], - 'events' => [ - 'onActivate' => 'blatm_events::onActivate' - ], - 'templates' => [], - 'blocks' => [ - // refs - [ - 'template' => 'order_overview.tpl', - 'block' => 'admin_order_overview_checkout', - 'file' => '/application/views/admin/blocks/admin_order_overview_checkout.tpl' - ], - [ - 'template' => 'email/html/order_owner.tpl', - 'block' => 'email_html_order_owner_orderemail', - 'file' => '/application/views/blocks/email_html_order_owner_orderemail.tpl' - ], - // tag manager js - [ - 'template' => 'layout/base.tpl', - 'block' => 'head_meta_robots', - 'file' => '/application/views/blocks/base_head_meta_robots.tpl' - ], - // tag manager nojs - [ - 'template' => 'layout/base.tpl', - 'block' => 'theme_svg_icons', - 'file' => '/application/views/blocks/theme_svg_icons.tpl' - ], - // detail + click + add to basket - [ - 'template' => 'page/details/inc/productmain.tpl', - 'block' => 'details_productmain_title', - 'file' => '/application/views/blocks/ee/detail.tpl' - ], - // impression - [ - 'template' => 'widget/product/listitem_grid.tpl', - 'block' => 'widget_product_listitem_grid_tobasket', - 'file' => '/application/views/blocks/ee/impression.tpl' - ], - [ - 'template' => 'widget/product/listitem_infogrid.tpl', - 'block' => 'widget_product_listitem_infogrid_tobasket', - 'file' => '/application/views/blocks/ee/impression.tpl' - ], - [ - 'template' => 'widget/product/listitem_line.tpl', - 'block' => 'widget_product_listitem_line_tobasket', - 'file' => '/application/views/blocks/ee/impression.tpl' - ], - [ - 'template' => 'widget/product/boxproduct.tpl', - 'block' => 'widget_product_boxproduct_price', - 'file' => '/application/views/blocks/ee/impression.tpl' - ], - // checkout - [ - 'template' => 'page/checkout/basket.tpl', - 'block' => 'checkout_basket_main', - 'file' => '/application/views/blocks/ee/s1_cart.tpl' - ], - [ - 'template' => 'form/user_checkout_change.tpl', - 'block' => 'user_checkout_change', - 'file' => '/application/views/blocks/ee/s2_user.tpl' - ], - [ - 'template' => 'form/user_checkout_register.tpl', - 'block' => 'user_checkout_register', - 'file' => '/application/views/blocks/ee/s2_user.tpl' - ], - [ - 'template' => 'form/user_checkout_noregister.tpl', - 'block' => 'user_checkout_noregister', - 'file' => '/application/views/blocks/ee/s2_user.tpl' - ], - [ - 'template' => 'page/checkout/payment.tpl', - 'block' => 'checkout_payment_main', - 'file' => '/application/views/blocks/ee/s3_payment.tpl' - ], - [ - 'template' => 'page/checkout/order.tpl', - 'block' => 'checkout_order_main', - 'file' => '/application/views/blocks/ee/s4_order.tpl' - ], - [ - 'template' => 'page/checkout/thankyou.tpl', - 'block' => 'checkout_thankyou_main', - 'file' => '/application/views/blocks/ee/s5_thankyou.tpl' - ] - ], - 'settings' => [ - [ - 'group' => 'bla_tm_Main', - 'name' => 'bla_gtm_id', - 'type' => 'str', - 'value' => '' - ], - [ - 'group' => 'bla_tm_Main', - 'name' => 'bla_tm_productlistcategories', - 'type' => 'select', - 'value' => '0', - 'constraints' => '0|1|2' - ], - [ - 'group' => 'bla_tm_Main', - 'name' => 'bla_mtm_id', - 'type' => 'str', - 'value' => '' - ], - [ - 'group' => 'bla_tm_Main', - 'name' => 'bla_ym_id', - 'type' => 'str', - 'value' => '' - ], - [ - 'group' => 'bla_tm_Main', - 'name' => 'bla_tm_defaultref', - 'type' => 'str', - 'value' => '123456' - ], - [ - 'group' => 'bla_tm_Main', - 'name' => 'bla_tm_shopgateref', - 'type' => 'str', - 'value' => 'SHOPGATE' - ] - ] -]; - - -/* todo: - - modified: application/translations/de/blagtm_lang.php - modified: application/views/blocks/base_head_meta_robots.tpl - modified: application/views/blocks/ee/impression.tpl - modified: application/views/blocks/ee/s5_thankyou.tpl - modified: application/views/blocks/email_html_order_owner_orderemail.tpl - modified: application/views/blocks/theme_svg_icons.tpl - -*/ \ No newline at end of file diff --git a/copy_this/modules/bla/vendormetadata.php b/copy_this/modules/bla/vendormetadata.php deleted file mode 100644 index e69de29..0000000 diff --git a/metadata.php b/metadata.php new file mode 100644 index 0000000..3d912a3 --- /dev/null +++ b/metadata.php @@ -0,0 +1,156 @@ + + **/ + +$sMetadataVersion = '2.1'; +$aModule = [ + 'id' => 'vt-gtm', + 'title' => '[vt] Google Tag Manager', + 'description' => 'Google Tag Manager Integration for OXID eShop v6.2+', + 'thumbnail' => 'thumbnail.png', + 'version' => '0.5.0 ( 2021-07-17 )', + 'author' => 'Marat Bedoev', + 'email' => openssl_decrypt("Az6pE7kPbtnTzjHlPhPCa4ktJLphZ/w9gKgo5vA//p4=", str_rot13("nrf-128-pop"), str_rot13("gvalzpr")), + 'url' => 'https://github.com/vanilla-thunder/oxid-module-gtm', + 'extend' => [ + \OxidEsales\Eshop\Core\ViewConfig::class => VanillaThunder\GoogleTagManager\Application\Extend\ViewConfig::class + ], + 'templates' => [ + // separate ee-event templates for easy integration + //'ga4_add_to_cart.tpl' => 'vt/GoogleTagManager/Application/views/ga4/add_to_cart.tpl', + //'ga4_view_item.tpl' => 'vt/GoogleTagManager/Application/views/ga4/view_item.tpl', + //'ga4_view_item_list.tpl' => 'vt/GoogleTagManager/Application/views/ga4/view_item_list.tpl', + 'gtm_ua_impression' => 'vt/GoogleTagManager/Application/views/ua/impression.tpl' + /* + + 'gtm_view_promotion.tpl' => 'vt/GoogleTagManager/Application/views/view_promotion.tpl', + 'gtm_select_promotion.tpl' => 'vt/GoogleTagManager/Application/views/select_promotion.tpl', + 'gtm_begin_checkout.tpl' => 'vt/GoogleTagManager/Application/views/begin_checkout.tpl', + */ + ], + 'blocks' => [ + // tag manager js + [ + 'template' => 'layout/base.tpl', + 'block' => 'head_meta_robots', + 'file' => '/Application/views/blocks/_gtm_js.tpl' + ], + // tag manager nojs + [ + 'template' => 'layout/base.tpl', + 'block' => 'theme_svg_icons', + 'file' => '/Application/views/blocks/_gtm_nojs.tpl' + ], + // add to cart + [ + 'template' => 'layout/header.tpl', + 'block' => 'header_main', + 'file' => '/Application/views/blocks/add_to_cart.tpl' + ], + // impressions + [ + 'template' => 'widget/product/listitem_grid.tpl', + 'block' => 'widget_product_listitem_grid', + 'file' => '/Application/views/blocks/impression.tpl' + ], + [ + 'template' => 'widget/product/listitem_infogrid.tpl', + 'block' => 'widget_product_listitem_infogrid', + 'file' => '/Application/views/blocks/impression.tpl' + ], + [ + 'template' => 'widget/product/listitem_line.tpl', + 'block' => 'widget_product_listitem_line', + 'file' => '/Application/views/blocks/impression.tpl' + ], + // details + [ + 'template' => 'page/details/inc/productmain.tpl', + 'block' => 'details_productmain_title', + 'file' => '/Application/views/blocks/detail.tpl' + ], + // checkout + [ + 'template' => 'page/checkout/basket.tpl', + 'block' => 'checkout_basket_main', + 'file' => '/Application/views/blocks/checkout_s1.tpl' + ], + [ + 'template' => 'form/user_checkout_change.tpl', + 'block' => 'user_checkout_change', + 'file' => '/Application/views/blocks/checkout_s2.tpl' + ], + [ + 'template' => 'form/user_checkout_register.tpl', + 'block' => 'user_checkout_register', + 'file' => '/Application/views/blocks/checkout_s2.tpl' + ], + [ + 'template' => 'form/user_checkout_noregister.tpl', + 'block' => 'user_checkout_noregister', + 'file' => '/Application/views/blocks/checkout_s2.tpl' + ], + [ + 'template' => 'page/checkout/payment.tpl', + 'block' => 'checkout_payment_main', + 'file' => '/Application/views/blocks/checkout_s3.tpl' + ], + [ + 'template' => 'page/checkout/order.tpl', + 'block' => 'checkout_order_main', + 'file' => '/Application/views/blocks/checkout_s4.tpl' + ], + [ + 'template' => 'page/checkout/thankyou.tpl', + 'block' => 'checkout_thankyou_main', + 'file' => '/Application/views/blocks/checkout_s5.tpl' + ] + ], + 'settings' => [ + [ + 'group' => 'vt_gtm_settings', + 'name' => 'vt_gtm_containerid', + 'type' => 'str', + 'value' => 'GTM-', + 'position' => 0 + ], + [ + 'group' => 'vt_gtm_settings', + 'name' => 'vt_gtm_enable_ga4', + 'type' => 'bool', + 'value' => true, + 'position' => 1 + ], + [ + 'group' => 'vt_gtm_settings', + 'name' => 'vt_gtm_enable_ua', + 'type' => 'bool', + 'value' => true, + 'position' => 2 + ], + [ + 'group' => 'vt_gtm_settings', + 'name' => 'vt_gtm_mpapisecret', + 'type' => 'str', + 'value' => '', + 'position' => 3 + ], + [ + 'group' => 'vt_gtm_settings', + 'name' => 'vt_gtm_promotionlistids', + 'type' => 'arr', + 'value' => [], + 'position' => 4 + ] + ] +]; \ No newline at end of file