Compare commits
47 Commits
Author | SHA1 | Date | |
---|---|---|---|
25234abfd8 | |||
667b48ac4b | |||
5e358fc684 | |||
3ff03ee0df | |||
09c1e31efe | |||
6d057971a7 | |||
0b134321ef | |||
b5d056fd83 | |||
410be2fb40 | |||
bd17c3370d | |||
d028f418ad | |||
cecbc0dec8 | |||
6a0fb759e1 | |||
120c765d0c | |||
4f73f18080 | |||
00f76d9908 | |||
306af0f7bd | |||
f6f4f87627 | |||
d9b8c274ce | |||
f41b2edeed | |||
69073c0109 | |||
b12884f99b | |||
c7d8fdcf6a | |||
87ce3efc5f | |||
f9d7f0b2e9 | |||
dfab91a71a | |||
ed75197a64 | |||
b861aef8a9 | |||
a74b6d9f15 | |||
633c1336a8 | |||
a5378ec70e | |||
34c27d101d | |||
fec7bf5c13 | |||
2b864f41e8 | |||
9ae1afa326 | |||
664119f89e | |||
c83e908da1 | |||
95de52600d | |||
6b039b6c9a | |||
1aad369e36 | |||
76e7bd10f6 | |||
6bfe8b90e6 | |||
4c08f58777 | |||
5de90a2488 | |||
f0466493b3 | |||
5b4bd5a05a | |||
ed767efa8a |
13
.php-cs-fixer.php
Normal file
13
.php-cs-fixer.php
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$finder = PhpCsFixer\Finder::create()
|
||||||
|
->in(__DIR__)
|
||||||
|
;
|
||||||
|
|
||||||
|
$config = new PhpCsFixer\Config();
|
||||||
|
return $config->setRules([
|
||||||
|
'@PHP73Migration' => true,
|
||||||
|
'@PSR12' => true
|
||||||
|
])
|
||||||
|
->setFinder($finder)
|
||||||
|
;
|
@ -1,5 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace VanillaThunder\GoogleTagManager\Application\Extend;
|
|
||||||
|
|
||||||
class ViewConfig_parent extends \OxidEsales\Eshop\Core\ViewConfig {};
|
|
@ -1,97 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/*
|
|
||||||
* vanilla-thunder/oxid-module-gtm
|
|
||||||
* Google Tag Manager Integration for OXID eShop v6.2+
|
|
||||||
*
|
|
||||||
* This program is free software;
|
|
||||||
* you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation;
|
|
||||||
* either version 3 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
||||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
* You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>
|
|
||||||
*/
|
|
||||||
|
|
||||||
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 Container ID
|
|
||||||
private $sContainerId = null;
|
|
||||||
public function getGtmContainerId()
|
|
||||||
{
|
|
||||||
if ( $this->sContainerId === null ) {
|
|
||||||
$this->sContainerId = ContainerFactory::getInstance()
|
|
||||||
->getContainer()
|
|
||||||
->get(ModuleSettingBridgeInterface::class)
|
|
||||||
->get('vt_gtm_containerid', 'vt-gtm');
|
|
||||||
}
|
|
||||||
return $this->sContainerId;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function getGtmDataLayer()
|
|
||||||
{
|
|
||||||
if( !$this->getGtmContainerId() ) return "[]";
|
|
||||||
|
|
||||||
$oConfig = Registry::getConfig();
|
|
||||||
$oView = $oConfig->getTopActiveView(); /** @var FrontendController $oShop */
|
|
||||||
//$oShop = oxRegistry::getConfig()->getActiveShop(); /** @var oxShop $oShop */
|
|
||||||
$oUser = $oConfig->getUser();
|
|
||||||
|
|
||||||
$dataLayer = [
|
|
||||||
'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();
|
|
||||||
if( $cl === "content" ) $dataLayer["page"]["type"] = "cms";
|
|
||||||
elseif( $cl === "details" ) $dataLayer["page"]["type"] = "product";
|
|
||||||
elseif( in_array($cl,["alist","search"]) ) $dataLayer["page"]["type"] = "listing";
|
|
||||||
elseif( in_array($cl,["basket","user","payment","order","thankyou"]) ) $dataLayer["page"]["type"] = "checkout";
|
|
||||||
|
|
||||||
|
|
||||||
return json_encode([$dataLayer],JSON_PRETTY_PRINT);
|
|
||||||
/*
|
|
||||||
// --- Produktdaten ---
|
|
||||||
$transactionProducts = [];
|
|
||||||
foreach($oOrder->getOrderArticles() as $_prod ) $transactionProducts[] = [
|
|
||||||
'name' => '', // (erforderlich) Produktname String
|
|
||||||
'sku' => '', // (erforderlich) Produkt-SKU String
|
|
||||||
'category' => '', // (optional) Produktkategorie String
|
|
||||||
'price' => '', // (erforderlich) Preis pro Einheit Numerischer Wert
|
|
||||||
'quantity' => '' // (erforderlich) Anzahl der Artikel Numerischer Wert
|
|
||||||
];
|
|
||||||
|
|
||||||
// --- Transaktionsdaten ---
|
|
||||||
|
|
||||||
$dataLayer['transactionId'] = $oOrder->oxorder__oxordernr->value; // (erforderlich) Eindeutige Transaktionskennung String
|
|
||||||
$dataLayer['transactionAffiliation'] = $oShop->oxshops__oxname->value; // (optional) Partner oder Geschäft String
|
|
||||||
$dataLayer['transactionTotal'] = $oOrder->oxorder__oxtotalordersum->value; // (erforderlich) Gesamtwert der Transaktion Numerischer Wert
|
|
||||||
$dataLayer['transactionShipping'] = $oOrder->oxorder__oxdelcost->value; // (optional) Versandkosten fĂĽr die Transaktion Numerischer Wert
|
|
||||||
$dataLayer['transactionTax'] = ''; // (optional) Steuerbetrag fĂĽr die Transaktion Numerischer Wert
|
|
||||||
$dataLayer['transactionProducts'] = $transactionProducts; // (optional) Liste der bei der Transaktion erworbenen Artikel Array von Produktobjekten
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
public function isPromotionList($listId)
|
|
||||||
{
|
|
||||||
$oConfig = Registry::getConfig();
|
|
||||||
$aPromotionListIds = $oConfig->getConfigParam("") ?? [ 'bargainItems', 'newItems', 'topBox', 'alsoBought', 'accessories', 'cross' ];
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,39 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* [bla] tag-manager
|
|
||||||
* Copyright (C) 2018 bestlife AG
|
|
||||||
* info: oxid@bestlife.ag
|
|
||||||
*
|
|
||||||
* This program is free software;
|
|
||||||
* you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation;
|
|
||||||
* either version 3 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
||||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
* You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>
|
|
||||||
**/
|
|
||||||
|
|
||||||
$aLang = [
|
|
||||||
'charset' => 'UTF-8',
|
|
||||||
|
|
||||||
// das hier wird nicht mehr benötigt, aber ich lasse es drin, falls doch
|
|
||||||
// leserliche Namen fĂĽr product list performance (GA)
|
|
||||||
'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
|
|
||||||
'VT_GTM_EE_LOGINOPTION' => 'Bestandskunde',
|
|
||||||
'VT_GTM_EE_LOGINOPTION1' => 'Gastbestellung',
|
|
||||||
'VT_GTM_EE_LOGINOPTION2' => 'Bestandskunde',
|
|
||||||
'VT_GTM_EE_LOGINOPTION3' => 'Neukunde'
|
|
||||||
|
|
||||||
];
|
|
@ -1,37 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* [bla] tag-manager
|
|
||||||
* Copyright (C) 2018 bestlife AG
|
|
||||||
* info: oxid@bestlife.ag
|
|
||||||
*
|
|
||||||
* This program is free software;
|
|
||||||
* you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation;
|
|
||||||
* either version 3 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
||||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
* You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>
|
|
||||||
**/
|
|
||||||
|
|
||||||
$aLang = [
|
|
||||||
'charset' => 'UTF-8',
|
|
||||||
|
|
||||||
|
|
||||||
// das hier wird nicht mehr benötigt, aber ich lasse es drin, falls doch
|
|
||||||
// leserliche Namen fĂĽr product list performance (GA)
|
|
||||||
'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
|
|
||||||
'VT_GTM_EE_LOGINOPTION' => 'Existing Customer',
|
|
||||||
'VT_GTM_EE_LOGINOPTION1' => 'Guest',
|
|
||||||
'VT_GTM_EE_LOGINOPTION2' => 'Existing Customer',
|
|
||||||
'VT_GTM_EE_LOGINOPTION3' => 'New Customer'
|
|
||||||
];
|
|
37
Application/views/admin/de/module_options.php
Normal file → Executable file
37
Application/views/admin/de/module_options.php
Normal file → Executable file
@ -1,31 +1,38 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* vanilla-thunder/oxid-module-gtm
|
* This Software is the property of Data Development and is protected
|
||||||
* Google Tag Manager Integration for OXID eShop v6.2+
|
* by copyright law - it is NOT Freeware.
|
||||||
|
* Any unauthorized use of this software without a valid license
|
||||||
|
* is a violation of the license agreement and will be prosecuted by
|
||||||
|
* civil and criminal law.
|
||||||
|
* http://www.shopmodule.com
|
||||||
*
|
*
|
||||||
* This program is free software;
|
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
|
||||||
* you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation;
|
* @author D3 Data Development - Daniel Seifert <support@shopmodule.com>
|
||||||
* either version 3 of the License, or (at your option) any later version.
|
* @link http://www.oxidmodule.com
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
||||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
* You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$style = '<style type="text/css">
|
$style = '<style type="text/css">
|
||||||
.groupExp a.rc b {font-size:medium;color:#ff3600;}
|
.groupExp a.rc b {font-size:medium;color:#ff3600;}
|
||||||
.groupExp dt .txt,
|
.groupExp dt .txt,
|
||||||
.groupExp dt .select,
|
.groupExp dt .select,
|
||||||
.groupExp dt .txtfield {width:250px !important; margin: 2px !important; padding: 1px 4px !important; border: 1px solid #ccc !important; }
|
.groupExp dt .txtfield {width:250px !important; margin: 2px !important; padding: 1px 4px !important; border: 1px solid #ccc !important; }
|
||||||
.groupExp dt textarea.txtfield { min-height: 125px;}
|
.groupExp dt textarea.txtfield { min-height: 125px;}
|
||||||
.groupExp dl { display:block !important;}
|
.groupExp dl { display:block !important;}
|
||||||
input.confinput {position:fixed;top:20px;right:70px;background:#008B2D;padding:10px 25px;color:white;border:1px solid black;cursor:pointer;font-size:125%;}
|
input.confinput {position:fixed;top:20px;right:70px;background:#008B2D;padding:10px 25px;color:white;border:1px solid black;cursor:pointer;font-size:125%;}
|
||||||
input.confinput:hover {outline:3px solid #ff3600;}
|
input.confinput:hover {outline:3px solid #ff3600;}
|
||||||
</style>';
|
</style>';
|
||||||
$aLang = [
|
$aLang = [
|
||||||
'charset' => 'UTF-8',
|
'charset' => 'UTF-8',
|
||||||
'SHOP_MODULE_GROUP_vt_gtm_settings' => $style . 'Einstellungen',
|
'SHOP_MODULE_d3_gtm_sContainerID' => 'Container ID',
|
||||||
'SHOP_MODULE_vt_gtm_containerid' => 'Container ID',
|
'SHOP_MODULE_GROUP_d3_gtm_settings' => 'Einstellungen',
|
||||||
'SHOP_MODULE_vt_gtm_promotionlistids' => 'Promotion Produktlisten IDs <div>Weitere Infos zu dieser Einstellung: <b><u><a href="https://github.com/vanilla-thunder/oxid-module-gtm/wiki/Promotion-Produktlisten" target="_blank">Modui-Wiki</a></u></b></div>',
|
'SHOP_MODULE_d3_gtm_blGA4enab' => 'GA4 Aktivieren',
|
||||||
|
'SHOP_MODULE_d3_gtm_blUAenabled' => 'UA Aktivieren',
|
||||||
|
'SHOP_MODULE_d3_gtm_blEnableDebug' => 'Debug-Modus aktivieren',
|
||||||
|
|
||||||
|
// for cookie manager settings
|
||||||
|
'SHOP_MODULE_GROUP_d3_gtm_settings_cookiemanager' => 'Cookie Manager Einstellungen',
|
||||||
|
'SHOP_MODULE_d3_gtm_settings_hasOwnCookieManager' => 'Eigenen Cookie Manager nutzen?',
|
||||||
|
'SHOP_MODULE_d3_gtm_settings_cookieName' => 'Cookie-Name',
|
||||||
];
|
];
|
||||||
|
53
Application/views/blocks/_gtm_js.tpl
Normal file → Executable file
53
Application/views/blocks/_gtm_js.tpl
Normal file → Executable file
@ -1,24 +1,59 @@
|
|||||||
[{if $oViewConf->getGtmContainerId()}][{strip}]
|
[{assign var="d3VtConfigObject" value=$oViewConf->getConfig()}]
|
||||||
<!-- Google Tag Manager -->
|
[{if $d3VtConfigObject->getConfigParam('d3_gtm_settings_hasOwnCookieManager')}]
|
||||||
<script>
|
[{if $oViewConf->D3blAcceptedCookie($d3VtConfigObject->getConfigParam('d3_gtm_settings_cookieName'))}]
|
||||||
var dataLayer = [{$oViewConf->getGtmDataLayer()}] || [];
|
|
||||||
(function (w, d, s, l, i) {
|
[{if $oViewConf->getGtmContainerId()}][{strip}]
|
||||||
|
<!-- Google Tag Manager -->
|
||||||
|
<script>
|
||||||
|
var dataLayer = [{$oViewConf->getGtmDataLayer()}] || [];
|
||||||
|
(function (w, d, s, l, i) {
|
||||||
w[l] = w[l] || [];
|
w[l] = w[l] || [];
|
||||||
w[l].push({'gtm.start': new Date().getTime(), event: 'gtm.js'});
|
w[l].push({'gtm.start': new Date().getTime(), event: 'gtm.js'});
|
||||||
var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : '';
|
var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : '';
|
||||||
j.async = true;
|
j.async = true;
|
||||||
j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
|
j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
|
||||||
f.parentNode.insertBefore(j, f);
|
f.parentNode.insertBefore(j, f);
|
||||||
})(window, document, 'script', 'dataLayer', '[{$oViewConf->getGtmContainerId()}]');
|
})(window, document, 'script', 'dataLayer', '[{$oViewConf->getGtmContainerId()}]');
|
||||||
|
</script>
|
||||||
|
<!-- End Google Tag Manager -->
|
||||||
|
[{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}]
|
||||||
|
[{else}]
|
||||||
|
<script>
|
||||||
|
var dataLayer = [{$oViewConf->getGtmDataLayer()}] || [];
|
||||||
|
</script>
|
||||||
|
[{/if}]
|
||||||
|
[{else}]
|
||||||
|
[{if $oViewConf->getGtmContainerId()}][{strip}]
|
||||||
|
<!-- Google Tag Manager -->
|
||||||
|
<script>
|
||||||
|
var dataLayer = [{$oViewConf->getGtmDataLayer()}] || [];
|
||||||
|
(function (w, d, s, l, i) {
|
||||||
|
w[l] = w[l] || [];
|
||||||
|
w[l].push({'gtm.start': new Date().getTime(), event: 'gtm.js'});
|
||||||
|
var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : '';
|
||||||
|
j.async = true;
|
||||||
|
j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
|
||||||
|
f.parentNode.insertBefore(j, f);
|
||||||
|
})(window, document, 'script', 'dataLayer', '[{$oViewConf->getGtmContainerId()}]');
|
||||||
</script>
|
</script>
|
||||||
<!-- End Google Tag Manager -->
|
<!-- End Google Tag Manager -->
|
||||||
[{if $oViewConf->getTopActionClassName() === "alist" }]
|
[{if $oViewConf->getTopActionClassName() === "alist" }]
|
||||||
[{* include file="ga4_view_item_list.tpl" gtmCategory=$oView->getActiveCategory() gtmProducts=$oView->getArticleList() listtype=$oView->getListType() *}]
|
[{* include file="ga4_view_item_list.tpl" gtmCategory=$oView->getActiveCategory() gtmProducts=$oView->getArticleList() listtype=$oView->getListType() *}]
|
||||||
[{elseif $oViewConf->getTopActionClassName() === "details" }]
|
[{elseif $oViewConf->getTopActionClassName() === "details" }]
|
||||||
[{* include file="ga4_view_item.tpl" gtmProduct=$oView->getProduct() *}]
|
[{* include file="ga4_view_item.tpl" gtmProduct=$oView->getProduct() *}]
|
||||||
[{elseif $oViewConf->getTopActionClassName() === "search" }]
|
[{elseif $oViewConf->getTopActionClassName() === "search" }]
|
||||||
[{elseif $oViewConf->getTopActionClassName() === "basket" }]
|
[{elseif $oViewConf->getTopActionClassName() === "basket" }]
|
||||||
|
|
||||||
[{/if}]
|
[{/if}]
|
||||||
[{/strip}][{/if}]
|
[{/strip}][{/if}]
|
||||||
|
[{/if}]
|
||||||
|
|
||||||
[{$smarty.block.parent}]
|
[{$smarty.block.parent}]
|
||||||
|
@ -1,57 +1,31 @@
|
|||||||
[{strip}]
|
[{$smarty.block.parent}]
|
||||||
[{assign var='gtmCartArticles' value=$oView->getBasketArticles()}]
|
|
||||||
<script>
|
|
||||||
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
|
||||||
dataLayer.push({
|
|
||||||
'event': 'ee.checkout',
|
|
||||||
'eventLabel':'Checkout Step 1',
|
|
||||||
'ecommerce': {
|
|
||||||
'checkout': {
|
|
||||||
'actionField': {'step': 1},
|
|
||||||
'products': [
|
|
||||||
[{foreach from=$oxcmp_basket->getContents() item=basketitem name=gtmCartContents key=basketindex}]
|
|
||||||
[{assign var='_price' value=$basketitem->getUnitPrice()}]
|
|
||||||
{
|
|
||||||
'id': '[{$gtmCartArticles[$basketindex]->oxarticles__oxartnum->value}]',
|
|
||||||
'name': '[{$gtmCartArticles[$basketindex]->oxarticles__oxtitle->value}]',
|
|
||||||
'variant': '[{$gtmCartArticles[$basketindex]->oxarticles__oxvarselect->value}]',
|
|
||||||
'price': [{$_price->getPrice()}],
|
|
||||||
'quantity':[{$basketitem->getAmount()}],
|
|
||||||
'position':[{$smarty.foreach.gtmCartContents.index}]
|
|
||||||
}[{if !$smarty.foreach.gtmCartContents.last}],[{/if}]
|
|
||||||
[{/foreach}]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
[{*
|
|
||||||
var gtmCartContents = {[{foreach key=basketindex from=$oxcmp_basket->getContents() item=basketitem name=gtmCartContents}]
|
|
||||||
'[{$basketindex}]':{ 'id':'[{$gtmCartArticles[$basketindex]->oxarticles__oxartnum->value}]' }[{if !$smarty.foreach.gtmCartContents.last}],[{/if}][{/foreach}]
|
|
||||||
};
|
|
||||||
|
|
||||||
[{capture name='removeFromBasket'}]
|
[{*$oxcmp_basket|get_class_methods|dumpvar*}]
|
||||||
$('#basketRemove').on('click', function() {
|
|
||||||
var _checked = [],
|
|
||||||
_products = [];
|
|
||||||
|
|
||||||
$('input:checkbox:checked[name^="aproducts"][name*="remove"]').each(function() { _checked.push($(this).attr('name').replace('aproducts[','').replace('][remove]','')); });
|
[{assign var='gtmCartArticles' value=$oView->getBasketArticles()}]
|
||||||
if(_checked.length == 0) return;
|
[{strip}][{capture assign=d3_ga4_view_cart}]
|
||||||
_checked.forEach(function(_oxid) { _products.push({ 'id':gtmCartContents[_oxid].id}) });
|
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
||||||
|
dataLayer.push({
|
||||||
dataLayer.push({
|
'event': 'view_cart',
|
||||||
'event':'ee.removeFromCart',
|
'eventLabel':'Checkout Step 1',
|
||||||
'ecommerce': {
|
'ecommerce': {
|
||||||
'currencyCode': '[{$currency->name}]',
|
'actionField': "step: 1",
|
||||||
'remove': {
|
'currency': "[{$currency->name}]",
|
||||||
'products': _products
|
'value': [{oxprice price=$oxcmp_basket->getPrice()}],
|
||||||
}
|
'items': [
|
||||||
}
|
[{foreach from=$oxcmp_basket->getContents() item=basketitem name=gtmCartContents key=basketindex}]
|
||||||
|
[{assign var='_price' value=$basketitem->getUnitPrice()}]
|
||||||
});
|
{
|
||||||
});
|
'item_id': '[{$gtmCartArticles[$basketindex]->oxarticles__oxartnum->value}]',
|
||||||
[{/capture }]
|
'item_name': '[{$gtmCartArticles[$basketindex]->oxarticles__oxtitle->value}]',
|
||||||
[{oxscript add=$smarty.capture.removeFromBasket}]
|
'item_variant': '[{$gtmCartArticles[$basketindex]->oxarticles__oxvarselect->value}]',
|
||||||
*}]
|
'price': [{$_price->getPrice()}],
|
||||||
</script>
|
'quantity':[{$basketitem->getAmount()}],
|
||||||
[{/strip}]
|
'position':[{$smarty.foreach.gtmCartContents.index}]
|
||||||
[{$smarty.block.parent}]
|
}[{if !$smarty.foreach.gtmCartContents.last}],[{/if}]
|
||||||
|
[{/foreach}]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
[{/capture}][{/strip}]
|
||||||
|
[{oxscript add=$d3_ga4_view_cart}]
|
@ -8,7 +8,7 @@
|
|||||||
'checkout': {
|
'checkout': {
|
||||||
'actionField': {
|
'actionField': {
|
||||||
'step': 2,
|
'step': 2,
|
||||||
'option':'[{oxmultilang ident="VT_GTM_EE_LOGINOPTION"|cat:$oView->getLoginOption()}]'
|
'option':'[{oxmultilang ident="vt_GTM_EE_LOGINOPTION"|cat:$oView->getLoginOption()}]'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
[{$smarty.block.parent}]
|
||||||
|
|
||||||
[{strip}]
|
[{strip}]
|
||||||
<script>
|
<script>
|
||||||
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
||||||
@ -5,33 +7,29 @@
|
|||||||
[{assign var="_gtmArticles" value=$_gtmOrder->getOrderArticles()}]
|
[{assign var="_gtmArticles" value=$_gtmOrder->getOrderArticles()}]
|
||||||
|
|
||||||
dataLayer.push({
|
dataLayer.push({
|
||||||
'event': 'ee.transaction',
|
'event': 'purchase',
|
||||||
'eventLabel':'Checkout Step 5',
|
'eventLabel':'Checkout Step 5',
|
||||||
'ecommerce': {
|
'ecommerce': {
|
||||||
'purchase': {
|
'transaction_id': '[{$_gtmOrder->oxorder__oxordernr->value}]',
|
||||||
'actionField': {
|
'affiliation': '[{$oxcmp_shop->oxshops__oxname->value}]',
|
||||||
'id':'[{$_gtmOrder->oxorder__oxordernr->value}]',
|
'value': '[{$_gtmOrder->oxorder__oxtotalordersum->value}]',
|
||||||
'affiliation':'[{$oxcmp_shop->oxshops__oxname->value}]',
|
'tax': '[{math equation="x+y" x=$_gtmOrder->oxorder__oxartvatprice1->value y=$_gtmOrder->oxorder__oxartvatprice2->value }]',
|
||||||
'revenue':'[{$_gtmOrder->oxorder__oxtotalordersum->value}]',
|
'shipping': '[{$_gtmOrder->oxorder__oxdelcost->value}]',
|
||||||
'tax':'[{math equation="x+y" x=$_gtmOrder->oxorder__oxartvatprice1->value y=$_gtmOrder->oxorder__oxartvatprice2->value }]',
|
'currency': '[{$_gtmOrder->getFieldData('oxcurrency')}]',
|
||||||
'shipping':'[{$_gtmOrder->oxorder__oxdelcost->value}]'
|
'items':
|
||||||
/*'coupon':'CANO25' //if a coupon code was used for this order*/
|
[
|
||||||
},
|
[{foreach from=$_gtmArticles item="_gtmArticle" name="gtmArticles"}]
|
||||||
'products':[
|
{
|
||||||
[{foreach from=$_gtmArticles item="_gtmArticle" name="gtmArticles"}]
|
'id': '[{$_gtmArticle->oxorderarticles__oxartnum->value}]',
|
||||||
{
|
'name': '[{$_gtmArticle->oxorderarticles__oxtitle->value}]',
|
||||||
'id':'[{$_gtmArticle->oxorderarticles__oxartnum->value}]',
|
'variant': '[{$_gtmArticle->oxorderarticles__oxselvariant->value}]',
|
||||||
'name': '[{$_gtmArticle->oxorderarticles__oxtitle->value}]',
|
'price': [{$_gtmArticle->oxorderarticles__oxprice->value}],
|
||||||
'variant':'[{$_gtmArticle->oxorderarticles__oxselvariant->value}]',
|
'quantity': [{$_gtmArticle->oxorderarticles__oxamount->value}],
|
||||||
'price': [{$_gtmArticle->oxorderarticles__oxprice->value}],
|
'position': [{$smarty.foreach.gtmArticles.iteration}]
|
||||||
'quantity':[{$_gtmArticle->oxorderarticles__oxamount->value}],
|
}[{if !$smarty.foreach.gtmArticles.last}],[{/if}]
|
||||||
'position':[{$smarty.foreach.gtmArticles.iteration}]
|
[{/foreach}]
|
||||||
}[{if !$smarty.foreach.gtmArticles.last}],[{/if}]
|
]
|
||||||
[{/foreach}]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
</script>
|
</script>
|
||||||
[{/strip}]
|
[{/strip}]
|
||||||
[{$smarty.block.parent}]
|
|
||||||
|
@ -2,26 +2,24 @@
|
|||||||
[{assign var="gtmProduct" value=$oView->getProduct()}]
|
[{assign var="gtmProduct" value=$oView->getProduct()}]
|
||||||
[{assign var="gtmCategory" value=$gtmProduct->getCategory()}]
|
[{assign var="gtmCategory" value=$gtmProduct->getCategory()}]
|
||||||
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
|
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
|
||||||
[{strip}][{/strip}]
|
|
||||||
<script>
|
<script>
|
||||||
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
||||||
dataLayer.push({
|
dataLayer.push({
|
||||||
'event': 'ee.detail',
|
'event': 'view_item',
|
||||||
'eventLabel':'Product View',
|
'eventLabel':'Product View',
|
||||||
'ecommerce': {
|
'ecommerce': {
|
||||||
'currencyCode': '[{$currency->name}]',
|
'currency': '[{$currency->name}]',
|
||||||
'detail': {
|
'items': [
|
||||||
'products': [
|
{
|
||||||
{
|
'item_name': '[{$gtmProduct->oxarticles__oxtitle->value}]',
|
||||||
'name': '[{$gtmProduct->oxarticles__oxtitle->value}]',
|
'item_id': '[{$gtmProduct->oxarticles__oxartnum->value}]',
|
||||||
'id': '[{$gtmProduct->oxarticles__oxartnum->value}]',
|
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
||||||
'price': [{$gtmProduct->oxarticles__oxprice->value}],
|
'item_category': '[{if $gtmCategory}][{$gtmCategory->getLink()|parse_url:5|ltrim:"/"|rtrim:"/"}][{else}]-[{/if}]',
|
||||||
'brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
'item_variant': '[{if $gtmProduct->oxarticles__oxvarselect->value}][{$gtmProduct->oxarticles__oxvarselect->value}][{/if}]',
|
||||||
'category': '[{if $gtmCategory}][{$gtmCategory->getLink()|parse_url:5|ltrim:"/"|rtrim:"/"}][{else}]-[{/if}]',
|
'price': [{$gtmProduct->oxarticles__oxprice->value}]
|
||||||
'variant': '[{if $gtmProduct->oxarticles__oxvarselect->value}][{$gtmProduct->oxarticles__oxvarselect->value}][{/if}]'
|
}
|
||||||
}
|
]
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
0
Application/views/ga4/add_payment_info.tpl
Executable file
0
Application/views/ga4/add_payment_info.tpl
Executable file
0
Application/views/ga4/add_shipping_info.tpl
Executable file
0
Application/views/ga4/add_shipping_info.tpl
Executable file
@ -1,41 +1,59 @@
|
|||||||
[{strip}]
|
[{$smarty.block.parent}]
|
||||||
[{$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()}]
|
|
||||||
<script type="text/javascript">
|
|
||||||
|
|
||||||
var itemCategories = '[{if $gtmCategory}][{$gtmCategory->getLink()|parse_url:5|ltrim:"/"|rtrim:"/"}][{else}]no category[{/if}]'.split('/');
|
[{*$gtmProduct|get_class_methods|dumpvar*}]
|
||||||
//console.log(itemCategories);
|
|
||||||
var _gtmProduct = {
|
[{capture assign=d3_ga4_add_to_cart}]
|
||||||
'item_name': '[{$gtmProduct->oxarticles__oxtitle->value}]',
|
[{block name="d3_ga4_add_to_basket"}]
|
||||||
'item_id': '[{$gtmProduct->oxarticles__oxartnum->value}]',
|
$("#toBasket").click(function(event) {
|
||||||
'price': '[{$gtmProduct->oxarticles__oxprice->value}]',
|
[{*event.preventDefault();*}]
|
||||||
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
|
||||||
'item_variant': '[{if $gtmProduct->oxarticles__oxvarselect->value}][{$gtmProduct->oxarticles__oxvarselect->value}][{/if}]',
|
let iArtQuantity = $("#amountToBasket").val();
|
||||||
'item_category': itemCategories[0] || 'no category',
|
|
||||||
'item_category_2': itemCategories[1] || '',
|
dataLayer.push({
|
||||||
'item_category_3': itemCategories[2] || '',
|
'isAddToBasket': true,
|
||||||
'item_category_4': itemCategories[3] || '',
|
'event':'add_to_cart',
|
||||||
|
'eventLabel': 'add_to_cart',
|
||||||
|
'ecommerce': {
|
||||||
|
'currency': "[{$currency->name}]",
|
||||||
|
'value': iArtQuantity*[{$gtmProduct->getFieldData('oxprice')}],
|
||||||
|
'items': [
|
||||||
|
{
|
||||||
|
'item_id': '[{$gtmProduct->getFieldData('oxartnum')}]',
|
||||||
|
'item_name': '[{$gtmProduct->getFieldData('oxtitle')}]',
|
||||||
|
'price': '[{$gtmProduct->getFieldData('oxprice')}]',
|
||||||
|
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
||||||
|
'item_variant': '[{if $gtmProduct->getFieldData('oxvarselect')}][{$gtmProduct->getFieldData('oxvarselect')}][{/if}]',
|
||||||
|
'item_category': itemCategories[0] || 'no category',
|
||||||
|
'item_category_2':itemCategories[1] || '',
|
||||||
|
'item_category_3':itemCategories[2] || '',
|
||||||
|
'item_category_4':itemCategories[3] || '',
|
||||||
[{if false}]
|
[{if false}]
|
||||||
|
[{* ??? what *}]
|
||||||
'item_list_name': 'Search Results', // If associated with a list selection.
|
'item_list_name': 'Search Results', // If associated with a list selection.
|
||||||
'item_list_id': 'SR123', // If associated with a list selection.
|
'item_list_id': 'SR123', // If associated with a list selection.
|
||||||
'index': 1, // If associated with a list selection.
|
'index': 1, // If associated with a list selection.
|
||||||
[{/if}]
|
[{/if}]
|
||||||
'quantity': '1'
|
'quantity': iArtQuantity
|
||||||
};
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
[{/block}]
|
||||||
|
[{/capture}]
|
||||||
|
[{oxscript add=$d3_ga4_add_to_cart}]
|
||||||
|
|
||||||
console.log(_gtmProduct);
|
[{strip}]
|
||||||
dataLayer.push({
|
[{* variable $gtmProduct is passed from parent tempalte *}]
|
||||||
'event':'ecommerce',
|
|
||||||
'ga4event': 'add_to_cart',
|
[{assign var="gtmCurrency" value=$oView->getActCurrency()}]
|
||||||
'ecommerce': {
|
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
|
||||||
'items': [ _gtmProduct ]
|
[{assign var="gtmCategory" value=$gtmProduct->getCategory()}]
|
||||||
}
|
|
||||||
});
|
<script>
|
||||||
|
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
||||||
|
|
||||||
|
let itemCategories = '[{if $gtmCategory}][{$gtmCategory->getLink()|parse_url:5|ltrim:"/"|rtrim:"/"}][{else}]no category[{/if}]'.split('/');
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
*}]
|
|
||||||
[{/strip}]
|
[{/strip}]
|
0
Application/views/ga4/begin_checkout.tpl
Executable file
0
Application/views/ga4/begin_checkout.tpl
Executable file
0
Application/views/ga4/generate_lead.tpl
Executable file
0
Application/views/ga4/generate_lead.tpl
Executable file
0
Application/views/ga4/login.tpl
Executable file
0
Application/views/ga4/login.tpl
Executable file
36
Application/views/ga4/purchase.tpl
Executable file
36
Application/views/ga4/purchase.tpl
Executable file
@ -0,0 +1,36 @@
|
|||||||
|
[{strip}]
|
||||||
|
<script type="text/javascript">
|
||||||
|
window.dataLayer = window.dataLayer || [];
|
||||||
|
dataLayer.push({ ecommerce: null });
|
||||||
|
dataLayer.push({
|
||||||
|
[{assign var="oBasket" value=$order->getBasket()}]
|
||||||
|
[{assign var="iVat" value=0}]
|
||||||
|
|
||||||
|
'event':'purchase',
|
||||||
|
'ecommerce':{
|
||||||
|
'purchase':{
|
||||||
|
'actionField':{
|
||||||
|
'id': [{$order->getFieldData('oxordernr')}],
|
||||||
|
'ordernr': [{$order->getFieldData('oxtotalordersum')}],
|
||||||
|
'tax': [{$order->d3GetSumOrderVat()}],
|
||||||
|
'shipping': [{$order->getFieldData('oxdelcost')}],
|
||||||
|
'currency': "[{$order->getFieldData('oxcurrency')}]"
|
||||||
|
},
|
||||||
|
'products':[
|
||||||
|
[{foreach from=$order->getOrderArticles() item=listItem}]
|
||||||
|
[{assign var="orderArticle" value=$listItem->getArticle()}]
|
||||||
|
{
|
||||||
|
'item_id': "[{$listItem->getFieldData('oxartnum')}]",
|
||||||
|
'item_name': "[{$listItem->getFieldData('oxtitle')}]",
|
||||||
|
'currency': "[{$order->getFieldData('oxcurrency')}]",
|
||||||
|
'articleVat': [{$orderArticle->getArticleVat()}],
|
||||||
|
'price': [{$orderArticle->getBasePrice()}],
|
||||||
|
'quantity': [{$listItem->getFieldData('oxamount')}]
|
||||||
|
},
|
||||||
|
[{/foreach}]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
[{/strip}]
|
0
Application/views/ga4/remove_from_cart.tpl
Executable file
0
Application/views/ga4/remove_from_cart.tpl
Executable file
32
Application/views/ga4/search.tpl
Executable file
32
Application/views/ga4/search.tpl
Executable file
@ -0,0 +1,32 @@
|
|||||||
|
[{$smarty.block.parent}]
|
||||||
|
|
||||||
|
[{assign var="gtmProducts" value=$oView->getArticleList()}]
|
||||||
|
|
||||||
|
[{if $gtmProducts|@count}]
|
||||||
|
[{strip}]
|
||||||
|
<script>
|
||||||
|
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
||||||
|
dataLayer.push({
|
||||||
|
'event': 'view_search_result',
|
||||||
|
'eventLabel':'view_search_result',
|
||||||
|
'ecommerce': {
|
||||||
|
'search_term': '[{$searchparamforhtml}]',
|
||||||
|
'items': [
|
||||||
|
[{foreach from=$gtmProducts name="gtmProducts" item="gtmProduct"}]
|
||||||
|
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
|
||||||
|
[{if !$gtmCategory}][{assign var="gtmCategory" value=$gtmProduct->getCategory()}][{/if}]
|
||||||
|
{
|
||||||
|
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
|
||||||
|
'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]',
|
||||||
|
'price': [{$gtmProduct->oxarticles__oxprice->value|default:'0'}],
|
||||||
|
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
||||||
|
'item_category': '[{if $gtmCategory}][{$gtmCategory->getLink()|parse_url:5|ltrim:"/"|rtrim:"/"}][{else}]-[{/if}]',
|
||||||
|
'quantity': 1
|
||||||
|
}[{if !$smarty.foreach.gtmProducts.last}],[{/if}]
|
||||||
|
[{/foreach}]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
[{/strip}]
|
||||||
|
[{/if}]
|
0
Application/views/ga4/select_content.tpl
Executable file
0
Application/views/ga4/select_content.tpl
Executable file
0
Application/views/ga4/select_item.tpl
Executable file
0
Application/views/ga4/select_item.tpl
Executable file
0
Application/views/ga4/select_promotion.tpl
Executable file
0
Application/views/ga4/select_promotion.tpl
Executable file
0
Application/views/ga4/sign_up.tpl
Executable file
0
Application/views/ga4/sign_up.tpl
Executable file
0
Application/views/ga4/view_cart.tpl
Executable file
0
Application/views/ga4/view_cart.tpl
Executable file
@ -1,12 +1,18 @@
|
|||||||
|
[{assign var="gtmProducts" value=$products}]
|
||||||
|
|
||||||
|
[{assign var="breadCrumb" value=''}]
|
||||||
|
|
||||||
[{if $gtmProducts|@count}]
|
[{if $gtmProducts|@count}]
|
||||||
[{strip}]
|
[{strip}]
|
||||||
<script>
|
<script>
|
||||||
/* ga4 */
|
/* ga4 */
|
||||||
dataLayer.push({ecommerce: null});
|
dataLayer.push({ecommerce: null});
|
||||||
dataLayer.push({
|
dataLayer.push({
|
||||||
'event':'GA4_event',
|
'event':'view_item_list',
|
||||||
'event_name': 'view_item_list',
|
'event_name': 'view_item_list',
|
||||||
'ecommerce': {
|
'ecommerce': {
|
||||||
|
'item_list_id': '[{$oView->getCategoryId()}]',
|
||||||
|
'item_list_name': '[{foreach from=$oView->getBreadCrumb() item=sCrum}][{if $sCrum.title }][{$breadCrumb|cat:$sCrum.title|cat:" > "}][{/if}][{/foreach}]',
|
||||||
'items': [
|
'items': [
|
||||||
[{foreach from=$gtmProducts name="gtmProducts" item="gtmProduct"}]
|
[{foreach from=$gtmProducts name="gtmProducts" item="gtmProduct"}]
|
||||||
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
|
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
|
||||||
@ -23,29 +29,6 @@
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
/* ua */
|
|
||||||
dataLayer.push({ecommerce: null});
|
|
||||||
dataLayer.push({
|
|
||||||
'event':'UA_event',
|
|
||||||
'event_name': 'view_item_list',
|
|
||||||
'ecommerce': {
|
|
||||||
'currencyCode':'EUR',
|
|
||||||
'impressions': [
|
|
||||||
[{foreach from=$gtmProducts name="gtmProducts" item="gtmProduct"}]
|
|
||||||
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
|
|
||||||
[{if !$gtmCategory}][{assign var="gtmCategory" value=$gtmProduct->getCategory()}][{/if}]
|
|
||||||
{
|
|
||||||
'id': '[{$gtmProduct->getFieldData("oxartnum")}]',
|
|
||||||
'name': '[{$gtmProduct->getFieldData("oxtitle")}]',
|
|
||||||
'price': [{$gtmProduct->oxarticles__oxprice->value|default:'0'}],
|
|
||||||
'brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
|
||||||
'category': '[{if $gtmCategory}][{$gtmCategory->getLink()|parse_url:5|ltrim:"/"|rtrim:"/"}][{else}]-[{/if}]',
|
|
||||||
'position': [{$smarty.foreach.gtmProducts.iterator|default:1}]
|
|
||||||
}[{if !$smarty.foreach.gtmProducts.last}],[{/if}]
|
|
||||||
[{/foreach}]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
[{/strip}]
|
[{/strip}]
|
||||||
[{/if}]
|
[{/if}]
|
0
Application/views/ga4/view_promotion.tpl
Executable file
0
Application/views/ga4/view_promotion.tpl
Executable file
@ -1,29 +0,0 @@
|
|||||||
[{strip}]
|
|
||||||
[{assign var="gtmCategory" value=$gtmProduct->getCategory()}]
|
|
||||||
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
|
|
||||||
<script>
|
|
||||||
/* UA */
|
|
||||||
dataLayer.push({ecommerce: null});
|
|
||||||
dataLayer.push({
|
|
||||||
'event': 'UA_ecommerce',
|
|
||||||
'event_name': 'Impression',
|
|
||||||
'ecommerce': {
|
|
||||||
'currencyCode': '[{$currency->name}]',
|
|
||||||
'impressions': [
|
|
||||||
{
|
|
||||||
'name': '[{$gtmProduct->oxarticles__oxtitle->value}]',
|
|
||||||
'id': '[{$gtmProduct->oxarticles__oxartnum->value}]',
|
|
||||||
'price': [{$gtmProduct->oxarticles__oxprice->value}],
|
|
||||||
'brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
|
||||||
'category': '[{if $gtmCategory}][{$gtmCategory->getLink()|parse_url:5|ltrim:"/"|rtrim:"/"}][{else}]no category[{/if}]',
|
|
||||||
'variant': '[{if $gtmProduct->oxarticles__oxvarselect->value}][{$gtmProduct->oxarticles__oxvarselect->value}][{/if}]'
|
|
||||||
[{if $list && $position}],
|
|
||||||
'list': '[{$list}]',
|
|
||||||
'position': [{"_"|str_replace:"":$position}]
|
|
||||||
[{/if}]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
[{/strip}]
|
|
@ -1,62 +0,0 @@
|
|||||||
[{strip}]
|
|
||||||
[{assign var="gtmCartArticles" value=$oView->getBasketArticles()}]
|
|
||||||
<script>
|
|
||||||
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null});
|
|
||||||
dataLayer.push({
|
|
||||||
"event":"enhanced-ecommerce",
|
|
||||||
"ecommerce": {
|
|
||||||
"checkout": {
|
|
||||||
"actionField": {"step":1},
|
|
||||||
"products": [
|
|
||||||
[{foreach key=basketindex from=$oxcmp_basket->getContents() item=basketitem name=gtmCartContents}]
|
|
||||||
[{assign var="_price" value=$basketitem->getPrice()}]
|
|
||||||
{
|
|
||||||
'id':'[{$gtmCartArticles[$basketindex]->oxarticles__oxartnum->value}]',
|
|
||||||
'name': '[{$gtmCartArticles[$basketindex]->oxarticles__oxtitle->value}]',
|
|
||||||
'variant':'[{$gtmCartArticles[$basketindex]->oxarticles__oxvarselect->value}]',
|
|
||||||
'price': [{$_price->getPrice()}],
|
|
||||||
'quantity':[{$basketitem->getAmount()}],
|
|
||||||
'position':[{$smarty.foreach.gtmCartContents.index}]
|
|
||||||
}[{if !$smarty.foreach.gtmCartContents.last}],[{/if}]
|
|
||||||
[{/foreach}]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var gtmCartContents = {
|
|
||||||
[{foreach key=basketindex from=$oxcmp_basket->getContents() item=basketitem name=gtmCartContents}]
|
|
||||||
'[{$basketindex}]':{
|
|
||||||
'id':'[{$gtmCartArticles[$basketindex]->oxarticles__oxartnum->value}]'
|
|
||||||
}[{if !$smarty.foreach.gtmCartContents.last}],[{/if}]
|
|
||||||
[{/foreach}]
|
|
||||||
};
|
|
||||||
|
|
||||||
[{capture name="removeFromBasket"}]
|
|
||||||
$("#basketRemove").on("click", function() {
|
|
||||||
var _checked = [],
|
|
||||||
_products = [];
|
|
||||||
|
|
||||||
$("input:checkbox:checked[name^='aproducts'][name*='remove']").each(function() { _checked.push($(this).attr('name').replace("aproducts[","").replace("][remove]","")); });
|
|
||||||
if(_checked.length == 0) return;
|
|
||||||
_checked.forEach(function(_oxid) { _products.push({ 'id':gtmCartContents[_oxid].id}) });
|
|
||||||
|
|
||||||
dataLayer.push({
|
|
||||||
'event':'ee.removeFromCart',
|
|
||||||
'ecommerce': {
|
|
||||||
'currencyCode': '[{$currency->name}]',
|
|
||||||
'remove': {
|
|
||||||
'products': _products
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
});
|
|
||||||
/*
|
|
||||||
|
|
||||||
*/
|
|
||||||
[{/capture}]
|
|
||||||
[{oxscript add=$smarty.capture.removeFromBasket}]
|
|
||||||
</script>
|
|
||||||
[{/strip}]
|
|
||||||
[{$smarty.block.parent}]
|
|
@ -1,13 +0,0 @@
|
|||||||
<script>
|
|
||||||
dataLayer.push({
|
|
||||||
'event':'ee.checkout',
|
|
||||||
'eventLabel':'Checkout 2',
|
|
||||||
'ecommerce': {
|
|
||||||
'checkout': { 'actionField': {
|
|
||||||
'step': 2,
|
|
||||||
'option':'[{oxmultilang ident="VT_GTM_EE_LOGINOPTION"|cat:$oView->getLoginOption()}]'
|
|
||||||
} }
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
[{$smarty.block.parent}]
|
|
@ -1,8 +0,0 @@
|
|||||||
<script>
|
|
||||||
dataLayer.push({
|
|
||||||
'event': 'ee.checkout',
|
|
||||||
'eventLabel': 'Checkout 3',
|
|
||||||
'ecommerce': {'checkout': {'actionField': {'step': 3}}}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
[{$smarty.block.parent}]
|
|
@ -1,8 +0,0 @@
|
|||||||
<script>
|
|
||||||
dataLayer.push({
|
|
||||||
"event": "ee.checkout",
|
|
||||||
'eventLabel': 'Checkout 4',
|
|
||||||
"ecommerce": {"checkout": {"actionField": {"step": 4}}}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
[{$smarty.block.parent}]
|
|
@ -1,44 +0,0 @@
|
|||||||
<script>
|
|
||||||
[{*
|
|
||||||
dataLayer.push({
|
|
||||||
'event': 'ee.checkout',
|
|
||||||
'eventLabel':'Checkout 5',
|
|
||||||
'ecommerce': {'checkout': {'actionField': {'step': 5}}}
|
|
||||||
});
|
|
||||||
*}]
|
|
||||||
[{assign var="_gtmOrder" value=$oView->getOrder()}]
|
|
||||||
[{assign var="_gtmBasket" value=$_gtmOrder->getBasket()}]
|
|
||||||
[{assign var="_gtmArticles" value=$_gtmOrder->getOrderArticles()}]
|
|
||||||
|
|
||||||
dataLayer.push({
|
|
||||||
'event': 'ee.transaction',
|
|
||||||
'eventLabel':'[{oxmultilang ident="ORDER_COMPLETED"}]',
|
|
||||||
'ecommerce': {
|
|
||||||
'purchase': {
|
|
||||||
'actionField': {
|
|
||||||
'id':'[{$_gtmOrder->oxorder__oxordernr->value}]',
|
|
||||||
'affiliation':'[{$oxcmp_shop->oxshops__oxname->value}]',
|
|
||||||
'revenue':'[{$_gtmOrder->oxorder__oxtotalordersum->value}]',
|
|
||||||
'tax':'[{math equation="x+y" x=$_gtmOrder->oxorder__oxartvatprice1->value y=$_gtmOrder->oxorder__oxartvatprice2->value }]',
|
|
||||||
'shipping':'[{$_gtmOrder->oxorder__oxdelcost->value}]'
|
|
||||||
/*'coupon':'CANO25' //if a coupon code was used for this order*/
|
|
||||||
},
|
|
||||||
'products':[
|
|
||||||
[{foreach key="_index" from=$_gtmBasket->getContents() item="_gtmBasketitem" name="gtmTransactionProducts"}]
|
|
||||||
[{assign var="_price" value=$_gtmBasketitem->getPrice()}]
|
|
||||||
{
|
|
||||||
'id':'[{$_gtmArticles[$_index]->oxarticles__oxartnum->value}]',
|
|
||||||
'name': '[{$_gtmArticles[$_index]->oxarticles__oxtitle->value}]',
|
|
||||||
'variant':'[{$_gtmArticles[$_index]->oxarticles__oxvarselect->value}]',
|
|
||||||
'price': [{$_price->getPrice()}],
|
|
||||||
'item_price': [{$_price->getPrice()}],
|
|
||||||
'quantity':[{$_gtmBasketitem->getAmount()}],
|
|
||||||
'position':[{$smarty.foreach.gtmTransactionProducts.iteration}]
|
|
||||||
}[{if !$smarty.foreach.gtmTransactionProducts.last}],[{/if}]
|
|
||||||
[{/foreach}]
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
[{$smarty.block.parent}]
|
|
21
CHANGELOG.md
Normal file
21
CHANGELOG.md
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
# Changelog
|
||||||
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [1.2](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.1...1.2) - 2023-02-01
|
||||||
|
### Added
|
||||||
|
- own cookie-check-handler
|
||||||
|
|
||||||
|
## [1.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.0...1.1) - 2023-01-27
|
||||||
|
### Added
|
||||||
|
- block section for add_to_basket js
|
||||||
|
- template block order positions
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- switched price formatting
|
||||||
|
|
||||||
|
## [1.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.0...1.0) - 2023-01-20
|
||||||
|
### Added
|
||||||
|
- publication of app features
|
51
Docs/README.md
Normal file
51
Docs/README.md
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
## Technische Doku
|
||||||
|
### GA4 Events / Customizing
|
||||||
|
FĂĽr alle implementierten GA4 Events existieren Templates unter `source/modules/d3/googleanalytics4/Application/views/ga4/`, dabei entspricht der Dateiname dem Eventnamen in GA4.
|
||||||
|
Die Einbindung dieser Event-Templates erfolgt über TPL-Blöcke unter `source/modules/d3/googleanalytics4/Application/views/blocks/`.
|
||||||
|
*Hinweis: nicht alle templates sind bereits gefĂĽllt. WĂĽnschen Sie die Implementierung eines unausgefĂĽllten templates?
|
||||||
|
Kommen Sie auf uns zu unter https://www.d3data.de/
|
||||||
|
|
||||||
|
### Blöcke
|
||||||
|
Für den geregelten Ablauf sind folgende Blöcke nötig:
|
||||||
|
- Suchergebnisse
|
||||||
|
- Blockname: search_results
|
||||||
|
- Datei: page/search/search.tpl
|
||||||
|
- GA4 Event: view_search_results
|
||||||
|
- Artikelliste
|
||||||
|
- Blockname: d3Ga4_view_item_list (muss hinzugefĂĽgt werden)
|
||||||
|
- Datei: widget/product/list.tpl
|
||||||
|
- GA4 Event: view_item_list
|
||||||
|
- Detailseite
|
||||||
|
- Blockname: details_productmain_title
|
||||||
|
- Datei: page/details/inc/productmain.tpl
|
||||||
|
- GA4 Event: view_item
|
||||||
|
- dem WK hinzufĂĽgen (button)
|
||||||
|
- Blockname: details_productmain_tobasket
|
||||||
|
- Datei: page/details/inc/productmain.tpl
|
||||||
|
- GA4 Event: add_to_cart
|
||||||
|
- Warenkorb
|
||||||
|
- Blockname: checkout_basket_main
|
||||||
|
- Datei: page/checkout/basket.tpl
|
||||||
|
- GA4 Event: view_cart
|
||||||
|
- abgeschlossener Kauf
|
||||||
|
- Blockname: checkout_thankyou_main
|
||||||
|
- Datei: page/checkout/thankyou.tpl
|
||||||
|
- GA4 Event: purchase
|
||||||
|
|
||||||
|
### VerfĂĽgbare Datalayer Variablen
|
||||||
|
FĂĽr die einfachste Ăśbersicht der enthaltenen Daten empfehle ich den Vorschau-Modus vom Google Tag Manager.
|
||||||
|
|
||||||
|
Bei jedem Seitenaufruf wird die Datenschicht mit einigen wenigen Infos erstellt, die man zum reinen Erfassen der Seitenaufrufe benötigt:
|
||||||
|
+ **page.type** - Seitentyp: default / cms / product / listing / checkout (an google analytics angelehnt)
|
||||||
|
+ **page.title** - Seitentitel (auĂźer Startseite, sie hat keinen Titel)
|
||||||
|
+ **page.cl** - OXID Controller Klasse (start, search, etc)
|
||||||
|
+ **userid** - oxId vom Benutzer bzw `false` falls nicht eingeloggt
|
||||||
|
+ **sessionid** - session iD
|
||||||
|
|
||||||
|
Alle fĂĽr Ecommerce Tracking relevanten Daten werden mit speziellen Ecommerce Events in die Datenschicht eingefĂĽgt.
|
||||||
|
|
||||||
|
### Cookie-Handling
|
||||||
|
Sie nutzen einen eigenen, als Modul im Shop installierten, Cookie-manager?
|
||||||
|
Dann tragen Sie in den Folgeeinstellungen unter "Cookie Manager Einstellungen",
|
||||||
|
die Cookie-ID des zugehörigen Cookies ein. Und aktivieren Sie diese Weiche,
|
||||||
|
indem Sie den Haken bei "Eigenen Cookie Manager nutzen?" setzen.
|
18
IntelliSenseHelper.php
Normal file
18
IntelliSenseHelper.php
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This Software is the property of Data Development and is protected
|
||||||
|
* by copyright law - it is NOT Freeware.
|
||||||
|
* Any unauthorized use of this software without a valid license
|
||||||
|
* is a violation of the license agreement and will be prosecuted by
|
||||||
|
* civil and criminal law.
|
||||||
|
* http://www.shopmodule.com
|
||||||
|
*
|
||||||
|
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
|
||||||
|
* @author D3 Data Development - Daniel Seifert <support@shopmodule.com>
|
||||||
|
* @link http://www.oxidmodule.com
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace D3\GoogleAnalytics4\Modules\Core{
|
||||||
|
class ViewConfig_parent extends \OxidEsales\Eshop\Core\ViewConfig{}
|
||||||
|
}
|
105
Modules/Core/ViewConfig.php
Normal file
105
Modules/Core/ViewConfig.php
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* This Software is the property of Data Development and is protected
|
||||||
|
* by copyright law - it is NOT Freeware.
|
||||||
|
* Any unauthorized use of this software without a valid license
|
||||||
|
* is a violation of the license agreement and will be prosecuted by
|
||||||
|
* civil and criminal law.
|
||||||
|
* http://www.shopmodule.com
|
||||||
|
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
|
||||||
|
* @author D3 Data Development - Daniel Seifert <support@shopmodule.com>
|
||||||
|
* @link http://www.oxidmodule.com
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace D3\GoogleAnalytics4\Modules\Core;
|
||||||
|
|
||||||
|
use OxidEsales\Eshop\Application\Controller\FrontendController;
|
||||||
|
use OxidEsales\Eshop\Core\Registry;
|
||||||
|
|
||||||
|
class ViewConfig extends ViewConfig_parent
|
||||||
|
{
|
||||||
|
|
||||||
|
// Google Tag Manager Container ID
|
||||||
|
private $sContainerId = null;
|
||||||
|
|
||||||
|
public function getGtmContainerId()
|
||||||
|
{
|
||||||
|
if ($this->sContainerId === null)
|
||||||
|
{
|
||||||
|
|
||||||
|
$this->sContainerId = $this->getConfig()->getConfigParam('d3_gtm_sContainerID');
|
||||||
|
}
|
||||||
|
return $this->sContainerId;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param $sCookieID
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function D3blAcceptedCookie($sCookieID)
|
||||||
|
{
|
||||||
|
$oSession = Registry::getSession();
|
||||||
|
$aCookies = $oSession->getVariable("aCookieSel");
|
||||||
|
|
||||||
|
if (!is_null($aCookies) && is_array($aCookies) && array_key_exists($sCookieID, $aCookies) && $aCookies[$sCookieID] == "1") {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private $blGA4enabled = null;
|
||||||
|
|
||||||
|
public function isGA4enabled()
|
||||||
|
{
|
||||||
|
if ($this->blGA4enabled === null)
|
||||||
|
{
|
||||||
|
$this->sContainerId = $this->getConfig()->getConfigParam('d3_gtm_blEnableGA4');
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->blGA4enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getGtmDataLayer()
|
||||||
|
{
|
||||||
|
if (!$this->getGtmContainerId()) return "[]";
|
||||||
|
|
||||||
|
$oConfig = Registry::getConfig();
|
||||||
|
$oView = $oConfig->getTopActiveView();
|
||||||
|
/** @var FrontendController $oShop */
|
||||||
|
|
||||||
|
$oUser = $oConfig->getUser();
|
||||||
|
|
||||||
|
$cl = $this->getTopActionClassName();
|
||||||
|
$aPageTypes = [
|
||||||
|
"content" => "cms",
|
||||||
|
"details" => "product",
|
||||||
|
"alist" => "listing",
|
||||||
|
"search" => "listing",
|
||||||
|
"basket" => "checkout",
|
||||||
|
"user" => "checkout",
|
||||||
|
"payment" => "checkout",
|
||||||
|
"order" => "checkout",
|
||||||
|
"thankyou" => "checkout",
|
||||||
|
];
|
||||||
|
|
||||||
|
$dataLayer = [
|
||||||
|
'page' => [
|
||||||
|
'type' => $aPageTypes[$cl] ?? "unknown",
|
||||||
|
'title' => $oView->getTitle(),
|
||||||
|
'cl' => $cl,
|
||||||
|
],
|
||||||
|
'userid' => ($oUser ? $oUser->getId() : false),
|
||||||
|
'sessionid' => session_id() ?? false,
|
||||||
|
//'httpref' => $_SERVER["HTTP_REFERER"] ?? "unknown"
|
||||||
|
];
|
||||||
|
|
||||||
|
return json_encode([$dataLayer], JSON_PRETTY_PRINT);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function isPromotionList($listId)
|
||||||
|
{
|
||||||
|
$oConfig = Registry::getConfig();
|
||||||
|
$aPromotionListIds = $oConfig->getConfigParam("") ?? ['bargainItems', 'newItems', 'topBox', 'alsoBought', 'accessories', 'cross'];
|
||||||
|
}
|
||||||
|
}
|
114
README.md
114
README.md
@ -1,61 +1,81 @@
|
|||||||
# [vt] Google Tag Manager
|
[](README.md)
|
||||||
Google Tag Manager integration for OXID eShop v6.2 und höher
|
|
||||||
module version 0.2.0 ( 2018-12-04 )
|
|
||||||
|
|
||||||
# Installation
|
#  Google-Analytics 4 fĂĽr OXID eShop
|
||||||
* ``composer require vanilla-thunder/oxid-module-gtm --no-update``
|
|
||||||
|
|
||||||
* Inhalt von "copy_this" in den Shop hochladen
|
Dieses Modul bietet die Möglichkeit in Ihrem OXID eShop (6.x) die neue 'Property' Google Analytics 4 (GA4) von Google
|
||||||
* Modul aktivieren und Moduleinstellungen konfigurieren
|
zu integrieren.
|
||||||
|
Hierfür stehen Ihnen verschiedene 'templates' zur verfügung, mit denen Sie bestimmte Events tracken können.
|
||||||
|
Beispiele dafĂĽr sind: view_item, add_to_basket, purchase, ...
|
||||||
|
|
||||||
# Tag Manager konfigurieren:
|
WeiterfĂĽhrende Informationen: https://developers.google.com/analytics/devguides/collection/ga4
|
||||||
+ https://support.google.com/tagmanager/answer/9442095
|
|
||||||
|
|
||||||
|
## Inhaltsverzeichnis
|
||||||
|
|
||||||
|
- [Installation](#installation)
|
||||||
|
- [Verwendung](#verwendung)
|
||||||
|
- [Changelog](#changelog)
|
||||||
|
- [Lizenz](#lizenz)
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
Dieses Paket erfordert einen mit Composer installierten OXID eShop in einer in der [composer.json](composer.json) definierten Version.
|
||||||
|
|
||||||
Alle drei unterstĂĽtzten Tag Manager werden mit Daten aus einer gemeinsamen Datenschicht (dataLayer) gefĂĽttert.
|
Ă–ffnen Sie eine Kommandozeile und navigieren Sie zum Stammverzeichnis des Shops (Elternverzeichnis von source und vendor). FĂĽhren Sie den folgenden Befehl aus. Passen Sie die Pfadangaben an Ihre Installationsumgebung an.
|
||||||
FĂĽr die einfachste Ăśbersicht der enthaltenen Daten empfehle ich den Vorschau-Modus vom Google Tag Manager.
|
|
||||||
|
|
||||||
Bei jedem Seitenaufruf wird die Datenschicht mit einigen wenigen Infos erstellt, die man zum reinen Erfassen der Seitenaufrufe benötigt:
|
```bash
|
||||||
+ **page.type** - Seitentyp: default / cms / product / listing / checkout (an google analytics angelehnt)
|
php composer require d3/google-analytics4:^1
|
||||||
+ **page.title** - Seitentitel (auĂźer Startseite, sie hat keinen Titel. Danke OXID...)
|
```
|
||||||
+ **page.class** - OXID Controller Klasse (start, search, etc)
|
|
||||||
+ **user.country** - Land des Benutzers, sofern dieser angemeldet ist.
|
|
||||||
+ **user.httpref** - http referrer
|
|
||||||
|
|
||||||
Alle fĂĽr Ecommerce Tracking releavanten Daten werden mit speziellen Ecommerce Events in die Datenschicht eingefĂĽgt.
|
|
||||||
Hier ist ein Beispiel fĂĽr die Einrichtung von Enhanced Ecomemrce Tracking ĂĽber Google Tag Manager:
|
|
||||||
|
|
||||||
**"EE-Trigger" fĂĽr Ecomemrce-Tags (Beispiel fĂĽr Google Tag Manager):**
|
|
||||||
+ Triggertyp: Benutzerdefiniertes Ereignis
|
|
||||||
+ Ereignisname: ``ee\..*``
|
|
||||||
+ Übereinstimmung mit regulärem Ausdruck verwenden
|
|
||||||
+ Diesen Trigger auslösen bei: Alle benutzerdefinierten Ereignisse
|
|
||||||
|
|
||||||
**"EE-Tag" fĂĽr Google Analytics Enhanced Ecommerce:**
|
Sofern nötig, bestätigen Sie bitte, dass Sie `package-name` erlauben, Code auszuführen.
|
||||||
+ Tag-Typ: Google Analytics - Universal Analytics
|
|
||||||
+ Tracking-Typ: Ereignis
|
|
||||||
+ Aktion: {{Event}}
|
|
||||||
+ Label: {{Event Label}}
|
|
||||||
+ Trigger : EE-Trigger
|
|
||||||
|
|
||||||
Eine Video-Anleitung mit der kompletten Google Analytics Einrichtung folgt in KĂĽrze.
|
Aktivieren Sie das Modul im Shopadmin unter "Erweiterungen -> Module".
|
||||||
|
|
||||||
### Google Analytics 4 Referenz
|
## Verwendung
|
||||||
https://developers.google.com/tag-manager/ecommerce-ga4
|
### Grundfunktionalität
|
||||||
|
Nach erfolgreicher Installation finden Sie in Ihrem Shop-Admin unter "Erweiterungen > Module"
|
||||||
|
den Eintrag 'Google Analytics 4'.
|
||||||
|
Aktivieren Sie dieses Modul, um die Funktionalitäten nutzen zu können.
|
||||||
|
|
||||||
|
Navigieren Sie danach zum Reiter 'Einstell.'.
|
||||||
|
Tragen Sie die nötige sog. 'Container ID' ein. Diese sieht in etwa so aus: 'GTM-W34LLOP'.
|
||||||
|
|
||||||
### LICENSE AGREEMENT
|
Aktivieren Sie GA4 selbst, indem Sie dieses direkt darunter anhaken.
|
||||||
[bla] tag-manager
|
|
||||||
Copyright (C) 2018 bestlife AG
|
### Technische Infos
|
||||||
info: oxid@bestlife.ag
|
- Navigieren Sie bitte zur [technischen Doku](./Docs/README.md)
|
||||||
|
|
||||||
This program is free software;
|
---
|
||||||
you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation;
|
|
||||||
either version 3 of the License, or (at your option) any later version.
|
## Changelog
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
Siehe [CHANGELOG](CHANGELOG.md) fĂĽr weitere Informationen.
|
||||||
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>
|
## Beitragen
|
||||||
|
|
||||||
|
Wenn Sie einen Verbesserungsvorschlag haben, legen Sie einen Fork des Repositories an und erstellen Sie einen Pull Request. Alternativ können Sie einfach ein Issue erstellen. Fügen Sie das Projekt zu Ihren Favoriten hinzu. Vielen Dank.
|
||||||
|
|
||||||
|
- Erstellen Sie einen Fork des Projekts
|
||||||
|
- Erstellen Sie einen Feature Branch (git checkout -b feature/AmazingFeature)
|
||||||
|
- Fügen Sie Ihre Änderungen hinzu (git commit -m 'Add some AmazingFeature')
|
||||||
|
- Ăśbertragen Sie den Branch (git push origin feature/AmazingFeature)
|
||||||
|
- Ă–ffnen Sie einen Pull Request
|
||||||
|
|
||||||
|
## Lizenz
|
||||||
|
(Stand: 06.05.2021)
|
||||||
|
|
||||||
|
Vertrieben unter der GPLv3 Lizenz.
|
||||||
|
|
||||||
|
```
|
||||||
|
Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
|
||||||
|
|
||||||
|
Diese Software wird unter der GNU GENERAL PUBLIC LICENSE Version 3 vertrieben.
|
||||||
|
```
|
||||||
|
|
||||||
|
Die vollständigen Copyright- und Lizenzinformationen entnehmen Sie bitte der [LICENSE](LICENSE)-Datei, die mit diesem Quellcode verteilt wurde.
|
||||||
|
|
||||||
|
## Credits
|
||||||
|
Zu diesem Modul haben beigetragen:
|
||||||
|
|
||||||
|
- [Marat Bedoev](https://github.com/vanilla-thunder)
|
||||||
|
|
||||||
|
Vielen Dank.
|
@ -1,8 +1,19 @@
|
|||||||
{
|
{
|
||||||
"name": "vanilla-thunder/oxid-module-gtm",
|
"name": "d3/google-analytics4",
|
||||||
"description": "Google Tag Manager with new Google Analytics 4 for OXID eShop v6.2+<br/>more about GA4: <a href='https://developers.google.com/tag-manager/ecommerce-ga4' target='_blank'>Ecommerce (GA4) Developer Guide</a>",
|
"description": "Google Tag Manager with new Google Analytics 4 for OXID eShop v6",
|
||||||
"type": "oxideshop-module",
|
"type": "oxideshop-module",
|
||||||
"homepage": "https://github.com/vanilla-thunder/oxid-module-gtm",
|
"keywords": [
|
||||||
|
"oxid",
|
||||||
|
"modules",
|
||||||
|
"eShop",
|
||||||
|
"d3",
|
||||||
|
"google",
|
||||||
|
"ga4",
|
||||||
|
"googleanalytics",
|
||||||
|
"gtm",
|
||||||
|
"configuration"
|
||||||
|
],
|
||||||
|
"homepage": "https://www.d3data.de",
|
||||||
"license": [
|
"license": [
|
||||||
"GPL-3.0"
|
"GPL-3.0"
|
||||||
],
|
],
|
||||||
@ -10,21 +21,36 @@
|
|||||||
{
|
{
|
||||||
"name": "Marat Bedoev",
|
"name": "Marat Bedoev",
|
||||||
"email": "hello@mb-dev.pro"
|
"email": "hello@mb-dev.pro"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "D3 Data Development (Inh. Thomas Dartsch)",
|
||||||
|
"email": "info@shopmodule.com",
|
||||||
|
"homepage": "https://www.d3data.de"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"support": {
|
||||||
|
"email": "support@shopmodule.com"
|
||||||
|
},
|
||||||
"extra": {
|
"extra": {
|
||||||
"oxideshop": {
|
"oxideshop": {
|
||||||
"target-directory": "vt/GoogleTagManager"
|
"blacklist-filter": [
|
||||||
|
"*.md",
|
||||||
|
"composer.json",
|
||||||
|
".php-cs-fixer.php",
|
||||||
|
"*.xml",
|
||||||
|
"*.neon"
|
||||||
|
],
|
||||||
|
"target-directory": "d3/googleanalytics4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.1",
|
"php": ">=7.1",
|
||||||
"oxid-esales/oxideshop-ce": "^v6.2",
|
"oxid-esales/oxideshop-ce": "v6.0 - 6.3",
|
||||||
"google/apiclient":" ^2.0"
|
"google/apiclient":" ^2.0"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"VanillaThunder\\": "../../../source/modules/vt"
|
"D3\\GoogleAnalytics4\\": "../../../source/modules/d3/googleanalytics4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
215
metadata.php
Normal file → Executable file
215
metadata.php
Normal file → Executable file
@ -1,156 +1,169 @@
|
|||||||
<?php
|
<?php
|
||||||
/**
|
use D3\GoogleAnalytics4\Modules\Core\ViewConfig;
|
||||||
* vanilla-thunder/oxid-module-gtm
|
use OxidEsales\Eshop\Core\ViewConfig as OEViewConfig;
|
||||||
* Google Tag Manager Integration for OXID eShop v6.2+
|
|
||||||
*
|
|
||||||
* This program is free software;
|
|
||||||
* you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation;
|
|
||||||
* either version 3 of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
||||||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
||||||
* You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>
|
|
||||||
**/
|
|
||||||
|
|
||||||
$sMetadataVersion = '2.1';
|
$sMetadataVersion = '2.1';
|
||||||
$aModule = [
|
$aModule = [
|
||||||
'id' => 'vt-gtm',
|
'id' => 'd3googleanalytics4',
|
||||||
'title' => '[vt] Google Tag Manager',
|
'title' => 'Google Analytics 4',
|
||||||
'description' => 'Google Tag Manager Integration for OXID eShop v6.2+',
|
'description' => "Dieses Modul bietet die Möglichkeit in Ihrem OXID eShop (6.x) die neue 'Property'
|
||||||
'thumbnail' => 'thumbnail.png',
|
Google Analytics 4 (GA4) von Google zu integrieren.<br>
|
||||||
'version' => '0.5.0 ( 2021-07-17 )',
|
HierfĂĽr stehen Ihnen verschiedene 'templates' zur verfĂĽgung,
|
||||||
'author' => 'Marat Bedoev',
|
mit denen Sie bestimmte Events tracken können.<br>
|
||||||
'email' => openssl_decrypt("Az6pE7kPbtnTzjHlPhPCa4ktJLphZ/w9gKgo5vA//p4=", str_rot13("nrf-128-pop"), str_rot13("gvalzpr")),
|
Beispiele dafĂĽr sind: view_item, add_to_basket, purchase, ...<br><br>
|
||||||
'url' => 'https://github.com/vanilla-thunder/oxid-module-gtm',
|
Die Integration und Verbindung zu Google wird mithilfe des gtag (Google Tag Manager) realisiert.<br><br>
|
||||||
'extend' => [
|
WeiterfĂĽhrende Informationen: https://developers.google.com/analytics/devguides/collection/ga4<br>
|
||||||
\OxidEsales\Eshop\Core\ViewConfig::class => VanillaThunder\GoogleTagManager\Application\Extend\ViewConfig::class
|
<hr>
|
||||||
|
Die Entwicklung basiert auf einem Fork von Marat Bedoev - <a href='https://github.com/vanilla-thunder/oxid-module-gtm'>Github-Link</a>
|
||||||
|
",
|
||||||
|
'thumbnail' => 'thumbnail.png',
|
||||||
|
'version' => '1.2.0',
|
||||||
|
'author' => 'Data Development (Inh.: Thomas Dartsch)',
|
||||||
|
'email' => 'support@shopmodule.com',
|
||||||
|
'url' => 'https://www.oxidmodule.com/',
|
||||||
|
'extend' => [
|
||||||
|
OEViewConfig::class => ViewConfig::class
|
||||||
],
|
],
|
||||||
'templates' => [
|
'templates' => [
|
||||||
// separate ee-event templates for easy integration
|
// GA4 events
|
||||||
//'ga4_add_to_cart.tpl' => 'vt/GoogleTagManager/Application/views/ga4/add_to_cart.tpl',
|
'ga4_add_payment_info.tpl' => 'd3/googleanalytics4/Application/views/ga4/add_payment_info.tpl',
|
||||||
//'ga4_view_item.tpl' => 'vt/GoogleTagManager/Application/views/ga4/view_item.tpl',
|
'add_shipping_info.tpl' => 'd3/googleanalytics4/Application/views/ga4/add_shipping_info.tpl',
|
||||||
//'ga4_view_item_list.tpl' => 'vt/GoogleTagManager/Application/views/ga4/view_item_list.tpl',
|
'ga4_add_to_cart.tpl' => 'd3/googleanalytics4/Application/views/ga4/add_to_cart.tpl',
|
||||||
'gtm_ua_impression' => 'vt/GoogleTagManager/Application/views/ua/impression.tpl'
|
'ga4_begin_checkout.tpl' => 'd3/googleanalytics4/Application/views/ga4/begin_checkout.tpl',
|
||||||
/*
|
'ga4_generate_lead.tpl' => 'd3/googleanalytics4/Application/views/ga4/generate_lead.tpl',
|
||||||
|
'ga4_login.tpl' => 'd3/googleanalytics4/Application/views/ga4/login.tpl',
|
||||||
'gtm_view_promotion.tpl' => 'vt/GoogleTagManager/Application/views/view_promotion.tpl',
|
'ga4_purchase.tpl' => 'd3/googleanalytics4/Application/views/ga4/purchase.tpl',
|
||||||
'gtm_select_promotion.tpl' => 'vt/GoogleTagManager/Application/views/select_promotion.tpl',
|
'ga4_remove_from_cart.tpl' => 'd3/googleanalytics4/Application/views/ga4/remove_from_cart.tpl',
|
||||||
'gtm_begin_checkout.tpl' => 'vt/GoogleTagManager/Application/views/begin_checkout.tpl',
|
'ga4_search.tpl' => 'd3/googleanalytics4/Application/views/ga4/search.tpl',
|
||||||
*/
|
'ga4_select_content.tpl' => 'd3/googleanalytics4/Application/views/ga4/select_content.tpl',
|
||||||
|
'ga4_select_item.tpl' => 'd3/googleanalytics4/Application/views/ga4/select_item.tpl',
|
||||||
|
'ga4_select_promotion.tpl' => 'd3/googleanalytics4/Application/views/ga4/select_promotion.tpl',
|
||||||
|
'ga4_sign_up.tpl' => 'd3/googleanalytics4/Application/views/ga4/sign_up.tpl',
|
||||||
|
'ga4_view_cart.tpl' => 'd3/googleanalytics4/Application/views/ga4/view_cart.tpl',
|
||||||
|
'ga4_view_item.tpl' => 'd3/googleanalytics4/Application/views/ga4/view_item.tpl',
|
||||||
|
'ga4_view_item_list.tpl' => 'd3/googleanalytics4/Application/views/ga4/view_item_list.tpl',
|
||||||
|
'ga4_view_promotion.tpl' => 'd3/googleanalytics4/Application/views/ga4/view_promotion.tpl',
|
||||||
],
|
],
|
||||||
'blocks' => [
|
'blocks' => [
|
||||||
// tag manager js
|
// tag manager js
|
||||||
[
|
[
|
||||||
'template' => 'layout/base.tpl',
|
'template' => 'layout/base.tpl',
|
||||||
'block' => 'head_meta_robots',
|
'block' => 'head_meta_robots',
|
||||||
'file' => '/Application/views/blocks/_gtm_js.tpl'
|
'file' => '/Application/views/blocks/_gtm_js.tpl'
|
||||||
],
|
],
|
||||||
// tag manager nojs
|
// tag manager nojs
|
||||||
[
|
[
|
||||||
'template' => 'layout/base.tpl',
|
'template' => 'layout/base.tpl',
|
||||||
'block' => 'theme_svg_icons',
|
'block' => 'theme_svg_icons',
|
||||||
'file' => '/Application/views/blocks/_gtm_nojs.tpl'
|
'file' => '/Application/views/blocks/_gtm_nojs.tpl'
|
||||||
],
|
],
|
||||||
// add to cart
|
// widget_product_list
|
||||||
[
|
[
|
||||||
'template' => 'layout/header.tpl',
|
'template' => 'widget/product/list.tpl',
|
||||||
'block' => 'header_main',
|
'block' => 'widget_product_list',
|
||||||
'file' => '/Application/views/blocks/add_to_cart.tpl'
|
'file' => '/Application/views/blocks/widget_product_list.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
|
// details
|
||||||
[
|
[
|
||||||
'template' => 'page/details/inc/productmain.tpl',
|
'template' => 'page/details/inc/productmain.tpl',
|
||||||
'block' => 'details_productmain_title',
|
'block' => 'details_productmain_title',
|
||||||
'file' => '/Application/views/blocks/detail.tpl'
|
'file' => '/Application/views/blocks/detail.tpl',
|
||||||
|
'position' => 150
|
||||||
],
|
],
|
||||||
// checkout
|
// checkout
|
||||||
[
|
[
|
||||||
'template' => 'page/checkout/basket.tpl',
|
'template' => 'page/checkout/basket.tpl',
|
||||||
'block' => 'checkout_basket_main',
|
'block' => 'checkout_basket_main',
|
||||||
'file' => '/Application/views/blocks/checkout_s1.tpl'
|
'file' => '/Application/views/blocks/checkout_s1.tpl'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'template' => 'form/user_checkout_change.tpl',
|
'template' => 'form/user_checkout_change.tpl',
|
||||||
'block' => 'user_checkout_change',
|
'block' => 'user_checkout_change',
|
||||||
'file' => '/Application/views/blocks/checkout_s2.tpl'
|
'file' => '/Application/views/blocks/checkout_s2.tpl'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'template' => 'form/user_checkout_register.tpl',
|
'template' => 'form/user_checkout_register.tpl',
|
||||||
'block' => 'user_checkout_register',
|
'block' => 'user_checkout_register',
|
||||||
'file' => '/Application/views/blocks/checkout_s2.tpl'
|
'file' => '/Application/views/blocks/checkout_s2.tpl'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'template' => 'form/user_checkout_noregister.tpl',
|
'template' => 'form/user_checkout_noregister.tpl',
|
||||||
'block' => 'user_checkout_noregister',
|
'block' => 'user_checkout_noregister',
|
||||||
'file' => '/Application/views/blocks/checkout_s2.tpl'
|
'file' => '/Application/views/blocks/checkout_s2.tpl'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'template' => 'page/checkout/payment.tpl',
|
'template' => 'page/checkout/payment.tpl',
|
||||||
'block' => 'checkout_payment_main',
|
'block' => 'checkout_payment_main',
|
||||||
'file' => '/Application/views/blocks/checkout_s3.tpl'
|
'file' => '/Application/views/blocks/checkout_s3.tpl'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'template' => 'page/checkout/order.tpl',
|
'template' => 'page/checkout/order.tpl',
|
||||||
'block' => 'checkout_order_main',
|
'block' => 'checkout_order_main',
|
||||||
'file' => '/Application/views/blocks/checkout_s4.tpl'
|
'file' => '/Application/views/blocks/checkout_s4.tpl'
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'template' => 'page/checkout/thankyou.tpl',
|
'template' => 'page/checkout/thankyou.tpl',
|
||||||
'block' => 'checkout_thankyou_main',
|
'block' => 'checkout_thankyou_main',
|
||||||
'file' => '/Application/views/blocks/checkout_s5.tpl'
|
'file' => '/Application/views/blocks/checkout_s5.tpl'
|
||||||
|
],
|
||||||
|
// Lists
|
||||||
|
// view_item_list
|
||||||
|
[
|
||||||
|
'template' => 'widget/product/list.tpl',
|
||||||
|
'block' => 'd3Ga4_view_item_list',
|
||||||
|
'file' => '/Application/views/ga4/view_item_list.tpl',
|
||||||
|
'position' => 150
|
||||||
|
],
|
||||||
|
// view_search_result
|
||||||
|
[
|
||||||
|
'template' => 'page/search/search.tpl',
|
||||||
|
'block' => 'search_results',
|
||||||
|
'file' => '/Application/views/ga4/search.tpl',
|
||||||
|
'position' => 150
|
||||||
|
],
|
||||||
|
// add_to_cart
|
||||||
|
[
|
||||||
|
'template' => 'page/details/inc/productmain.tpl',
|
||||||
|
'block' => 'details_productmain_tobasket',
|
||||||
|
'file' => '/Application/views/ga4/add_to_cart.tpl',
|
||||||
|
'position' => 150
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
'settings' => [
|
'settings' => [
|
||||||
[
|
[
|
||||||
'group' => 'vt_gtm_settings',
|
'group' => 'd3_gtm_settings',
|
||||||
'name' => 'vt_gtm_containerid',
|
'name' => 'd3_gtm_sContainerID',
|
||||||
'type' => 'str',
|
'type' => 'str',
|
||||||
'value' => 'GTM-',
|
'value' => 'GTM-',
|
||||||
'position' => 0
|
'position' => 0
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'group' => 'vt_gtm_settings',
|
'group' => 'd3_gtm_settings',
|
||||||
'name' => 'vt_gtm_enable_ga4',
|
'name' => 'd3_gtm_blGA4enab',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'value' => true,
|
'value' => true,
|
||||||
'position' => 1
|
'position' => 1
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'group' => 'vt_gtm_settings',
|
'group' => 'd3_gtm_settings',
|
||||||
'name' => 'vt_gtm_enable_ua',
|
'name' => 'd3_gtm_blEnableDebug',
|
||||||
'type' => 'bool',
|
'type' => 'bool',
|
||||||
'value' => true,
|
'value' => false,
|
||||||
'position' => 2
|
'position' => 999
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'group' => 'vt_gtm_settings',
|
'group' => 'd3_gtm_settings_cookiemanager',
|
||||||
'name' => 'vt_gtm_mpapisecret',
|
'name' => 'd3_gtm_settings_hasOwnCookieManager',
|
||||||
'type' => 'str',
|
'type' => 'bool',
|
||||||
'value' => '',
|
'value' => false,
|
||||||
'position' => 3
|
'position' => 999
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'group' => 'vt_gtm_settings',
|
'group' => 'd3_gtm_settings_cookiemanager',
|
||||||
'name' => 'vt_gtm_promotionlistids',
|
'name' => 'd3_gtm_settings_cookieName',
|
||||||
'type' => 'arr',
|
'type' => 'str',
|
||||||
'value' => [],
|
'value' => 'example',
|
||||||
'position' => 4
|
'position' => 999
|
||||||
]
|
],
|
||||||
]
|
]
|
||||||
];
|
];
|
10
phpstan.neon
Normal file
10
phpstan.neon
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
parameters:
|
||||||
|
scanFiles:
|
||||||
|
- IntelliSenseHelper.php
|
||||||
|
- ../../oxid-esales/oxideshop-ce/source/oxfunctions.php
|
||||||
|
- ../../oxid-esales/oxideshop-ce/source/overridablefunctions.php
|
||||||
|
level: 9
|
||||||
|
phpVersion: 70100
|
||||||
|
checkMissingIterableValueType: false
|
||||||
|
ignoreErrors:
|
||||||
|
- '#Psr\\Container\\ContainerExceptionInterface is not subtype of Throwable#'
|
20
phpunit.xml
Normal file
20
phpunit.xml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
bootstrap="vendor/autoload.php"
|
||||||
|
convertErrorsToExceptions="true"
|
||||||
|
convertNoticesToExceptions="true"
|
||||||
|
convertWarningsToExceptions="true"
|
||||||
|
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
|
||||||
|
<coverage>
|
||||||
|
<include>
|
||||||
|
<directory suffix=".php">src</directory>
|
||||||
|
</include>
|
||||||
|
<report>
|
||||||
|
<clover outputFile="build/logs/clover.xml"/>
|
||||||
|
</report>
|
||||||
|
</coverage>
|
||||||
|
<testsuite name="myModule">
|
||||||
|
<directory>./Tests</directory>
|
||||||
|
</testsuite>
|
||||||
|
<logging/>
|
||||||
|
</phpunit>
|
BIN
thumbnail.png
Executable file
BIN
thumbnail.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 31 KiB |
Reference in New Issue
Block a user