Compare commits

..

17 Commits

Author SHA1 Message Date
8097ed01c6 Merge remote-tracking branch 'remotes/origin/rel_2.x' 2024-09-19 16:29:08 +02:00
96e5adbece Merge remote-tracking branch 'remotes/origin/rel_2.x' 2024-08-10 13:56:00 +02:00
8a643a0b8a Merge remote-tracking branch 'remotes/origin/rel_2.x' 2024-03-08 10:10:27 +01:00
7d23204841 Merge remote-tracking branch 'remotes/origin/rel_1.x' 2024-03-08 09:49:12 +01:00
c7d3671265 [Bump] Changelog && Metadata 2024-01-25 14:50:44 +01:00
3621ca606a [Fix] missing Component-ArticleDetails extension; missing ManufacturerList-Extension 2024-01-25 14:49:32 +01:00
e3f4bd16c9 Merge remote-tracking branch 'remotes/origin/rel_2.x' 2024-01-03 13:49:08 +01:00
42618fef79 Merge remote-tracking branch 'remotes/origin/rel_2.x'
# Conflicts:
#	Modules/Core/ViewConfig.php
2023-09-13 16:18:43 +02:00
f02c40cfb7 Merge remote-tracking branch 'remotes/origin/rel_1.x'
# Conflicts:
#	Application/views/admin/de/module_options.php
#	Application/views/ga4/view_item_list.tpl
#	CHANGELOG.md
#	Docs/README.md
#	IntelliSenseHelper.php
#	Modules/Core/ViewConfig.php
#	metadata.php
2023-09-13 16:13:03 +02:00
154147b8d8 Merge remote-tracking branch 'remotes/origin/rel_2.x' 2023-09-07 15:22:13 +02:00
43cdc7e8ae Merge remote-tracking branch 'remotes/origin/rel_2.x' 2023-08-02 11:57:26 +02:00
461f7f15da Merge remote-tracking branch 'remotes/origin/rel_1.x'
# Conflicts:
#	Application/views/admin/de/module_options.php
#	Application/views/ga4/view_item_list.tpl
#	CHANGELOG.md
#	Modules/Core/ViewConfig.php
#	composer.json
#	metadata.php
2023-06-27 10:03:51 +02:00
4f8fa7cdc9 Merge remote-tracking branch 'remotes/origin/rel_2.x'
# Conflicts:
#	CHANGELOG.md
2023-06-27 09:59:00 +02:00
7266416fe4 Merge remote-tracking branch 'remotes/origin/rel_2.x'
# Conflicts:
#	metadata.php
2023-06-19 15:25:00 +02:00
389d4f44ed Merge remote-tracking branch 'remotes/origin/rel_1.x'
# Conflicts:
#	CHANGELOG.md
#	metadata.php
2023-06-19 15:23:42 +02:00
41d6e94fa7 Merge remote-tracking branch 'remotes/origin/rel_2.x' 2023-05-31 14:55:26 +02:00
b8e2aeaa58 Merge remote-tracking branch 'remotes/origin/rel_1.x'
# Conflicts:
#	Application/views/admin/de/module_options.php
#	Application/views/ga4/view_item_list.tpl
#	CHANGELOG.md
#	Modules/Core/ViewConfig.php
#	metadata.php
2023-05-31 14:51:07 +02:00
105 changed files with 565 additions and 2065 deletions

View File

@ -1,15 +1,13 @@
<?php <?php
$finder = PhpCsFixer\Finder::create() $finder = PhpCsFixer\Finder::create()
->in(__DIR__) ->in(__DIR__)
; ;
$config = new PhpCsFixer\Config(); $config = new PhpCsFixer\Config();
return $config->setRules([ return $config->setRules([
'@PHP81Migration' => true, '@PHP73Migration' => true,
'@PSR12' => true, '@PSR12' => true
'php_unit_test_class_requires_covers' => true, ])
'doctrine_annotation_indentation' => true, ->setFinder($finder)
]) ;
->setFinder($finder)
;

View File

@ -12,4 +12,4 @@ class d3GtmStartWidget extends \OxidEsales\Eshop\Application\Component\Widget\Wi
return ''; return '';
} }
} }

View File

@ -7,35 +7,22 @@ namespace D3\GoogleAnalytics4\Application\Controller\Admin;
use D3\GoogleAnalytics4\Application\Model\Constants; use D3\GoogleAnalytics4\Application\Model\Constants;
use D3\GoogleAnalytics4\Application\Model\ManagerHandler; use D3\GoogleAnalytics4\Application\Model\ManagerHandler;
use D3\GoogleAnalytics4\Application\Model\ManagerTypes; use D3\GoogleAnalytics4\Application\Model\ManagerTypes;
use OxidEsales\Eshop\Application\Controller\Admin\ModuleConfiguration;
use OxidEsales\Eshop\Core\Module\Module;
use OxidEsales\Eshop\Core\Registry; use OxidEsales\Eshop\Core\Registry;
use OxidEsales\Eshop\Core\Str;
use OxidEsales\Eshop\Core\ViewConfig; use OxidEsales\Eshop\Core\ViewConfig;
class GA4AdminUserInterface_main extends \OxidEsales\Eshop\Application\Controller\Admin\AdminDetailsController class GA4AdminUserInterface_main extends \OxidEsales\Eshop\Application\Controller\Admin\AdminDetailsController
{ {
protected $_sThisTemplate = '@' . Constants::OXID_MODULE_ID . '/admin/d3ga4uimain'; protected $_sThisTemplate = 'ga4/admin/d3ga4uimain.tpl';
protected $GA4ModuleSettingNameArray = [];
public function render()
public function init()
{
parent::init();
/*if (empty($this->GA4ModuleSettingNameArray) or count($this->GA4ModuleSettingNameArray) === 0){
$this->GA4ModuleSettingNameArray = $this->d3GetModuleSettingNameArray();
}*/
}
public function render()
{ {
$return = parent::render(); $return = parent::render();
$this->addTplParam('d3ViewObject', $this); $this->addTplParam('d3ViewObject', $this);
$this->addTplParam('d3ViewConfObject', Registry::get(ViewConfig::class)); $this->addTplParam('d3ViewConfObject', Registry::get(ViewConfig::class));
$this->addTplParam('d3ManagerTypeArray', oxNew(ManagerTypes::class)->getManagerList()); $this->addTplParam('d3ManagerTypeArray', oxNew(ManagerTypes::class)->getManagerList());
$this->addTplParam('d3CurrentCMP', oxNew(ManagerHandler::class)->getActManager()); $this->addTplParam('d3CurrentCMP', oxNew(ManagerHandler::class)->getCurrManager());
return $return; return $return;
} }
@ -50,10 +37,8 @@ class GA4AdminUserInterface_main extends \OxidEsales\Eshop\Application\Controlle
'_blEnableDebug', '_blEnableDebug',
'_blEnableConsentMode', '_blEnableConsentMode',
'_blEnableOwnCookieManager', '_blEnableOwnCookieManager',
'_blUseRealCategoyTitles',
'_blEnableMeasurementCapabilities', '_blEnableMeasurementCapabilities',
'_blEnableUsercentricsConsentModeApi', '_blEnableUsercentricsConsentModeApi',
'_blViewItemAddVariants',
]; ];
foreach ($aCheckBoxParams as $checkBoxName){ foreach ($aCheckBoxParams as $checkBoxName){
@ -68,77 +53,33 @@ class GA4AdminUserInterface_main extends \OxidEsales\Eshop\Application\Controlle
} }
/** /**
* @return ModuleSettingService * @param array $aParams
* @throws \Psr\Container\ContainerExceptionInterface * @return void
* @throws \Psr\Container\NotFoundExceptionInterface
*/ */
public function d3GetModuleSettings() :ModuleSettingService
{
return ContainerFactory::getInstance()
->getContainer()
->get(ModuleSettingServiceInterface::class);
}
/**
* @param string $sSettingName
* @return bool
* @throws \Psr\Container\ContainerExceptionInterface
* @throws \Psr\Container\NotFoundExceptionInterface
*/
public function d3SettingExists(string $sSettingName) :bool
{
return $this->d3GetModuleSettings()
->exists(Constants::OXID_MODULE_ID.$sSettingName, Constants::OXID_MODULE_ID);
}
/**
* @param array $aParams
* @return void
*/
protected function d3SaveShopConfigVars(array $aParams) protected function d3SaveShopConfigVars(array $aParams)
{ {
$oConfig = Registry::getConfig();
foreach ($aParams as $sConfigType => $aConfigParams) { foreach ($aParams as $sConfigType => $aConfigParams) {
foreach ($aConfigParams as $sSettingName => $sSettingValue){ foreach ($aConfigParams as $sParamName => $sParamValue){
try { if($this->d3GetModuleConfigParam($sParamName) !== $sParamValue){
//if($this->d3GetModuleConfigParam($sSettingName) !== $sSettingValue){} $oConfig->saveShopConfVar(
if ($this->d3SettingExists($sSettingName)){ $sConfigType,
$sSettingName = Constants::OXID_MODULE_ID.$sSettingName; Constants::OXID_MODULE_ID.$sParamName,
$sParamValue,
// converting select to str $oConfig->getShopId(),
if ($sConfigType === "select"){ Constants::OXID_MODULE_ID
$sConfigType = "str"; );
}
switch ($sConfigType){
case 'str':
$this->d3GetModuleSettings()->saveString($sSettingName, $sSettingValue,Constants::OXID_MODULE_ID);
break;
case 'bool':
$this->d3GetModuleSettings()->saveBoolean($sSettingName, $sSettingValue,Constants::OXID_MODULE_ID);
break;
default:
Registry::getLogger()->error(
'No given datatype defined!',
[Constants::OXID_MODULE_ID." -> ".__METHOD__.": ".__LINE__." with '".$sSettingName."'"]
);
}
} }
} catch (\Throwable $throwable) {
Registry::getUtilsView()->addErrorToDisplay($throwable);
Registry::getLogger()->error($throwable->getMessage());
}
} }
} }
} }
/** /**
* @param string $configParamName * @param string $configParamName
* @param bool $displayThrowable * @return mixed
* @return mixed */
*/ public function d3GetModuleConfigParam(string $configParamName)
public function d3GetModuleConfigParam(string $configParamName, bool $displayThrowable = false)
{ {
return Registry::get(ViewConfig::class)->d3GetModuleConfigParam($configParamName, $displayThrowable); return Registry::get(ViewConfig::class)->d3GetModuleConfigParam($configParamName);
} }
} }

View File

@ -4,6 +4,7 @@ declare(strict_types=1);
namespace D3\GoogleAnalytics4\Application\Model\CMP; namespace D3\GoogleAnalytics4\Application\Model\CMP;
abstract class ConsentManagementPlatformBaseModel extends \OxidEsales\Eshop\Core\Model\BaseModel implements ConsentManagementPlatformInterface abstract class ConsentManagementPlatformBaseModel extends \OxidEsales\Eshop\Core\Model\BaseModel implements ConsentManagementPlatformInterface
{ {
public string $sCMPName; public string $sCMPName;
@ -15,4 +16,4 @@ abstract class ConsentManagementPlatformBaseModel extends \OxidEsales\Eshop\Core
{ {
return $this->sCMPName; return $this->sCMPName;
} }
} }

View File

@ -5,4 +5,4 @@ namespace D3\GoogleAnalytics4\Application\Model\CMP;
interface ConsentManagementPlatformInterface interface ConsentManagementPlatformInterface
{ {
public function getCMPName(); public function getCMPName();
} }

View File

@ -4,6 +4,7 @@ declare(strict_types=1);
namespace D3\GoogleAnalytics4\Application\Model\CMP; namespace D3\GoogleAnalytics4\Application\Model\CMP;
use D3\GoogleAnalytics4\Application\Model\ManagerTypes; use D3\GoogleAnalytics4\Application\Model\ManagerTypes;
/** /**
@ -17,8 +18,8 @@ use D3\GoogleAnalytics4\Application\Model\ManagerTypes;
*/ */
class Usercentrics extends ConsentManagementPlatformBaseModel class Usercentrics extends ConsentManagementPlatformBaseModel
{ {
public const sExternalIncludationPublicName = "( Externe Einbindung ) Usercentrics"; const sExternalIncludationPublicName = "( Externe Einbindung ) Usercentrics";
public const sExternalIncludationInternalName = "usercentrics"; const sExternalIncludationInternalName = "usercentrics";
public const sModuleIncludationPublicName = "( Modul ) Usercentrics"; const sModuleIncludationPublicName = "( Modul ) Usercentrics";
public const sModuleIncludationInternalName = "oxps_usercentrics"; const sModuleIncludationInternalName = "oxps_usercentrics";
} }

View File

@ -4,7 +4,8 @@ declare(strict_types=1);
namespace D3\GoogleAnalytics4\Application\Model; namespace D3\GoogleAnalytics4\Application\Model;
class Constants class Constants
{ {
public const OXID_MODULE_ID = 'd3googleanalytics4'; public const OXID_MODULE_ID = 'd3googleanalytics4';
} }

View File

@ -7,6 +7,35 @@ use OxidEsales\Eshop\Core\ViewConfig;
class ManagerHandler class ManagerHandler
{ {
/**
* Gets current chosen Manager
*
* @return string
*/
public function getCurrManager() :string
{
/** @var ManagerTypes $oManagerTypes */
$oManagerTypes = oxNew(ManagerTypes::class);
/** @var ViewConfig $oViewConfig */
$oViewConfig = oxNew(ViewConfig::class);
$aManagerList = $oManagerTypes->getManagerList();
if ($this->getModuleSettingExplicitManagerSelectValue()){
return $this->getExplicitManager();
}
foreach ($aManagerList as $shopModuleId => $publicCMPName){
if ($oViewConfig->isModuleActive($shopModuleId)){
$this->d3SaveShopConfVar($shopModuleId);
return $shopModuleId;
}
}
return "";
}
/** /**
* @param string $sParam * @param string $sParam
* @return void * @return void
@ -24,8 +53,26 @@ class ManagerHandler
/** /**
* @return string * @return string
*/ */
public function getActManager() :string public function getModuleSettingExplicitManagerSelectValue() :string
{ {
return Registry::get(ViewConfig::class)->d3GetModuleConfigParam('_HAS_STD_MANAGER')?:""; return Registry::get(ViewConfig::class)->d3GetModuleConfigParam('_HAS_STD_MANAGER')?:"";
}
/**
* @return string
*/
public function getExplicitManager() :string
{
$sPotentialManagerName = $this->getModuleSettingExplicitManagerSelectValue();
/** @var ManagerTypes $oManagerTypes */
$oManagerTypes = oxNew(ManagerTypes::class);
$sCMPName = $oManagerTypes->isManagerInList($sPotentialManagerName)
? $sPotentialManagerName
: "NONE";
$this->d3SaveShopConfVar($sCMPName);
return $sCMPName;
} }
} }

View File

@ -6,26 +6,20 @@ use D3\GoogleAnalytics4\Application\Model\CMP\Usercentrics;
class ManagerTypes class ManagerTypes
{ {
public const EXTERNAL_SERVICE = "eigener Service"; const EXTERNAL_SERVICE = "eigener Service";
public const INTERNAL_EXTERNAL_SERVICE = "externalService"; const NET_COOKIE_MANAGER = "Netensio Cookie Manager";
public const NET_COOKIE_MANAGER = "Netensio Cookie Manager";
public const INTERNAL_NET_COOKIE_MANAGER = "net_cookie_manager";
/** /**
* Further information's: * Further information's:
* https://github.com/aggrosoft/oxid-cookie-compliance * https://github.com/aggrosoft/oxid-cookie-compliance
*/ */
public const AGCOOKIECOMPLIANCE = "Aggrosoft Cookie Compliance"; const AGCOOKIECOMPLIANCE = "Aggrosoft Cookie Compliance";
public const INTERNAL_AGCOOKIECOMPLIANCE = "agcookiecompliance";
public const CONSENTMANAGER = "Consentmanager"; const CONSENTMANAGER = "Consentmanager";
public const INTERNAL_CONSENTMANAGER = "cmconsentmanager";
public const COOKIEFIRST = "Cookiefirst"; const COOKIEFIRST = "Cookiefirst";
public const INTERNAL_COOKIEFIRST = "cookiefirst";
public const COOKIEBOT = "Cookiebot"; const COOKIEBOT = "Cookiebot";
public const INTERNAL_COOKIEBOT = "cookiebot";
/** /**
* @return array * @return array
@ -33,14 +27,14 @@ class ManagerTypes
public function getManagerList(): array public function getManagerList(): array
{ {
return [ return [
self::INTERNAL_EXTERNAL_SERVICE => self::EXTERNAL_SERVICE, "externalService" => self::EXTERNAL_SERVICE,
self::INTERNAL_AGCOOKIECOMPLIANCE => self::AGCOOKIECOMPLIANCE, "agcookiecompliance" => self::AGCOOKIECOMPLIANCE,
self::INTERNAL_NET_COOKIE_MANAGER => self::NET_COOKIE_MANAGER, "net_cookie_manager" => self::NET_COOKIE_MANAGER,
Usercentrics::sModuleIncludationInternalName => Usercentrics::sModuleIncludationPublicName, Usercentrics::sModuleIncludationInternalName => Usercentrics::sModuleIncludationPublicName,
Usercentrics::sExternalIncludationInternalName => Usercentrics::sExternalIncludationPublicName, Usercentrics::sExternalIncludationInternalName => Usercentrics::sExternalIncludationPublicName,
self::INTERNAL_CONSENTMANAGER => self::CONSENTMANAGER, "cmconsentmanager" => self::CONSENTMANAGER,
self::INTERNAL_COOKIEFIRST => self::COOKIEFIRST, "cookiefirst" => self::COOKIEFIRST,
self::INTERNAL_COOKIEBOT => self::COOKIEBOT, "cookiebot" => self::COOKIEBOT,
]; ];
} }
@ -48,25 +42,8 @@ class ManagerTypes
* @param string $sManager * @param string $sManager
* @return bool * @return bool
*/ */
public function isManagerInList(string $sManager): bool public function isManagerInList(string $sManager) :bool
{ {
return in_array($sManager, array_keys($this->getManagerList()), true); return in_array($sManager, array_keys($this->getManagerList()), true);
} }
}
/**
* @return array
*
* the CMP from this method always needs the script tag delivered to the dom.
*/
public function scriptTagDeliveredByDefaultArray(): array
{
return [
Usercentrics::sModuleIncludationInternalName,
Usercentrics::sExternalIncludationInternalName,
ManagerTypes::INTERNAL_CONSENTMANAGER,
ManagerTypes::INTERNAL_COOKIEFIRST,
ManagerTypes::INTERNAL_COOKIEBOT,
ManagerTypes::INTERNAL_EXTERNAL_SERVICE,
];
}
}

View File

@ -1,10 +1,12 @@
<?php <?php
$sLangName = "Deutsch";
return [ // -------------------------------
// RESOURCE IDENTITFIER = STRING
// -------------------------------
$aLang = array(
'charset' => 'UTF-8', 'charset' => 'UTF-8',
'd3mxgoogleanalytics4' => 'Google Analytics 4', 'd3mxgoogleanalytics4' => 'Google Analytics 4',
'd3mxd3modules' => $aLangCache['d3mxd3modules'] ?? 'Google Analytics 4',
'd3mxgoogleanalytics4set' => 'Einstellungen', 'd3mxgoogleanalytics4set' => 'Einstellungen',
// Base Translations // Base Translations
@ -39,17 +41,6 @@ return [
<br> <br>
Ein einfaches anschalten dieser Funktion regelt noch <strong>nicht</strong> die völlige Funktionsweise Ein einfaches anschalten dieser Funktion regelt noch <strong>nicht</strong> die völlige Funktionsweise
aller beteiligten Instanzen; diese bedarf eine detailliertere Konfiguration!<br>", aller beteiligten Instanzen; diese bedarf eine detailliertere Konfiguration!<br>",
'D3USEREALCATTITLES' => "Klartext Kategorie-Titel statt URL-Teile verwenden",
'D3USEREALCATTITLES_HELP' => "FĂĽr die 'item_category' Ereignis-Parameter keine URL-Teile, sondern die Klartext-Kategorie-Titel verwenden.<br>
Also z.B. 'HaarbĂĽrsten' statt 'haarbuersten'.",
'D3REPLACECHARS' => "Zeichen ersetzen",
'D3REPLACECHARS_HELP' => 'Hier alle Zeichen, die aus Kategorie-Titeln entfernt werden sollen, eintragen,
also z.B. " um ein Zoll-Zeichen zu entfernen oder "0-9 um das Zollzeichen
und alle Ziffern zu entfernen.<br>
<br>
Eine Beispieleingabe könnte so aussehen: üöä0-9<br>
Damit wird <b>ü ö ä</b> und die Ziffern <b>0 1 2 3 4 5 6 7 8 9</b> entfernt.',
// Use CMP? // Use CMP?
'D3CMPTABTITLE' => 'Cookie Manager Einstellungen', 'D3CMPTABTITLE' => 'Cookie Manager Einstellungen',
@ -129,14 +120,4 @@ Nachher:
src="{Domain}?id={Container-ID}" src="{Domain}?id={Container-ID}"
</code> </code>
</pre>', </pre>',
'D3EXTENDEDCONFIG' => 'Erweiterte [GA4] Ereignisskonfiguration', );
'D3VIEWITEMADDVARIANTS' => 'Varianten des Artikels in den Ereignis-Parameter auflisten',
'D3VIEWITEMADDVARIANTS_HELP' => 'Wenn aktiviert, <u>werden die Varianten des Artikels</u>
in die "view_item" Ereignis-Parameter angehangen ( Artikeldetailsseite ).<br>
Dies ist dann notwendig, wenn die Varianten nicht gesondert ausgewählt werden können und direkt von der Seite
des Hauptartikels in den Warenkorb gelegt werden können.
<br>
<br>
Standardmäßig werden keine Varianten an das "view_item"-Event-Array angehangen.<br>
Je nach Artikel kann es hier zu wesentlicher vergrößerung kommen.'
];

View File

@ -0,0 +1,110 @@
<?php
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
use D3\GoogleAnalytics4\Application\Model\Constants as Constants;
$style = '<style type="text/css">
.groupExp a.rc b {font-size:medium;color:#ff3600;}
.groupExp dt .txt,
.groupExp dt .select,
.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 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:hover {outline:3px solid #ff3600;}
</style>';
$aLang = [
'charset' => 'UTF-8',
// STD-Einstellungen
'SHOP_MODULE_GROUP_'.Constants::OXID_MODULE_ID.'_settings' => 'Einstellungen',
'SHOP_MODULE_'. Constants::OXID_MODULE_ID.'_sContainerID' => 'Container ID',
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_blGA4enab' => 'GA4 Aktivieren',
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_blUAenabled' => 'UA Aktivieren',
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_blEnableDebug' => 'Debug-Modus aktivieren',
// Serverside - tagging
'SHOP_MODULE_GROUP_'.Constants::OXID_MODULE_ID.'_serversidetagging' => 'Server-Side tagging',
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_serversidetagging_js' => 'Servercontainer AusfĂĽhrender-Code',
'HELP_SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_serversidetagging_js' => 'Diese Domain wird im <strong>aktiven</strong>-code ausgefĂĽht. Das heiĂźt,
dass es sich hierbei um das HTML-Tag <code>script</code> handelt.
Dieses kĂĽmmert sich darum, dass die, im data_layer
zusammengefassten Daten an den GTM weitergeleitet werden.<br>
<br>
<h4>Folgend eine Darstellung, was genau ausgetauscht wird</h4>
<pre>
<code>
Vorher:
https://www.googletagmanager.com/gtm.js?id=
Nachher:
{Domain}?id=
</code>
</pre>
Die Conatiner-ID wird weiterhin im Punkt "Einstellung" eingetragen!
',
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_serversidetagging_nojs' => 'Servercontainer NICHT AusfĂĽhrender-Code<br><br>
"Serverseitiges Tagging ist eine neue Möglichkeit, mit Google Tag Manager Ihre Anwendung geräteübergreifend zu verwalten.<br>
Servercontainer verwenden dasselbe Tag-, Trigger- und Variablenmodell, das Sie gewohnt sind.<br>
Außerdem bieten sie neue Tools, mit denen Sie Nutzeraktivitäten überall messen können." <br>
<br>
- Quelle <a href="https://developers.google.com/tag-platform/tag-manager/server-side/intro">Developers-Google Server-Side tagging</a><br>
<br>
<strong>Verändern Sie die Werte nur, wenn Sie Server-Side tagging verwenden wollen!</strong>
',
'HELP_SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_serversidetagging_nojs' => 'Diese Domain wird im <strong>passiven</strong>-code ausgefĂĽht. Das heiĂźt,
dass es sich hierbei um das HTML-Tag <code>noscript</code> handelt.
Dieses wird ausgefĂĽhrt, wenn aus einem bestimmten Grund
das Javascript nicht ausgefĂĽhrt wird.<br>
( keine Cookies erlaubt, JavaScript-Unterbindung, ... )
<br>
<h4>Folgend eine Darstellung, was genau ausgetauscht wird</h4>
<pre>
<code>
Vorher:
src="https://www.googletagmanager.com/ns.html?id={Container-ID}"
Nachher:
src="{Domain}?id={Container-ID}"
</code>
</pre>
Die Conatiner-ID wird weiterhin im Punkt "Einstellung" eingetragen!
',
// for cookie manager settings
'SHOP_MODULE_GROUP_'.Constants::OXID_MODULE_ID.'_cookiemanager' => 'Cookie Manager Einstellungen',
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_hasOwnCookieManager' => 'Cookie Manager nutzen?',
'HELP_SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_HAS_STD_MANAGER' => 'Mehr Informationen zu den genannten Coookie-Manager finden Sie auf den folgenden Home-Pages<br><br>
<a href="https://consentmanager.net/">Consentmanager</a><br>
<a href="https://usercentrics.com/">Usercentrics</a><br>
<a href="https://cookiefirst.com">Cookiefirst</a><br>
<hr>
Bei weiteren Fragen stehen wir gern zur VerfĂĽgung! Kontaktieren Sie uns einfach unter <a href="https://www.d3data.de/">https://www.d3data.de/</a>',
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_HAS_STD_MANAGER' => 'Nutzen Sie eine der folgenden Einbindungen?<br>
Dann wählen Sie bitte die zutreffende aus.',
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_HAS_STD_MANAGER_NONE' => '---',
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_HAS_STD_MANAGER_CONSENTMANAGER' => 'consentmanager',
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_HAS_STD_MANAGER_USERCENTRICS' => 'usercentrics',
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_HAS_STD_MANAGER_COOKIEFIRST' => 'cookiefirst',
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_HAS_STD_MANAGER_COOKIEBOT' => 'Cookiebot',
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_controlParameter' => 'Steuerungsparameter',
'HELP_SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_controlParameter' => 'Nähere infos zum <a target="_blank" href="https://git.d3data.de/D3Public/GoogleAnalytics4/src/branch/master/Docs">"<strong>Steuerungsparameter</strong>"</a><hr>
<strong>Beachte:</strong><br>
Sofern Sie die <a target="_blank" href="https://consentmanager.net" style="color: blue">consentmanager</a> CMP verwenden,
bitte ich Sie, grĂĽndlichst, die Hinweise der <a target="_blank" href="https://git.d3data.de/D3Public/GoogleAnalytics4/src/branch/master/Docs/CMP/consentmanager.md">Moduldokumentation/Consentmanager</a> zu lesen.
',
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_blActivateConsentMode' => "Google Consent Mode 'Default Values' aktivieren",
'HELP_SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_blActivateConsentMode' => 'Diese Einstellung ist zu aktivieren, wenn Sie den Google-Consent-Mode ( Einwilligungsmodus ) verwenden wollen.
<hr>
"Im Einwilligungsmodus können Sie Google über den Cookie- oder App-ID-Einwilligungsstatus Ihrer Nutzer informieren.
Mit Tags wird das Verhalten angepasst. Dabei werden die Einstellungen der Nutzer berĂĽcksichtigt." ~ <a href="https://support.google.com/google-ads/answer/10000067">Google Einwilligungsmodus</a>',
];

View File

@ -1,4 +1,4 @@
[{include file="@d3googleanalytics4/admin/d3ga4uiheaditem.tpl" title="GENERAL_ADMIN_TITLE"|oxmultilangassign}] [{include file="ga4/admin/d3ga4uiheaditem.tpl" title="GENERAL_ADMIN_TITLE"|oxmultilangassign}]
<style> <style>
body { body {
background-image: linear-gradient(to top, #d5d4d0 0%, #d5d4d0 1%, #eeeeec 31%, #efeeec 75%, #e9e9e7 100%); background-image: linear-gradient(to top, #d5d4d0 0%, #d5d4d0 1%, #eeeeec 31%, #efeeec 75%, #e9e9e7 100%);
@ -80,6 +80,7 @@
[{oxmultilang ident="D3CMP"}] [{oxmultilang ident="D3CMP"}]
</label> </label>
<select class="form-select w-50" name="editval[select][_HAS_STD_MANAGER]" aria-label="Default select example"> <select class="form-select w-50" name="editval[select][_HAS_STD_MANAGER]" aria-label="Default select example">
<option value="NONE" selected>[{oxmultilang ident="D3NONE"}]</option>
[{foreach from=$d3ManagerTypeArray key="sInternalName" item="sPublicName" name="editval[aCmpNameArray]"}] [{foreach from=$d3ManagerTypeArray key="sInternalName" item="sPublicName" name="editval[aCmpNameArray]"}]
<option value="[{$sInternalName}]" [{if $sInternalName === $d3CurrentCMP}]SELECTED[{/if}]>[{$sPublicName}]</option> <option value="[{$sInternalName}]" [{if $sInternalName === $d3CurrentCMP}]SELECTED[{/if}]>[{$sPublicName}]</option>
[{/foreach}] [{/foreach}]
@ -145,43 +146,6 @@
<button type="submit" name="save" class="btn btn-light w-100" onClick="Javascript:document.d3gtmformedit.fnc.value='save'">[{oxmultilang ident="GENERAL_SAVE"}]</button> <button type="submit" name="save" class="btn btn-light w-100" onClick="Javascript:document.d3gtmformedit.fnc.value='save'">[{oxmultilang ident="GENERAL_SAVE"}]</button>
</div> </div>
</div> </div>
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#panelsStayOpen-viewitemvariants" aria-expanded="false" aria-controls="panelsStayOpen-viewitemvariants">
[{oxmultilang ident="D3EXTENDEDCONFIG"}]
</button>
</h2>
<div id="panelsStayOpen-viewitemvariants" class="accordion-collapse collapse">
<div class="accordion-body">
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" name="editval[bool][_blViewItemAddVariants]" [{if $d3ViewObject->d3GetModuleConfigParam('_blViewItemAddVariants')}]checked[{/if}] id="blGA4enab">
<label class="form-check-label" for="flexCheckDefault">
[{oxmultilang ident="D3VIEWITEMADDVARIANTS"}][{oxinputhelp ident="D3VIEWITEMADDVARIANTS_HELP"}]
</label>
</div>
<hr>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="_blUseRealCategoyTitles"
name="editval[bool][_blUseRealCategoyTitles]"
[{if $d3ViewObject->d3GetModuleConfigParam('_blUseRealCategoyTitles')}]checked[{/if}]>
<label class="form-check-label" for="flexCheckChecked">
[{oxmultilang ident="D3USEREALCATTITLES"}][{oxinputhelp ident="D3USEREALCATTITLES_HELP"}]
</label>
</div>
<div class="mb-3">
<div class="input-group w-50">
<span class="input-group-text"
id="basic-addon3">[{oxmultilang ident="D3REPLACECHARS"}]</span>
<input type="text" class="form-control" id="_sReplaceChars"
name="editval[str][_sReplaceChars]" aria-describedby="basic-addon3"
value='[{$d3ViewObject->d3GetModuleConfigParam('_sReplaceChars')}]'/>
</div>
<div class="text-muted">[{oxmultilang ident="D3REPLACECHARS_HELP"}]</div>
</div>
</div>
<button type="submit" name="save" class="btn btn-light w-100" onClick="Javascript:document.d3gtmformedit.fnc.value='save'">[{oxmultilang ident="GENERAL_SAVE"}]</button>
</div>
</div>
[{if $d3ViewConfObject->d3IsUsercentricsCMPChosen()}] [{if $d3ViewConfObject->d3IsUsercentricsCMPChosen()}]
<div class="accordion-item"> <div class="accordion-item">
<h2 class="accordion-header"> <h2 class="accordion-header">

View File

@ -1,28 +0,0 @@
<?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.
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Daniel Seifert <support@shopmodule.com>
* @link https://www.oxidmodule.com
*/
// @codeCoverageIgnoreStart
$sLangName = 'Deutsch';
// -------------------------------
// RESOURCE IDENTITFIER = STRING
// -------------------------------
$aLang = include __DIR__."/../../de/d3googleanalytics4_lang.php";
// @codeCoverageIgnoreEnd

View File

@ -1,28 +0,0 @@
<?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.
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Daniel Seifert <support@shopmodule.com>
* @link https://www.oxidmodule.com
*/
// @codeCoverageIgnoreStart
$sLangName = 'Deutsch';
// -------------------------------
// RESOURCE IDENTITFIER = STRING
// -------------------------------
$aLang = include __DIR__."/../../de/d3googleanalytics4_lang.php";
// @codeCoverageIgnoreEnd

View File

View File

@ -1,12 +1,12 @@
[{if $oViewConf->D3blShowGtmScript()}] [{if $oViewConf->D3blShowGtmScript()}]
[{if $oViewConf->getGtmContainerId()}][{strip}] [{if $oViewConf->getGtmContainerId()}][{strip}]
<!-- Google Tag Manager (noscript) --> <!-- Google Tag Manager (noscript) -->
<noscript> <noscript>
<iframe src="[{$oViewConf->getServerSidetaggingNoJsDomain()}]?id=[{$oViewConf->getGtmContainerId()}]" <iframe src="[{$oViewConf->getServerSidetaggingNoJsDomain()}]?id=[{$oViewConf->getGtmContainerId()}]"
height="0" width="0" style="display:none;visibility:hidden"></iframe> height="0" width="0" style="display:none;visibility:hidden"></iframe>
</noscript> </noscript>
<!-- End Google Tag Manager (noscript) --> <!-- End Google Tag Manager (noscript) -->
[{/strip}][{/if}] [{/strip}][{/if}]
[{/if}] [{/if}]
[{$smarty.block.parent}] [{$smarty.block.parent}]

View File

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file="event/add_payment_info.tpl"}]

View File

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file="event/begin_checkout.tpl"}]

View File

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file="event/add_to_cart.tpl" htmlIdAmountOfArticles='#amountToBasket'}]

View File

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file="event/add_to_cart.tpl" htmlIdAmountOfArticles='#amountToBasket'}]

View File

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file="event/purchase.tpl"}]

View File

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file="event/remove_from_cart.tpl"}]

View File

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file="event/add_to_cart.tpl" htmlIdAmountOfArticles='#amountToBasket'}]

View File

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file="event/view_cart.tpl"}]

View File

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file="event/view_item.tpl"}]

View File

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file="event/view_item_list.tpl"}]

View File

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file="event/view_search_result.tpl"}]

View File

@ -26,19 +26,17 @@
[{assign var="gtmBasketItem" value=$basketitem->getArticle()}] [{assign var="gtmBasketItem" value=$basketitem->getArticle()}]
[{assign var="gtmBasketItemCategory" value=$gtmBasketItem->getCategory()}] [{assign var="gtmBasketItemCategory" value=$gtmBasketItem->getCategory()}]
{ {
'item_oxid': '[{$gtmCartArticles[$basketindex]->getFieldData('oxid')}]',
'item_id': '[{$gtmCartArticles[$basketindex]->getFieldData('oxartnum')}]', 'item_id': '[{$gtmCartArticles[$basketindex]->getFieldData('oxartnum')}]',
'item_name': '[{$gtmCartArticles[$basketindex]->getRawFieldData('oxtitle')}]', 'item_name': '[{$gtmCartArticles[$basketindex]->getFieldData('oxtitle')}]',
'item_variant': '[{$gtmCartArticles[$basketindex]->getFieldData('oxvarselect')}]', 'item_variant': '[{$gtmCartArticles[$basketindex]->getFieldData('oxvarselect')}]',
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
[{if $gtmBasketItemCategory}] [{if $gtmBasketItemCategory}]
'item_category': '[{$gtmBasketItemCategory->getSplitCategoryArray(0, true)}]', 'item_category': '[{$gtmBasketItemCategory->getSplitCategoryArray(0, true)}]',
'item_category2': '[{$gtmBasketItemCategory->getSplitCategoryArray(1, true)}]', 'item_category_2': '[{$gtmBasketItemCategory->getSplitCategoryArray(1, true)}]',
'item_category3': '[{$gtmBasketItemCategory->getSplitCategoryArray(2, true)}]', 'item_category_3': '[{$gtmBasketItemCategory->getSplitCategoryArray(2, true)}]',
'item_category4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3, true)}]', 'item_category_4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3, true)}]',
'item_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]', 'item_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]',
[{/if}] [{/if}]
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$gtmItemPriceObject->getPrice()}],[{/oxhasrights}] 'price': [{$gtmItemPriceObject->getPrice()}],
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]', 'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
'quantity': [{$basketitem->getAmount()}], 'quantity': [{$basketitem->getAmount()}],
'position': [{$smarty.foreach.gtmCartContents.index}] 'position': [{$smarty.foreach.gtmCartContents.index}]

View File

@ -35,18 +35,17 @@
'value': iArtQuantity*[{$d3PriceObject->getPrice()}], 'value': iArtQuantity*[{$d3PriceObject->getPrice()}],
'items': [ 'items': [
{ {
'item_oxid': '[{$oGtmProduct->getFieldData('oxid')}]',
'item_id': '[{$oGtmProduct->getFieldData('oxartnum')}]', 'item_id': '[{$oGtmProduct->getFieldData('oxartnum')}]',
'item_name': '[{$oGtmProduct->getRawFieldData('oxtitle')}]', 'item_name': '[{$oGtmProduct->getFieldData('oxtitle')}]',
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$d3PriceObject->getPrice()}],[{/oxhasrights}] 'price': [{$d3PriceObject->getPrice()}],
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]', 'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
'item_variant': '[{if $oGtmProduct->getFieldData('oxvarselect')}][{$oGtmProduct->getFieldData('oxvarselect')}][{/if}]', 'item_variant': '[{if $oGtmProduct->getFieldData('oxvarselect')}][{$oGtmProduct->getFieldData('oxvarselect')}][{/if}]',
[{if $gtmCategory}] [{if $gtmCategory}]
'item_category': '[{$gtmCategory->getSplitCategoryArray(0, true)}]', 'item_category': '[{$gtmCategory->getSplitCategoryArray(0, true)}]',
'item_category2': '[{$gtmCategory->getSplitCategoryArray(1, true)}]', 'item_category_2':'[{$gtmCategory->getSplitCategoryArray(1, true)}]',
'item_category3': '[{$gtmCategory->getSplitCategoryArray(2, true)}]', 'item_category_3':'[{$gtmCategory->getSplitCategoryArray(2, true)}]',
'item_category4': '[{$gtmCategory->getSplitCategoryArray(3, true)}]', 'item_category_4':'[{$gtmCategory->getSplitCategoryArray(3, true)}]',
'item_list_name': '[{$gtmCategory->getSplitCategoryArray()}]', 'item_list_name':'[{$gtmCategory->getSplitCategoryArray()}]',
[{/if}] [{/if}]
'quantity': iArtQuantity 'quantity': iArtQuantity
} }

View File

@ -1,11 +1,5 @@
[{*$oxcmp_basket|get_class_methods|dumpvar*}] [{*$oxcmp_basket|get_class_methods|dumpvar*}]
/* ToDo:
- erst feuern, wenn
-> angemeldet wurde
-> Bestellung ohne Registrieren
*/
[{assign var="d3BasketPrice" value=$oxcmp_basket->getPrice()}] [{assign var="d3BasketPrice" value=$oxcmp_basket->getPrice()}]
[{assign var="d3BasketObject" value=$oxcmp_basket}] [{assign var="d3BasketObject" value=$oxcmp_basket}]
[{assign var='gtmCartArticles' value=$d3BasketObject->getBasketArticles()}] [{assign var='gtmCartArticles' value=$d3BasketObject->getBasketArticles()}]
@ -30,21 +24,18 @@
[{assign var="d3oItemPrice" value=$basketitem->getPrice()}] [{assign var="d3oItemPrice" value=$basketitem->getPrice()}]
[{assign var="gtmBasketItem" value=$basketitem->getArticle()}] [{assign var="gtmBasketItem" value=$basketitem->getArticle()}]
[{assign var="gtmBasketItemCategory" value=$gtmBasketItem->getCategory()}] [{assign var="gtmBasketItemCategory" value=$gtmBasketItem->getCategory()}]
[{assign var="gtmManufacturer" value=$gtmBasketItem->getManufacturer()}]
{ {
'item_oxid': '[{$gtmCartArticles[$basketindex]->getFieldData('oxid')}]',
'item_id': '[{$gtmCartArticles[$basketindex]->getFieldData('oxartnum')}]', 'item_id': '[{$gtmCartArticles[$basketindex]->getFieldData('oxartnum')}]',
'item_name': '[{$gtmCartArticles[$basketindex]->getRawFieldData('oxtitle')}]', 'item_name': '[{$gtmCartArticles[$basketindex]->getFieldData('oxtitle')}]',
'item_variant': '[{$gtmCartArticles[$basketindex]->getFieldData('oxvarselect')}]', 'item_variant': '[{$gtmCartArticles[$basketindex]->getFieldData('oxvarselect')}]',
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
[{if $gtmBasketItemCategory}] [{if $gtmBasketItemCategory}]
'item_category': '[{$gtmBasketItemCategory->getSplitCategoryArray(0, true)}]', 'item_category': '[{$gtmBasketItemCategory->getSplitCategoryArray(0, true)}]',
'item_category2': '[{$gtmBasketItemCategory->getSplitCategoryArray(1, true)}]', 'item_category_2': '[{$gtmBasketItemCategory->getSplitCategoryArray(1, true)}]',
'item_category3': '[{$gtmBasketItemCategory->getSplitCategoryArray(2, true)}]', 'item_category_3': '[{$gtmBasketItemCategory->getSplitCategoryArray(2, true)}]',
'item_category4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3, true)}]', 'item_category_4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3, true)}]',
'item_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]', 'item_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]',
[{/if}] [{/if}]
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$d3oItemPrice->getPrice()}],[{/oxhasrights}] 'price': [{$d3oItemPrice->getPrice()}],
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]', 'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
'quantity': [{$basketitem->getAmount()}], 'quantity': [{$basketitem->getAmount()}],
'position': [{$smarty.foreach.gtmCartContents.index}] 'position': [{$smarty.foreach.gtmCartContents.index}]

View File

@ -26,24 +26,21 @@
[{assign var="gtmPurchaseItemPriceObject" value=$gtmBasketItem->getPrice()}] [{assign var="gtmPurchaseItemPriceObject" value=$gtmBasketItem->getPrice()}]
[{assign var="gtmPurchaseItem" value=$gtmBasketItem->getArticle()}] [{assign var="gtmPurchaseItem" value=$gtmBasketItem->getArticle()}]
[{assign var="gtmPurchaseItemCategory" value=$gtmPurchaseItem->getCategory()}] [{assign var="gtmPurchaseItemCategory" value=$gtmPurchaseItem->getCategory()}]
[{assign var="gtmManufacturer" value=$gtmPurchaseItem->getManufacturer()}]
{ {
'item_oxid': '[{$gtmBasketItem->getFieldData("oxid")}]',
'item_id': '[{$gtmBasketItem->getFieldData("oxartnum")}]', 'item_id': '[{$gtmBasketItem->getFieldData("oxartnum")}]',
'item_name': '[{$gtmBasketItem->getRawFieldData("oxtitle")}]', 'item_name': '[{$gtmBasketItem->getFieldData("oxtitle")}]',
'affiliation': '[{$gtmBasketItem->getRawFieldData("oxtitle")}]', 'affiliation': '[{$gtmBasketItem->getFieldData("oxtitle")}]',
'coupon': '[{foreach from=$gtmOrderVouchers item="gtmOrderVoucher" name="gtmOrderVoucherIteration"}][{$gtmOrderVoucher}][{if !$smarty.foreach.gtmOrderVoucherIteration.last}], [{/if}][{/foreach}]', 'coupon': '[{foreach from=$gtmOrderVouchers item="gtmOrderVoucher" name="gtmOrderVoucherIteration"}][{$gtmOrderVoucher}][{if !$smarty.foreach.gtmOrderVoucherIteration.last}], [{/if}][{/foreach}]',
'item_variant': '[{$gtmBasketItem->getFieldData("oxselvariant")}]', 'item_variant': '[{$gtmBasketItem->getFieldData("oxselvariant")}]',
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
[{if $gtmPurchaseItemCategory}] [{if $gtmPurchaseItemCategory}]
'item_category': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(0, true)}]', 'item_category': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(0, true)}]',
'item_category2': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(1, true)}]', 'item_category_2': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(1, true)}]',
'item_category3': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(2, true)}]', 'item_category_3': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(2, true)}]',
'item_category4': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(3, true)}]', 'item_category_4': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(3, true)}]',
'item_list_name': '[{$gtmPurchaseItemCategory->getSplitCategoryArray()}]', 'item_list_name': '[{$gtmPurchaseItemCategory->getSplitCategoryArray()}]',
[{/if}] [{/if}]
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$gtmPurchaseItemPriceObject->getPrice()}],[{/oxhasrights}] 'price': [{$gtmPurchaseItemPriceObject->getPrice()}],
'quantity': [{$gtmBasketItem->getFieldData("oxamount")}], 'quantity': [{$gtmBasketItem->getFieldData("oxamount")}],
'position': [{$smarty.foreach.gtmArticles.iteration}] 'position': [{$smarty.foreach.gtmArticles.iteration}]
}[{if !$smarty.foreach.gtmArticles.last}],[{/if}] }[{if !$smarty.foreach.gtmArticles.last}],[{/if}]
@ -52,7 +49,7 @@
}[{if $oViewConf->isDebugModeOn()}], }[{if $oViewConf->isDebugModeOn()}],
'debug_mode': 'true' 'debug_mode': 'true'
[{/if}] [{/if}]
}); })
[{/strip}] [{/strip}]
[{/capture}] [{/capture}]
[{oxscript add=$smarty.capture.d3_ga4_purchase}] [{oxscript add=$smarty.capture.d3_ga4_purchase}]

View File

@ -18,18 +18,17 @@
[{assign var="d3oItemPrice" value=$rmItem->getPrice()}] [{assign var="d3oItemPrice" value=$rmItem->getPrice()}]
[{assign var="gtmBasketItemCategory" value=$rmItem->getCategory()}] [{assign var="gtmBasketItemCategory" value=$rmItem->getCategory()}]
{ {
'item_oxid': '[{$rmItem->getFieldData('oxid')}]',
'item_id': '[{$rmItem->getFieldData('oxartnum')}]', 'item_id': '[{$rmItem->getFieldData('oxartnum')}]',
'item_name': '[{$rmItem->getRawFieldData('oxtitle')}]', 'item_name': '[{$rmItem->getFieldData('oxtitle')}]',
'item_variant': '[{$rmItem->getFieldData('oxvarselect')}]', 'item_variant': '[{$rmItem->getFieldData('oxvarselect')}]',
[{if $gtmBasketItemCategory}] [{if $gtmBasketItemCategory}]
'item_category': '[{$gtmBasketItemCategory->getSplitCategoryArray(0, true)}]', 'item_category': '[{$gtmBasketItemCategory->getSplitCategoryArray(0, true)}]',
'item_category2': '[{$gtmBasketItemCategory->getSplitCategoryArray(1, true)}]', 'item_category_2': '[{$gtmBasketItemCategory->getSplitCategoryArray(1, true)}]',
'item_category3': '[{$gtmBasketItemCategory->getSplitCategoryArray(2, true)}]', 'item_category_3': '[{$gtmBasketItemCategory->getSplitCategoryArray(2, true)}]',
'item_category4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3, true)}]', 'item_category_4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3, true)}]',
'item_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]', 'item_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]',
[{/if}] [{/if}]
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$d3oItemPrice->getPrice()}],[{/oxhasrights}] 'price': [{$d3oItemPrice->getPrice()}],
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]', 'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
'quantity': '[{$rmItem->getFieldData('d3AmountThatGotRemoved')}]', 'quantity': '[{$rmItem->getFieldData('d3AmountThatGotRemoved')}]',
'position': [{$smarty.foreach.gtmRemovedItems.index}] 'position': [{$smarty.foreach.gtmRemovedItems.index}]

View File

@ -23,18 +23,17 @@
[{assign var="gtmBasketItem" value=$basketitem->getArticle()}] [{assign var="gtmBasketItem" value=$basketitem->getArticle()}]
[{assign var="gtmBasketItemCategory" value=$gtmBasketItem->getCategory()}] [{assign var="gtmBasketItemCategory" value=$gtmBasketItem->getCategory()}]
{ {
'item_oxid': '[{$gtmCartArticles[$basketindex]->getFieldData('oxid')}]',
'item_id': '[{$gtmCartArticles[$basketindex]->getFieldData('oxartnum')}]', 'item_id': '[{$gtmCartArticles[$basketindex]->getFieldData('oxartnum')}]',
'item_name': '[{$gtmCartArticles[$basketindex]->getRawFieldData('oxtitle')}]', 'item_name': '[{$gtmCartArticles[$basketindex]->getFieldData('oxtitle')}]',
'item_variant': '[{$gtmCartArticles[$basketindex]->getFieldData('oxvarselect')}]', 'item_variant': '[{$gtmCartArticles[$basketindex]->getFieldData('oxvarselect')}]',
[{if $gtmBasketItemCategory}] [{if $gtmBasketItemCategory}]
'item_category': '[{$gtmBasketItemCategory->getSplitCategoryArray(0, true)}]', 'item_category': '[{$gtmBasketItemCategory->getSplitCategoryArray(0, true)}]',
'item_category2': '[{$gtmBasketItemCategory->getSplitCategoryArray(1, true)}]', 'item_category_2': '[{$gtmBasketItemCategory->getSplitCategoryArray(1, true)}]',
'item_category3': '[{$gtmBasketItemCategory->getSplitCategoryArray(2, true)}]', 'item_category_3': '[{$gtmBasketItemCategory->getSplitCategoryArray(2, true)}]',
'item_category4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3, true)}]', 'item_category_4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3, true)}]',
'item_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]', 'item_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]',
[{/if}] [{/if}]
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$d3oItemPrice->getPrice()}],[{/oxhasrights}] 'price': [{$d3oItemPrice->getPrice()}],
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]', 'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
'quantity': [{$basketitem->getAmount()}], 'quantity': [{$basketitem->getAmount()}],
'position': [{$smarty.foreach.gtmCartContents.index}] 'position': [{$smarty.foreach.gtmCartContents.index}]

View File

@ -0,0 +1,41 @@
[{assign var="gtmProduct" value=$oView->getProduct()}]
[{assign var="gtmCategory" value=$gtmProduct->getCategory()}]
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
[{block name="d3_ga4_view_item_block"}]
[{capture name="d3_ga4_view_item"}]
[{strip}]
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
dataLayer.push({
'event': 'view_item',
'eventLabel':'Product View',
'ecommerce':
{
'currency': '[{$currency->name}]',
'items':
[
{
'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]',
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
'item_variant': '[{if $gtmProduct->getFieldData("oxvarselect")}][{$gtmProduct->getFieldData("oxvarselect")}][{/if}]',
[{if $gtmCategory}]
'item_category': '[{$gtmCategory->getSplitCategoryArray(0, true)}]',
'item_category_2':'[{$gtmCategory->getSplitCategoryArray(1, true)}]',
'item_category_3':'[{$gtmCategory->getSplitCategoryArray(2, true)}]',
'item_category_4':'[{$gtmCategory->getSplitCategoryArray(3, true)}]',
'item_list_name':'[{$gtmCategory->getSplitCategoryArray()}]',
[{/if}]
[{assign var="d3PriceObject" value=$gtmProduct->getPrice()}]
'price': [{$d3PriceObject->getPrice()}]
}
]
}[{if $oViewConf->isDebugModeOn()}],
'debug_mode': 'true'
[{/if}]
});
[{/strip}]
[{/capture}]
[{oxscript add=$smarty.capture.d3_ga4_view_item}]
[{/block}]

View File

@ -20,16 +20,15 @@
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}] [{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
[{if !$gtmCategory}][{assign var="gtmCategory" value=$gtmProduct->getCategory()}][{/if}] [{if !$gtmCategory}][{assign var="gtmCategory" value=$gtmProduct->getCategory()}][{/if}]
{ {
'item_oxid': '[{$gtmProduct->getFieldData("oxid")}]',
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]', 'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
'item_name': '[{$gtmProduct->getRawFieldData("oxtitle")}]', 'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]',
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$d3PriceObject->getPrice()}],[{/oxhasrights}] 'price': [{$d3PriceObject->getPrice()}],
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]', 'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
[{if $gtmCategory}] [{if $gtmCategory}]
'item_category': '[{$gtmCategory->getSplitCategoryArray(0, true)}]', 'item_category': '[{$gtmCategory->getSplitCategoryArray(0, true)}]',
'item_category2': '[{$gtmCategory->getSplitCategoryArray(1, true)}]', 'item_category_2':'[{$gtmCategory->getSplitCategoryArray(1, true)}]',
'item_category3': '[{$gtmCategory->getSplitCategoryArray(2, true)}]', 'item_category_3':'[{$gtmCategory->getSplitCategoryArray(2, true)}]',
'item_category4': '[{$gtmCategory->getSplitCategoryArray(3, true)}]', 'item_category_4':'[{$gtmCategory->getSplitCategoryArray(3, true)}]',
[{/if}] [{/if}]
'quantity': 1 'quantity': 1
}[{if !$smarty.foreach.gtmProducts.last}],[{/if}] }[{if !$smarty.foreach.gtmProducts.last}],[{/if}]

View File

@ -16,16 +16,15 @@
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}] [{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
[{assign var="gtmCategory" value=$gtmProduct->getCategory()}] [{assign var="gtmCategory" value=$gtmProduct->getCategory()}]
{ {
'item_oxid': '[{$gtmProduct->getFieldData("oxid")}]',
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]', 'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
'item_name': '[{$gtmProduct->getRawFieldData("oxtitle")}]', 'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]',
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$d3PriceObject->getPrice()}],[{/oxhasrights}] 'price': [{$d3PriceObject->getPrice()}],
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]', 'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
[{if $gtmCategory}] [{if $gtmCategory}]
'item_category': '[{$gtmCategory->getSplitCategoryArray(0, true)}]', 'item_category': '[{$gtmCategory->getSplitCategoryArray(0, true)}]',
'item_category2': '[{$gtmCategory->getSplitCategoryArray(1, true)}]', 'item_category_2':'[{$gtmCategory->getSplitCategoryArray(1, true)}]',
'item_category3': '[{$gtmCategory->getSplitCategoryArray(2, true)}]', 'item_category_3':'[{$gtmCategory->getSplitCategoryArray(2, true)}]',
'item_category4': '[{$gtmCategory->getSplitCategoryArray(3, true)}]', 'item_category_4':'[{$gtmCategory->getSplitCategoryArray(3, true)}]',
'item_list_name':'[{$gtmCategory->getSplitCategoryArray()}]', 'item_list_name':'[{$gtmCategory->getSplitCategoryArray()}]',
[{/if}] [{/if}]
'quantity': 1 'quantity': 1
@ -42,4 +41,4 @@
[{/if}] [{/if}]
[{/block}] [{/block}]
[{include file='@d3googleanalytics4/event/add_to_cart.tpl' htmlIdAmountOfArticles='#amountToBasket'}] [{include file="event/add_to_cart.tpl" htmlIdAmountOfArticles='#amountToBasket'}]

View File

@ -8,7 +8,7 @@
<p class="alert alert-info">[{oxmultilang ident="WISH_LIST_EMPTY"}]</p> <p class="alert alert-info">[{oxmultilang ident="WISH_LIST_EMPTY"}]</p>
[{/if}] [{/if}]
[{include file='@d3googleanalytics4/event/add_to_cart.tpl' htmlIdAmountOfArticles='#amountToBasket'}] [{include file="event/add_to_cart.tpl" htmlIdAmountOfArticles='#amountToBasket'}]
[{insert name="oxid_tracker" title=$template_title}] [{insert name="oxid_tracker" title=$template_title}]
[{/capture}] [{/capture}]

View File

@ -21,7 +21,7 @@
[{/if}] [{/if}]
[{/block}] [{/block}]
[{include file='@d3googleanalytics4/event/add_to_cart.tpl' htmlIdAmountOfArticles='#amountToBasket'}] [{include file="event/add_to_cart.tpl" htmlIdAmountOfArticles='#amountToBasket'}]
[{insert name="oxid_tracker" title=$template_title}] [{insert name="oxid_tracker" title=$template_title}]
[{/capture}] [{/capture}]

View File

@ -34,7 +34,7 @@
</p> </p>
[{/if}] [{/if}]
[{include file='@d3googleanalytics4/event/add_to_cart.tpl' htmlIdAmountOfArticles='#amountToBasket'}] [{include file="event/add_to_cart.tpl" htmlIdAmountOfArticles='#amountToBasket'}]
[{insert name="oxid_tracker" title=$template_title}] [{insert name="oxid_tracker" title=$template_title}]
[{/capture}] [{/capture}]

View File

@ -4,59 +4,7 @@ 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/), 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). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [unreleased](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/3.0.0.1...rel_3.x) - 2025-x ## [unreleased](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.17.2...rel_2.x) - 2024-x
## [3.1.0.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/3.0.0.1...3.1.0.0) - 2025-06-29
### Changed
- data getter and saver to 'state fo the art'
### Added
- Twig usability
- previous major-version addings
## [3.0.0.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/3.0.0.0...3.0.0.1) - 2024-03-19
### Fixed
- reset of cmp-selection
- over-engineered getter-methods
## [3.0.0.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.22.0...3.0.0.0) - 2024-11-25
### Added
- installability OXID 7
- don't submit item prices, if user doesn't have "show price" right
## [2.24.0.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.23.0.2...2.24.0.0) - 2025-06-12
### Fixed
- return payment-object instead of string
- missing semicolon
- irritating admin-list module-group-name
### Added
- 'item_oxid' parameter
- 'item_brand' parameter
- setting to use literal category-title
- setting to replace chars in item_category-parameter
- setting to list article-variants into parameter-array
## [2.23.0.2](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.23.0.1...2.23.0.2) - 2025-03-19
### Fixed
- reset of cmp-selection
- over-engineered getter-methods
## [2.23.0.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.23.0.0...2.23.0.1) - 2025-02-19
### Fixed
- false metadata view_cart entry
- missing menu-translation
### Added
- data layer doesn't contain prices if current user hasn't "show price" rights
## [2.23.0.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.22.0...2.23.0.0) - 2024-12-21
### Added
- another tag-versioning position
- additional global variables, if given
## [2.22.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.21.0...2.22.0) - 2024-09-21
### Fixed
- Consentmanager didn't get delivered
### Changed
- write "internal_names" of CMP to constants
## [2.21.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.20.1...2.21.0) - 2024-09-19 ## [2.21.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.20.1...2.21.0) - 2024-09-19
### Fixed ### Fixed

View File

@ -14,28 +14,18 @@
*/ */
namespace D3\GoogleAnalytics4\Modules\Core{ namespace D3\GoogleAnalytics4\Modules\Core{
class ViewConfig_parent extends \OxidEsales\Eshop\Core\ViewConfig class ViewConfig_parent extends \OxidEsales\Eshop\Core\ViewConfig{}
{
}
} }
namespace D3\GoogleAnalytics4\Modules\Application\Model{ namespace D3\GoogleAnalytics4\Modules\Application\Model{
use OxidEsales\Eshop\Application\Model\Payment; use OxidEsales\Eshop\Application\Model\Payment;
class Category_parent extends \OxidEsales\Eshop\Application\Model\Category class Category_parent extends \OxidEsales\Eshop\Application\Model\Category {}
{ class Basket_parent extends \OxidEsales\Eshop\Application\Model\Basket {}
} class Manufacturer_parent extends \OxidEsales\Eshop\Application\Model\Manufacturer {}
class Basket_parent extends \OxidEsales\Eshop\Application\Model\Basket
{
}
class Manufacturer_parent extends \OxidEsales\Eshop\Application\Model\Manufacturer
{
}
class gtmPayment_parent extends Payment class gtmPayment_parent extends Payment {}
{
}
} }
namespace D3\GoogleAnalytics4\Modules\Application\Controller{ namespace D3\GoogleAnalytics4\Modules\Application\Controller{
@ -48,60 +38,36 @@ namespace D3\GoogleAnalytics4\Modules\Application\Controller{
use OxidEsales\Eshop\Application\Controller\SearchController; use OxidEsales\Eshop\Application\Controller\SearchController;
use OxidEsales\Eshop\Application\Controller\StartController; use OxidEsales\Eshop\Application\Controller\StartController;
class BasketController_parent extends \OxidEsales\Eshop\Application\Controller\BasketController class BasketController_parent extends \OxidEsales\Eshop\Application\Controller\BasketController {}
{ class ThankYouController_parent extends \OxidEsales\Eshop\Application\Controller\ThankYouController {}
}
class ThankYouController_parent extends \OxidEsales\Eshop\Application\Controller\ThankYouController
{
}
class ArticleListController_AddToCartHelpMethods_parent extends ArticleListController class ArticleListController_AddToCartHelpMethods_parent extends ArticleListController {}
{
}
class ArticleDetailsController_parent extends \OxidEsales\Eshop\Application\Controller\ArticleDetailsController class ArticleDetailsController_parent extends \OxidEsales\Eshop\Application\Controller\ArticleDetailsController {}
{
}
class d3GtmAccountNoticeListController_parent extends AccountNoticeListController class d3GtmAccountNoticeListController_parent extends AccountNoticeListController {}
{
}
class d3GtmAccountRecommlistController_parent extends AccountRecommlistController class d3GtmAccountRecommlistController_parent extends AccountRecommlistController {}
{
}
class d3GtmAccountWishlistController_parent extends AccountWishlistController class d3GtmAccountWishlistController_parent extends AccountWishlistController {}
{
}
class d3GtmStartController_parent extends StartController class d3GtmStartController_parent extends StartController {}
{
}
class d3GtmSearchController_parent extends SearchController class d3GtmSearchController_parent extends SearchController {}
{
}
class d3GtmManufacturerListController_parent extends ManufacturerController class d3GtmManufacturerListController_parent extends ManufacturerController {}
{
}
} }
namespace D3\GoogleAnalytics4\Modules\Application\Component{ namespace D3\GoogleAnalytics4\Modules\Application\Component{
use OxidEsales\Eshop\Application\Component\BasketComponent; use OxidEsales\Eshop\Application\Component\BasketComponent;
class d3GtmBasketComponentExtension_parent extends BasketComponent class d3GtmBasketComponentExtension_parent extends BasketComponent {}
{
}
} }
namespace D3\GoogleAnalytics4\Modules\Application\Component\Widget{ namespace D3\GoogleAnalytics4\Modules\Application\Component\Widget{
use OxidEsales\Eshop\Application\Component\Widget\ArticleDetails; use OxidEsales\Eshop\Application\Component\Widget\ArticleDetails;
class d3GtmWidgetArticleDetails_parent extends ArticleDetails class d3GtmWidgetArticleDetails_parent extends ArticleDetails {}
{ }
}
}

View File

@ -4,6 +4,7 @@ declare(strict_types=1);
namespace D3\GoogleAnalytics4\Modules\Application\Component\Widget; namespace D3\GoogleAnalytics4\Modules\Application\Component\Widget;
class d3GtmWidgetArticleDetails extends d3GtmWidgetArticleDetails_parent class d3GtmWidgetArticleDetails extends d3GtmWidgetArticleDetails_parent
{ {
public function render() public function render()
@ -14,4 +15,4 @@ class d3GtmWidgetArticleDetails extends d3GtmWidgetArticleDetails_parent
return $return; return $return;
} }
} }

View File

@ -24,9 +24,9 @@ class d3GtmBasketComponentExtension extends d3GtmBasketComponentExtension_parent
$iAmountArticlesAddedToCart = (int) Registry::getRequest()->getRequestEscapedParameter('am'); $iAmountArticlesAddedToCart = (int) Registry::getRequest()->getRequestEscapedParameter('am');
if ($iAmountArticlesAddedToCart) { if ($iAmountArticlesAddedToCart){
Registry::getSession()->setVariable('d3GtmAddToCartAmountArticles', $iAmountArticlesAddedToCart); Registry::getSession()->setVariable('d3GtmAddToCartAmountArticles', $iAmountArticlesAddedToCart);
} else { }else{
Registry::getSession()->setVariable('d3GtmAddToCartAmountArticles', 1); Registry::getSession()->setVariable('d3GtmAddToCartAmountArticles', 1);
} }
@ -36,7 +36,7 @@ class d3GtmBasketComponentExtension extends d3GtmBasketComponentExtension_parent
/** /**
* @return int * @return int
*/ */
public function getD3GtmAddToCartAmountArticles(): int public function getD3GtmAddToCartAmountArticles() :int
{ {
$iAmount = Registry::getSession()->getVariable('d3GtmAddToCartAmountArticles'); $iAmount = Registry::getSession()->getVariable('d3GtmAddToCartAmountArticles');
@ -48,7 +48,7 @@ class d3GtmBasketComponentExtension extends d3GtmBasketComponentExtension_parent
/** /**
* @return bool * @return bool
*/ */
public function getAddToBasketDecision(): bool public function getAddToBasketDecision() :bool
{ {
$decision = Registry::getSession()->getVariable('d3GtmAddToBasketTrigger'); $decision = Registry::getSession()->getVariable('d3GtmAddToBasketTrigger');
@ -66,7 +66,7 @@ class d3GtmBasketComponentExtension extends d3GtmBasketComponentExtension_parent
$oArticle = null; $oArticle = null;
if ($sAnid) { if ($sAnid){
/** @var Article $oArticle */ /** @var Article $oArticle */
$oArticle = oxNew(Article::class); $oArticle = oxNew(Article::class);
$oArticle->load($sAnid); $oArticle->load($sAnid);
@ -74,4 +74,4 @@ class d3GtmBasketComponentExtension extends d3GtmBasketComponentExtension_parent
return $oArticle; return $oArticle;
} }
} }

View File

@ -12,4 +12,4 @@ class ArticleDetailsController extends ArticleDetailsController_parent
return $return; return $return;
} }
} }

View File

@ -12,4 +12,4 @@ class ArticleListController_AddToCartHelpMethods extends ArticleListController_A
return $render; return $render;
} }
} }

View File

@ -16,7 +16,7 @@ class BasketController extends BasketController_parent
public function render() public function render()
{ {
$return = parent::render(); $return = parent::render();
$this->d3GA4getRemovedArticlesListObject(); $this->d3GA4getRemovedArticlesListObject();
return $return; return $return;
@ -26,7 +26,7 @@ class BasketController extends BasketController_parent
* @return void * @return void
* @throws oxSystemComponentException * @throws oxSystemComponentException
*/ */
public function d3GA4getRemovedArticlesListObject(): void public function d3GA4getRemovedArticlesListObject() :void
{ {
$this->addTplParam('hasBeenReloaded', false); $this->addTplParam('hasBeenReloaded', false);
// collecting items to add // collecting items to add
@ -52,7 +52,7 @@ class BasketController extends BasketController_parent
'am' => $dAmount, 'am' => $dAmount,
'sel' => $aSel, 'sel' => $aSel,
'persparam' => $aPersParam, 'persparam' => $aPersParam,
'basketitemid' => $sBasketItemId, 'basketitemid' => $sBasketItemId
]; ];
} }
@ -84,9 +84,9 @@ class BasketController extends BasketController_parent
#dumpVar($this->getBasketArticles()); #dumpVar($this->getBasketArticles());
/** @var Article $item */ /** @var Article $item */
foreach ($oArtList->getArray() as $item) { foreach ($oArtList->getArray() as $item){
foreach ($artIdOnArtAmountList as $artId => $artAmount) { foreach ($artIdOnArtAmountList as $artId => $artAmount){
if ($item->getId() === $artId) { if ($item->getId() === $artId){
$item->assign(['d3AmountThatGotRemoved' => $artAmount]); $item->assign(['d3AmountThatGotRemoved' => $artAmount]);
} }
} }
@ -104,13 +104,13 @@ class BasketController extends BasketController_parent
* if that doesn't work, we check if there's an Article in the Products array, that has "'am' = 0" * if that doesn't work, we check if there's an Article in the Products array, that has "'am' = 0"
* Which also shows we're in that state rn * Which also shows we're in that state rn
*/ */
protected function isArticleRemovedState(array $productsArray): bool protected function isArticleRemovedState(array $productsArray) :bool
{ {
if (Registry::getRequest()->getRequestEscapedParameter('removeBtn') if (Registry::getRequest()->getRequestEscapedParameter('removeBtn')
or Registry::getRequest()->getRequestEscapedParameter('updateBtn') or Registry::getRequest()->getRequestEscapedParameter('updateBtn')
) { ){
return true; return true;
} else { }else{
foreach ($productsArray as $aProduct) { foreach ($productsArray as $aProduct) {
if (intval($aProduct['am']) === 0) { if (intval($aProduct['am']) === 0) {
return true; return true;

View File

@ -16,10 +16,10 @@ class ThankYouController extends ThankYouController_parent
$oOrder = $this->getOrder(); $oOrder = $this->getOrder();
$sCountryId = $oOrder->getFieldData('oxbillcountryid'); $sCountryId = $oOrder->getFieldData('oxbillcountryid');
/** @var Country::class $oCountry */ /** @var Country $oCountry */
$oCountry = oxNew(Country::class); $oCountry = oxNew(Country::class);
$oCountry->load($sCountryId); $oCountry->load($sCountryId);
return $oCountry; return $oCountry;
} }
} }

View File

@ -2,11 +2,9 @@
namespace D3\GoogleAnalytics4\Modules\Application\Controller; namespace D3\GoogleAnalytics4\Modules\Application\Controller;
use D3\GoogleAnalytics4\Application\Model\Constants;
class d3GtmAccountNoticeListController extends d3GtmAccountNoticeListController_parent class d3GtmAccountNoticeListController extends d3GtmAccountNoticeListController_parent
{ {
protected $_sThisTemplate = '@' . Constants::OXID_MODULE_ID . '/d3gtmnoticelist'; protected $_sThisTemplate = 'page/account/d3gtmnoticelist.tpl';
public function render() public function render()
{ {
@ -16,4 +14,4 @@ class d3GtmAccountNoticeListController extends d3GtmAccountNoticeListController_
return $return; return $return;
} }
} }

View File

@ -2,11 +2,9 @@
namespace D3\GoogleAnalytics4\Modules\Application\Controller; namespace D3\GoogleAnalytics4\Modules\Application\Controller;
use D3\GoogleAnalytics4\Application\Model\Constants;
class d3GtmAccountRecommlistController extends d3GtmAccountRecommlistController_parent class d3GtmAccountRecommlistController extends d3GtmAccountRecommlistController_parent
{ {
protected $_sThisTemplate = '@' . Constants::OXID_MODULE_ID . '/d3gtmrecommendationlist.tpl'; protected $_sThisTemplate = 'page/account/d3gtmrecommendationlist.tpl';
public function render() public function render()
{ {
@ -16,4 +14,4 @@ class d3GtmAccountRecommlistController extends d3GtmAccountRecommlistController_
return $return; return $return;
} }
} }

View File

@ -2,11 +2,9 @@
namespace D3\GoogleAnalytics4\Modules\Application\Controller; namespace D3\GoogleAnalytics4\Modules\Application\Controller;
use D3\GoogleAnalytics4\Application\Model\Constants;
class d3GtmAccountWishlistController extends d3GtmAccountWishlistController_parent class d3GtmAccountWishlistController extends d3GtmAccountWishlistController_parent
{ {
protected $_sThisTemplate = '@' . Constants::OXID_MODULE_ID . '/d3gtmwishlist'; protected $_sThisTemplate = 'page/account/d3gtmwishlist.tpl';
public function render() public function render()
{ {
@ -16,4 +14,4 @@ class d3GtmAccountWishlistController extends d3GtmAccountWishlistController_pare
return $return; return $return;
} }
} }

View File

@ -4,6 +4,7 @@ declare(strict_types=1);
namespace D3\GoogleAnalytics4\Modules\Application\Controller; namespace D3\GoogleAnalytics4\Modules\Application\Controller;
class d3GtmManufacturerListController extends d3GtmManufacturerListController_parent class d3GtmManufacturerListController extends d3GtmManufacturerListController_parent
{ {
public function render() public function render()
@ -14,4 +15,4 @@ class d3GtmManufacturerListController extends d3GtmManufacturerListController_pa
return $return; return $return;
} }
} }

View File

@ -4,6 +4,7 @@ declare(strict_types=1);
namespace D3\GoogleAnalytics4\Modules\Application\Controller; namespace D3\GoogleAnalytics4\Modules\Application\Controller;
class d3GtmSearchController extends d3GtmSearchController_parent class d3GtmSearchController extends d3GtmSearchController_parent
{ {
/** /**
@ -13,10 +14,10 @@ class d3GtmSearchController extends d3GtmSearchController_parent
{ {
$return = parent::render(); $return = parent::render();
if (false === in_array('oxcmp_basket', $this->getComponents())) { if (false === in_array('oxcmp_basket', $this->getComponents())){
$this->addTplParam('d3CmpBasket', $this->getComponent('oxcmp_basket')); $this->addTplParam('d3CmpBasket', $this->getComponent('oxcmp_basket'));
} }
return $return; return $return;
} }
} }

View File

@ -10,10 +10,10 @@ class d3GtmStartController extends d3GtmStartController_parent
{ {
$return = parent::render(); $return = parent::render();
if (false === in_array('oxcmp_basket', $this->getComponents())) { if (false === in_array('oxcmp_basket', $this->getComponents())){
$this->addTplParam('d3CmpBasket', $this->getComponent('oxcmp_basket')); $this->addTplParam('d3CmpBasket', $this->getComponent('oxcmp_basket'));
} }
return $return; return $return;
} }
} }

View File

@ -9,15 +9,15 @@ class Basket extends Basket_parent
/** /**
* @return string * @return string
*/ */
public function getPaymentOnPaymentId(): string public function getPaymentOnPaymentId() :string
{ {
if ($this->getPaymentId()) { if ($this->getPaymentId()){
$oPayment = oxNew(Payment::class); $oPayment = oxNew(Payment::class);
if ($oPayment->load($this->getPaymentId())) { if ($oPayment->load($this->getPaymentId())){
return $oPayment->getFieldData('oxdesc'); return $oPayment->getFieldData('oxdesc');
} }
} }
return "couldn't load payment!"; return "couldn't load payment!";
} }
} }

View File

@ -5,4 +5,4 @@ namespace D3\GoogleAnalytics4\Modules\Application\Model;
class Category extends Category_parent class Category extends Category_parent
{ {
use articleTreeStructure; use articleTreeStructure;
} }

View File

@ -5,4 +5,4 @@ namespace D3\GoogleAnalytics4\Modules\Application\Model;
class Manufacturer extends Manufacturer_parent class Manufacturer extends Manufacturer_parent
{ {
use articleTreeStructure; use articleTreeStructure;
} }

View File

@ -4,7 +4,8 @@ declare(strict_types=1);
namespace D3\GoogleAnalytics4\Modules\Application\Model; namespace D3\GoogleAnalytics4\Modules\Application\Model;
class Vendor extends \OxidEsales\Eshop\Application\Model\Vendor class Vendor extends \OxidEsales\Eshop\Application\Model\Vendor
{ {
use articleTreeStructure; use articleTreeStructure;
} }

View File

@ -2,60 +2,16 @@
namespace D3\GoogleAnalytics4\Modules\Application\Model; namespace D3\GoogleAnalytics4\Modules\Application\Model;
use OxidEsales\Eshop\Core\Registry;
use OxidEsales\Eshop\Core\ViewConfig;
trait articleTreeStructure trait articleTreeStructure
{ {
/**
* Get all parent category titles, starting from the base category.
*
* @return array
*/
protected function getParentCategoryTitles() :array
{
$parentTitles[] = $this->getTitle();
// we may be in Manufacturer, Vendor, etc.
if (method_exists($this, 'getParentCategory')) {
$parent = $this->getParentCategory();
while ($parent != null) {
$parentTitles[] = $parent->getTitle();
$parent = $parent->getParentCategory();
}
}
return array_reverse(array_map([$this, 'cleanUpTitle'], $parentTitles));
}
/**
* Cleanup title, decode entities, remove some chars and trim
*
* @param string $title
* @return string
*/
public function cleanUpTitle($title) :string
{
// remove unwanted characters, e.g. Zoll "
$charsToReplace = Registry::get(ViewConfig::class)->getCharsToReplaceInCategorTitles();
if (empty($charsToReplace)){
return $title;
}
// decode encoded characters
$title = html_entity_decode($title, ENT_QUOTES);
$title = preg_replace('/[' . $charsToReplace . ']/', '', $title);
// trim whitespace from both ends of the string
$title = trim($title);
return $title;
}
/** /**
* @param int $indexOfArray * @param int $indexOfArray
* @return string * @return string
*/ */
public function getSplitCategoryArray(int $indexOfArray = -1, bool $bShallTakeStd = false): string public function getSplitCategoryArray(int $indexOfArray = -1, bool $bShallTakeStd = false) :string
{ {
if ($bShallTakeStd){ if ($bShallTakeStd){
$bUseRealCatTitles = (bool)Registry::get(ViewConfig::class)->d3GetModuleConfigParam('_blUseRealCategoyTitles'); $splitCatArray =
$splitCatArray = $bUseRealCatTitles ? $this->getParentCategoryTitles() :
array_values( array_values(
array_filter( array_filter(
explode( explode(
@ -70,9 +26,9 @@ trait articleTreeStructure
) )
); );
if (($indexOfArray >= 0) and (false === empty($splitCatArray[$indexOfArray]))) { if (($indexOfArray >= 0) and (false === empty($splitCatArray[$indexOfArray]))){
return $splitCatArray[$indexOfArray]; return $splitCatArray[$indexOfArray];
} else { }else{
return ""; return "";
} }
} }
@ -85,4 +41,4 @@ trait articleTreeStructure
) )
); );
} }
} }

View File

@ -4,13 +4,17 @@ declare(strict_types=1);
namespace D3\GoogleAnalytics4\Modules\Application\Model; namespace D3\GoogleAnalytics4\Modules\Application\Model;
use OxidEsales\Eshop\Application\Model\Payment;
use OxidEsales\Eshop\Core\Registry;
class gtmPayment extends gtmPayment_parent class gtmPayment extends gtmPayment_parent
{ {
/** /**
* @return string * @return string
*/ */
public function gtmGetSelectedPaymentName(): string public function gtmGetSelectedPaymentName() :string
{ {
return (string)$this->getFieldData('oxpayments__oxdesc')?: 'No payment name available'; return $this->getFieldData('oxpayments__oxdesc')?: 'No payment name available';
} }
} }

View File

@ -1,5 +1,4 @@
<?php <?php
/** /**
* For the full copyright and license information, please view the LICENSE * For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code. * file that was distributed with this source code.
@ -18,21 +17,17 @@ use D3\GoogleAnalytics4\Application\Model\Constants;
use D3\GoogleAnalytics4\Application\Model\ManagerHandler; use D3\GoogleAnalytics4\Application\Model\ManagerHandler;
use D3\GoogleAnalytics4\Application\Model\ManagerTypes; use D3\GoogleAnalytics4\Application\Model\ManagerTypes;
use OxidEsales\Eshop\Application\Controller\FrontendController; use OxidEsales\Eshop\Application\Controller\FrontendController;
use OxidEsales\Eshop\Core\Config;
use OxidEsales\Eshop\Application\Model\User; use OxidEsales\Eshop\Application\Model\User;
use OxidEsales\Eshop\Core\Config;
use OxidEsales\Eshop\Core\Registry; use OxidEsales\Eshop\Core\Registry;
use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory; use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory;
use OxidEsales\EshopCommunity\Internal\Framework\Module\Configuration\Bridge\ModuleConfigurationDaoBridgeInterface; use OxidEsales\EshopCommunity\Internal\Framework\Module\Configuration\Bridge\ModuleSettingBridgeInterface;
use OxidEsales\EshopCommunity\Internal\Framework\Module\Configuration\Exception\ModuleConfigurationNotFoundException;
use OxidEsales\EshopCommunity\Internal\Framework\Module\Facade\ModuleSettingService;
use OxidEsales\EshopCommunity\Internal\Framework\Module\Facade\ModuleSettingServiceInterface;
use OxidEsales\EshopCommunity\Internal\Framework\Module\Setting\Setting;
use OxidEsales\EshopCommunity\Internal\Framework\Module\Setup\Bridge\ModuleActivationBridgeInterface;
use Psr\Container\ContainerExceptionInterface; use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface; use Psr\Container\NotFoundExceptionInterface;
class ViewConfig extends ViewConfig_parent class ViewConfig extends ViewConfig_parent
{ {
// Google Tag Manager Container ID // Google Tag Manager Container ID
private $sContainerId = null; private $sContainerId = null;
@ -44,7 +39,8 @@ class ViewConfig extends ViewConfig_parent
public function getGtmContainerId() public function getGtmContainerId()
{ {
if ($this->sContainerId === null) { if ($this->sContainerId === null)
{
$this->sContainerId = $this->d3GetModuleConfigParam("_sContainerID"); $this->sContainerId = $this->d3GetModuleConfigParam("_sContainerID");
} }
return $this->sContainerId; return $this->sContainerId;
@ -53,31 +49,23 @@ class ViewConfig extends ViewConfig_parent
/** /**
* @return void * @return void
*/ */
public function defineCookieManagerType(): void public function defineCookieManagerType() :void
{ {
if ($this->sCookieManagerType === null) { if ($this->sCookieManagerType === null)
{
/** @var ManagerHandler $oManagerHandler */ /** @var ManagerHandler $oManagerHandler */
$oManagerHandler = oxNew(ManagerHandler::class); $oManagerHandler = oxNew(ManagerHandler::class);
$this->sCookieManagerType = $oManagerHandler->getActManager(); $this->sCookieManagerType = $oManagerHandler->getCurrManager();
} }
} }
/** /**
* @return bool * @return bool
*/ */
public function shallUseOwnCookieManager(): bool public function shallUseOwnCookieManager() :bool
{ {
return (bool) $this->d3GetModuleConfigParam('_blEnableOwnCookieManager'); return (bool) $this->d3GetModuleConfigParam('_blEnableOwnCookieManager');
} }
/**
* @return string
*/
public function getCharsToReplaceInCategorTitles(): string
{
return (string) $this->d3GetModuleConfigParam('_sReplaceChars');
}
/** /**
* @return bool * @return bool
*/ */
@ -86,7 +74,7 @@ class ViewConfig extends ViewConfig_parent
/** @var Config $oConfig */ /** @var Config $oConfig */
$oConfig = Registry::getConfig(); $oConfig = Registry::getConfig();
if (false === $this->isGA4enabled()) { if (false === $this->isGA4enabled()){
return false; return false;
} }
@ -100,7 +88,7 @@ class ViewConfig extends ViewConfig_parent
$sCookieID = trim($this->d3GetModuleConfigParam('_sControlParameter')); $sCookieID = trim($this->d3GetModuleConfigParam('_sControlParameter'));
// Netensio Cookie Manager // Netensio Cookie Manager
if ($this->sCookieManagerType === ManagerTypes::INTERNAL_NET_COOKIE_MANAGER) { if ($this->sCookieManagerType === ManagerTypes::NET_COOKIE_MANAGER) {
$oSession = Registry::getSession(); $oSession = Registry::getSession();
$aCookies = $oSession->getVariable("aCookieSel"); $aCookies = $oSession->getVariable("aCookieSel");
@ -108,23 +96,26 @@ class ViewConfig extends ViewConfig_parent
} }
// Aggrosoft Cookie Consent // Aggrosoft Cookie Consent
if ($this->sCookieManagerType === ManagerTypes::INTERNAL_AGCOOKIECOMPLIANCE) { if ($this->sCookieManagerType === ManagerTypes::AGCOOKIECOMPLIANCE) {
if (method_exists($this, "isCookieCategoryEnabled")) { if (method_exists($this, "isCookieCategoryEnabled")) {
return $this->isCookieCategoryEnabled($sCookieID); return $this->isCookieCategoryEnabled($sCookieID);
} }
} }
// UserCentrics or consentmanager
if ( if (
in_array( $this->sCookieManagerType === Usercentrics::sModuleIncludationInternalName
$this->sCookieManagerType, or $this->sCookieManagerType === Usercentrics::sExternalIncludationInternalName
(oxNew(ManagerTypes::class)->scriptTagDeliveredByDefaultArray()) or $this->sCookieManagerType === ManagerTypes::CONSENTMANAGER
) or $this->sCookieManagerType === ManagerTypes::COOKIEFIRST
) { or $this->sCookieManagerType === ManagerTypes::COOKIEBOT
or $this->sCookieManagerType === ManagerTypes::EXTERNAL_SERVICE
)
{
// Always needs the script-tags delivered to the DOM. // Always needs the script-tags delivered to the DOM.
return true; return true;
} }
// Cookie Manager not (yet) supported
return false; return false;
} }
@ -133,30 +124,32 @@ class ViewConfig extends ViewConfig_parent
* This is especially important for UserCentrics. * This is especially important for UserCentrics.
* @return string * @return string
*/ */
public function getGtmScriptAttributes(): string public function getGtmScriptAttributes() :string
{ {
$sControlParameter = trim($this->d3GetModuleConfigParam('_sControlParameter')); $sControlParameter = trim($this->d3GetModuleConfigParam('_sControlParameter'));
if (false === $this->shallUseOwnCookieManager() or ($sControlParameter === '')) { if (false === $this->shallUseOwnCookieManager() or ($sControlParameter === '')){
return ""; return "";
} }
if ( if (
$this->sCookieManagerType === Usercentrics::sModuleIncludationInternalName $this->sCookieManagerType === Usercentrics::sModuleIncludationInternalName
or $this->sCookieManagerType === Usercentrics::sExternalIncludationInternalName or $this->sCookieManagerType === Usercentrics::sExternalIncludationInternalName
) { )
{
return 'data-usercentrics="' . $sControlParameter . '" type="text/plain" async=""'; return 'data-usercentrics="' . $sControlParameter . '" type="text/plain" async=""';
} }
if ($this->sCookieManagerType === ManagerTypes::INTERNAL_CONSENTMANAGER) { if ($this->sCookieManagerType === ManagerTypes::CONSENTMANAGER)
{
return 'type="text/plain" class="cmplazyload" data-cmp-vendor="'.$sControlParameter.'"'; return 'type="text/plain" class="cmplazyload" data-cmp-vendor="'.$sControlParameter.'"';
} }
if ($this->sCookieManagerType === ManagerTypes::INTERNAL_COOKIEFIRST) { if ($this->sCookieManagerType === ManagerTypes::COOKIEFIRST){
return 'type="text/plain" data-cookiefirst-category="' . $sControlParameter .'"'; return 'type="text/plain" data-cookiefirst-category="' . $sControlParameter .'"';
} }
if ($this->sCookieManagerType === ManagerTypes::INTERNAL_COOKIEBOT) { if ($this->sCookieManagerType === ManagerTypes::COOKIEBOT){
return 'type="text/plain" data-cookieconsent="' . $sControlParameter .'"'; return 'type="text/plain" data-cookieconsent="' . $sControlParameter .'"';
} }
@ -169,23 +162,22 @@ class ViewConfig extends ViewConfig_parent
*/ */
public function isGA4enabled() public function isGA4enabled()
{ {
if ($this->blGA4enabled === null) { if ($this->blGA4enabled === null)
$this->blGA4enabled = $this->d3GetModuleConfigParam("_blEnableGa4"); {
$this->blGA4enabled = $this->d3GetModuleConfigParam("_blEnableGA4");
} }
return $this->blGA4enabled; return $this->blGA4enabled;
} }
public function isGtmConsentModeSetActivated(): bool public function isGtmConsentModeSetActivated() :bool
{ {
return $this->d3GetModuleConfigParam("_blEnableConsentMode") ?: false; return $this->d3GetModuleConfigParam("_blEnableConsentMode")?: false;
} }
public function getGtmDataLayer() public function getGtmDataLayer()
{ {
if (!$this->getGtmContainerId()) { if (!$this->getGtmContainerId()) return "[]";
return "[]";
}
$oConfig = Registry::getConfig(); $oConfig = Registry::getConfig();
$oView = $oConfig->getTopActiveView(); $oView = $oConfig->getTopActiveView();
@ -216,48 +208,23 @@ class ViewConfig extends ViewConfig_parent
'sessionid' => session_id(), 'sessionid' => session_id(),
//'httpref' => $_SERVER["HTTP_REFERER"] ?? "unknown" //'httpref' => $_SERVER["HTTP_REFERER"] ?? "unknown"
]; ];
$dataLayer = $this->d3AdditionalGlobalAnalyticsVariables($dataLayer);
return json_encode([$dataLayer], JSON_PRETTY_PRINT); return json_encode([$dataLayer], JSON_PRETTY_PRINT);
} }
/**
* @param array $dataLayerGlobals
* @return array
*/
public function d3AdditionalGlobalAnalyticsVariables(array $dataLayerGlobals) :array
{
/** @var User $oUser */
$oUser = Registry::getSession()->getUser();
if ($oUser and $oUser->getFieldData('OXUSERNAME')){
$sUsername = $oUser->getFieldData('OXUSERNAME') ?: "";
$iCustNr = $oUser->getFieldData('OXCUSTNR') ?: "";
$iZipCode = $oUser->getFieldData('OXZIP') ?: "";
return array_merge($dataLayerGlobals, [
'custnr' => $iCustNr,
'email' => $sUsername,
'zipcode' => $iZipCode
]);
}
return $dataLayerGlobals;
}
/**
* @return bool
*/
public function isDebugModeOn() :bool public function isDebugModeOn() :bool
{ {
return $this->d3GetModuleConfigParam("_blEnableDebug")?: false; return $this->d3GetModuleConfigParam("_blEnableDebug")?: false;
} }
/** /**
* @return bool * @return string
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/ */
public function useRealCategoryTitles(): bool public function getServerSidetaggingJsDomain() :string
{ {
return $this->d3GetModuleConfigParam("_blUseRealCategoyTitles") ?: false; return $this->d3GetModuleConfigParam("_sServersidetagging_js")?: "";
} }
/** /**
@ -265,69 +232,24 @@ class ViewConfig extends ViewConfig_parent
* @throws ContainerExceptionInterface * @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface * @throws NotFoundExceptionInterface
*/ */
public function getServerSidetaggingJsDomain(): string public function getServerSidetaggingNoJsDomain() :string
{ {
return $this->d3GetModuleConfigParam("_sServersidetagging_js") ?: ""; return $this->d3GetModuleConfigParam('_sServersidetagging_nojs')?: "";
} }
/** /**
* @return string * @param string $configParamName
* @throws ContainerExceptionInterface * @return mixed
* @throws NotFoundExceptionInterface
*/ */
public function getServerSidetaggingNoJsDomain(): string public function d3GetModuleConfigParam(string $configParamName)
{ {
return $this->d3GetModuleConfigParam('_sServersidetagging_nojs') ?: ""; return Registry::getConfig()->getShopConfVar(Constants::OXID_MODULE_ID.$configParamName, null, Constants::OXID_MODULE_ID);
} }
/**
* @param string $configParamName
* @param bool $displayThrowable
* @return bool|object|string
*/
public function d3GetModuleConfigParam(string $configParamName, bool $displayThrowable = false)
{
try {
return $this->d3GetGa4ModuleConfigurationBridge()->getModuleSetting(Constants::OXID_MODULE_ID.$configParamName)->getValue();
} catch (\Throwable $throwable) {
if ($displayThrowable){
Registry::getUtilsView()->addErrorToDisplay($throwable);
}
Registry::getLogger()->error($throwable->getMessage());
}
}
/**
* @return \OxidEsales\EshopCommunity\Internal\Framework\Module\Configuration\DataObject\ModuleConfiguration
* @throws \Psr\Container\ContainerExceptionInterface
* @throws \Psr\Container\NotFoundExceptionInterface
*/
public function d3GetGa4ModuleConfigurationBridge() :\OxidEsales\EshopCommunity\Internal\Framework\Module\Configuration\DataObject\ModuleConfiguration
{
/** @var \OxidEsales\EshopCommunity\Internal\Framework\Module\Configuration\DataObject\ModuleConfiguration $oModuleSettingsBridge */
return ContainerFactory::getInstance()
->getContainer()
->get(ModuleConfigurationDaoBridgeInterface::class)->get(Constants::OXID_MODULE_ID);
}
/**
* @return array
*/
public function d3GetModuleSettingNameArray() :array
{
$tmp = [];
foreach ($this->d3GetGa4ModuleConfigurationBridge()->getModuleSettings() as $arrayEntry){
$tmp[] = $arrayEntry->getName();
}
return $tmp;
}
/** /**
* @return bool * @return bool
*/ */
public function d3IsUsercentricsCMPChosen(): bool public function d3IsUsercentricsCMPChosen() :bool
{ {
$sCMPPubName = $this->d3GetModuleConfigParam('_HAS_STD_MANAGER'); $sCMPPubName = $this->d3GetModuleConfigParam('_HAS_STD_MANAGER');
$aPossibleCMP = (oxNew(ManagerTypes::class))->getManagerList(); $aPossibleCMP = (oxNew(ManagerTypes::class))->getManagerList();
@ -335,26 +257,4 @@ class ViewConfig extends ViewConfig_parent
return (bool) ($sCMPPubName === Usercentrics::sExternalIncludationInternalName return (bool) ($sCMPPubName === Usercentrics::sExternalIncludationInternalName
or $sCMPPubName === Usercentrics::sModuleIncludationInternalName); or $sCMPPubName === Usercentrics::sModuleIncludationInternalName);
} }
}
/**
* @return bool
*/
public function d3IsModuleActive(string $sModuleId): bool
{
/** @var ModuleActivationBridgeInterface $moduleActivationBridge */
$moduleActivationBridge = $this
->getContainer()
->get(ModuleActivationBridgeInterface::class);
try {
$isActiveBool = $moduleActivationBridge->isActive(
$sModuleId,
Registry::getConfig()->getShopId()
);
} catch (\Exception|ModuleConfigurationNotFoundException $e) {
return false;
}
return (bool) $isActiveBool;
}
}

View File

@ -4,8 +4,7 @@ namespace D3\GoogleAnalytics4\Modules\Core;
use OxidEsales\EshopCommunity\Core\Registry; use OxidEsales\EshopCommunity\Core\Registry;
class WidgetControl extends WidgetControl_parent class WidgetControl extends WidgetControl_parent{
{
protected function getFrontendStartControllerKey() // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore protected function getFrontendStartControllerKey() // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
{ {
/* /*
@ -28,15 +27,17 @@ class WidgetControl extends WidgetControl_parent
) )
*/ */
$sScriptName = $_SERVER['SCRIPT_NAME']; $sScriptName = $_SERVER['SCRIPT_NAME'];
if ($sScriptName !== '/widget.php') { if($sScriptName !== '/widget.php')
{
return parent::getFrontendStartControllerKey(); return parent::getFrontendStartControllerKey();
} }
$aParameter = $_GET; $aParameter = $_GET;
if (is_null($aParameter['actcontrol']) and is_null($aParameter['oxwparent'])) { if(is_null($aParameter['actcontrol']) and is_null($aParameter['oxwparent']))
{
return 'D3\GoogleAnalytics4\Application\Component\Widget\d3GtmStartWidget'; return 'D3\GoogleAnalytics4\Application\Component\Widget\d3GtmStartWidget';
} }
return parent::getFrontendStartControllerKey(); return parent::getFrontendStartControllerKey();
} }
} }

View File

@ -23,21 +23,11 @@ Dieses Paket erfordert einen mit Composer installierten OXID eShop in einer in d
Ă–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. Ă–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.
```bash ```bash
php composer require d3/google-analytics4:^3 php composer require d3/google-analytics4:^2
``` ```
Sofern nötig, bestätigen Sie bitte, dass Sie `package-name` erlauben, Code auszuführen. Sofern nötig, bestätigen Sie bitte, dass Sie `package-name` erlauben, Code auszuführen.
```bash
./vendor/bin/oe-console oe:module:deactivate d3googleanalytics4
./vendor/bin/oe-console oe:module:install ./vendor/d3/google-analytics4/
./vendor/bin/oe-console oe:module:activate d3googleanalytics4
./vendor/bin/oe-eshop-db_views_generate
```
Leeren Sie anschlieĂźend den Temp Ordner des Shops.
Aktivieren Sie das Modul im Shopadmin unter "Erweiterungen -> Module". Aktivieren Sie das Modul im Shopadmin unter "Erweiterungen -> Module".
### Wichtig! ### Wichtig!

View File

@ -4,6 +4,7 @@ declare(strict_types=1);
namespace D3\GoogleAnalytics4\Setup; namespace D3\GoogleAnalytics4\Setup;
use D3\GoogleAnalytics4\Application\Model\Constants; use D3\GoogleAnalytics4\Application\Model\Constants;
use OxidEsales\Eshop\Core\Registry; use OxidEsales\Eshop\Core\Registry;
use OxidEsales\Eshop\Core\ViewConfig; use OxidEsales\Eshop\Core\ViewConfig;
@ -16,11 +17,10 @@ class Actions
* @param string $sSettingValue * @param string $sSettingValue
* @return void * @return void
*/ */
public function d3SaveDefaultSettings(string $sVarType, string $sSettingName, string $sSettingValue) public function d3SaveDefaultSettings(string $sVarType, string $sSettingName, string $sSettingValue){
{
$oConfig = Registry::getConfig(); $oConfig = Registry::getConfig();
if ($this->d3GetModuleConfigParam($sSettingName) and (trim($this->d3GetModuleConfigParam($sSettingName)) !== trim($sSettingValue))) { if ($this->d3GetModuleConfigParam($sSettingName) and (trim($this->d3GetModuleConfigParam($sSettingName)) !== trim($sSettingValue))){
$sSettingValue = trim($this->d3GetModuleConfigParam($sSettingName)); $sSettingValue = trim($this->d3GetModuleConfigParam($sSettingName));
} }
@ -41,4 +41,4 @@ class Actions
{ {
return Registry::getConfig()->getShopConfVar(Constants::OXID_MODULE_ID.$configParamName, null, Constants::OXID_MODULE_ID); return Registry::getConfig()->getShopConfVar(Constants::OXID_MODULE_ID.$configParamName, null, Constants::OXID_MODULE_ID);
} }
} }

View File

@ -4,6 +4,7 @@ declare(strict_types=1);
namespace D3\GoogleAnalytics4\Setup; namespace D3\GoogleAnalytics4\Setup;
class Events class Events
{ {
/** /**
@ -32,7 +33,5 @@ class Events
/** /**
* @return void * @return void
*/ */
public static function onDeactivate() public static function onDeactivate(){}
{ }
}
}

View File

@ -1,11 +0,0 @@
<FilesMatch ".*">
<IfModule mod_authz_core.c>
# Apache 2.4
Require all granted
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
order deny,allow
allow from all
</IfModule>
</FilesMatch>

View File

@ -28,25 +28,29 @@
"homepage": "https://www.d3data.de" "homepage": "https://www.d3data.de"
} }
], ],
"supports": { "support": {
"email": "support@shopmodule.com" "email": "support@shopmodule.com"
}, },
"require": { "extra": {
"php": "^8.0", "oxideshop": {
"oxid-esales/oxideshop-ce": "7.0 - 7.2", "blacklist-filter": [
"google/apiclient":" ^2.0" "*.md",
}, "composer.json",
"require-dev": { ".php-cs-fixer.php",
"friendsofphp/php-cs-fixer": "^3.9", "*.neon"
"phpstan/phpstan": "^1.10" ],
}, "target-directory": "d3/googleanalytics4"
"autoload": {
"psr-4": {
"D3\\GoogleAnalytics4\\": ""
} }
}, },
"scripts": { "require": {
"php-cs-fixer_audit": "./vendor/bin/php-cs-fixer list-files --config=./vendor/d3/google-analytics4/.php-cs-fixer.php", "php": "7.1 - 8.2",
"php-cs-fixer_fix": "./vendor/bin/php-cs-fixer fix --config=./vendor/d3/google-analytics4/.php-cs-fixer.php" "oxid-esales/oxideshop-ce": "^6.5.3",
"google/apiclient":" ^2.0",
"phpstan/phpstan": "^1.10"
},
"autoload": {
"psr-4": {
"D3\\GoogleAnalytics4\\": "../../../source/modules/d3/googleanalytics4"
}
} }
} }

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="ISO-8859-15"?> <?xml version="1.0" encoding="ISO-8859-15"?>
<OX> <OX>
<OXMENU id="D3MXDMODULES"> <OXMENU id="d3mxd3modules">
<MAINMENU id="D3MXGOOGLEANALYTICS4"> <MAINMENU id="d3mxgoogleanalytics4">
<SUBMENU id="D3MXGOOGLEANALYTICS4SET" cl="d3googleanalytics4_main"/> <SUBMENU id="d3mxgoogleanalytics4set" cl="d3googleanalytics4_main"/>
</MAINMENU> </MAINMENU>
</OXMENU> </OXMENU>
</OX> </OX>

View File

@ -52,12 +52,12 @@ $aModule = [
Die Entwicklung basiert auf einem Fork von Marat Bedoev - <a href='https://github.com/vanilla-thunder/oxid-module-gtm'>Github-Link</a> 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', 'thumbnail' => 'thumbnail.png',
'version' => '3.1.0.0', 'version' => '2.21.0',
'author' => 'Data Development (Inh.: Thomas Dartsch)', 'author' => 'Data Development (Inh.: Thomas Dartsch)',
'email' => 'support@shopmodule.com', 'email' => 'support@shopmodule.com',
'url' => 'https://www.oxidmodule.com/', 'url' => 'https://www.oxidmodule.com/',
'controllers' => [ 'controllers' => [
'd3googleanalytics4_main' => GA4AdminUserInterfaceMainController::class, 'd3googleanalytics4_main' => GA4AdminUserInterfaceMainController::class
], ],
'extend' => [ 'extend' => [
// Core // Core
@ -88,204 +88,119 @@ $aModule = [
], ],
'templates' => [ 'templates' => [
// Event files that store the GA4 Event-Information // Event files that store the GA4 Event-Information
'@' . Constants::OXID_MODULE_ID . '/event/add_to_cart.tpl' => 'views/smarty/event/add_to_cart.tpl', 'event/add_to_cart.tpl' => 'd3/googleanalytics4/Application/views/event/add_to_cart.tpl',
'@' . Constants::OXID_MODULE_ID . '/event/view_item.tpl' => 'views/smarty/event/view_item.tpl', 'event/view_item.tpl' => 'd3/googleanalytics4/Application/views/event/view_item.tpl',
'@' . Constants::OXID_MODULE_ID . '/event/view_cart.tpl' => 'views/smarty/event/view_cart.tpl', 'event/view_item.tpl' => 'd3/googleanalytics4/Application/views/event/view_item.tpl',
'@' . Constants::OXID_MODULE_ID . '/event/begin_checkout.tpl' => 'views/smarty/event/begin_checkout.tpl', 'event/begin_checkout.tpl' => 'd3/googleanalytics4/Application/views/event/begin_checkout.tpl',
'@' . Constants::OXID_MODULE_ID . '/event/add_payment_info.tpl' => 'views/smarty/event/add_payment_info.tpl', 'event/add_payment_info.tpl' => 'd3/googleanalytics4/Application/views/event/add_payment_info.tpl',
'@' . Constants::OXID_MODULE_ID . '/event/purchase.tpl' => 'views/smarty/event/purchase.tpl', 'event/purchase.tpl' => 'd3/googleanalytics4/Application/views/event/purchase.tpl',
'@' . Constants::OXID_MODULE_ID . '/event/view_item_list.tpl' => 'views/smarty/event/view_item_list.tpl', 'event/view_item_list.tpl' => 'd3/googleanalytics4/Application/views/event/view_item_list.tpl',
'@' . Constants::OXID_MODULE_ID . '/event/view_search_result.tpl' => 'views/smarty/event/view_search_result.tpl', 'event/view_search_result.tpl' => 'd3/googleanalytics4/Application/views/event/view_search_result.tpl',
'@' . Constants::OXID_MODULE_ID . '/event/remove_from_cart.tpl' => 'views/smarty/event/remove_from_cart.tpl', 'event/remove_from_cart.tpl' => 'd3/googleanalytics4/Application/views/event/remove_from_cart.tpl',
// complete overwritten file of OXID-Originals // complete overwritten file of OXID-Originals
// the path of the template-name is the original path to the file in OXID-context from tpl/-> // the path of the template-name is the original path to the file in OXID-context from tpl/->
'@' . Constants::OXID_MODULE_ID . '/d3gtmnoticelist.tpl' => 'views/smarty/d3gtmnoticelist.tpl', 'page/account/d3gtmnoticelist.tpl' => 'd3/googleanalytics4/Application/views/tpl/page/account/d3gtmnoticelist.tpl',
'@' . Constants::OXID_MODULE_ID . '/d3gtmrecommendationlist.tpl' => 'views/smarty/d3gtmrecommendationlist.tpl', 'page/account/d3gtmrecommendationlist.tpl' => 'd3/googleanalytics4/Application/views/tpl/page/account/d3gtmrecommendationlist.tpl',
'@' . Constants::OXID_MODULE_ID . '/d3gtmwishlist.tpl' => 'views/smarty/d3gtmwishlist.tpl', 'page/account/d3gtmwishlist.tpl' => 'd3/googleanalytics4/Application/views/tpl/page/account/d3gtmwishlist.tpl',
// Admin Templates // Admin Templates
'@' . Constants::OXID_MODULE_ID . '/admin/d3ga4uimain.tpl' => 'views/smarty/admin/d3googleanalytics4_main.tpl', 'ga4/admin/d3ga4uimain.tpl' => 'd3/googleanalytics4/Application/views/admin/tpl/d3googleanalytics4_main.tpl',
'@' . Constants::OXID_MODULE_ID . '/admin/d3ga4uiheaditem.tpl' => 'views/smarty/admin/d3googleanalytics4_headitem.tpl', 'ga4/admin/d3ga4uiheaditem.tpl' => 'd3/googleanalytics4/Application/views/admin/tpl/d3googleanalytics4_headitem.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' => 'views/smarty/blocks/_gtm_js.tpl', 'file' => '/Application/views/blocks/_gtm_js.tpl',
'position' => 150, 'position' => 150
], ],
// tag manager nojs // tag manager nojs
[ [
'template' => 'layout/base.tpl', 'template' => 'layout/base.tpl',
'block' => 'theme_svg_icons', 'block' => 'theme_svg_icons',
'file' => 'views/smarty/blocks/_gtm_nojs.tpl', 'file' => '/Application/views/blocks/_gtm_nojs.tpl'
'position' => 150,
], ],
// details // details
[ [
'template' => 'page/details/inc/productmain.tpl', 'template' => 'page/details/inc/productmain.tpl',
'block' => 'details_productmain_title', 'block' => 'details_productmain_title',
'file' => 'views/smarty/blocks/view_item.tpl', 'file' => '/Application/views/blocks/view_item.tpl',
'position' => 150, 'position' => 150
], ],
// View Cart // View Cart
[ [
'template' => 'page/checkout/basket.tpl', 'template' => 'page/checkout/basket.tpl',
'block' => 'checkout_basket_main', 'block' => 'checkout_basket_main',
'file' => 'views/smarty/blocks/view_cart.tpl', 'file' => '/Application/views/blocks/view_cart.tpl'
'position' => 150,
], ],
// add_to_cart // add_to_cart
[ [
'template' => 'page/details/inc/productmain.tpl', 'template' => 'page/details/inc/productmain.tpl',
'block' => 'details_productmain_tobasket', 'block' => 'details_productmain_tobasket',
'file' => 'views/smarty/blocks/details_productmain_tobasket.tpl', 'file' => '/Application/views/blocks/details_productmain_tobasket.tpl',
'position' => 150, 'position' => 150
], ],
// remove_from_cart // remove_from_cart
[ [
'template' => 'page/checkout/basket.tpl', 'template' => 'page/checkout/basket.tpl',
'block' => 'checkout_basket_main', 'block' => 'checkout_basket_main',
'file' => 'views/smarty/blocks/remove_from_cart.tpl', 'file' => '/Application/views/blocks/remove_from_cart.tpl',
'position' => 150, 'position' => 150
], ],
[ [
'template' => 'page/checkout/thankyou.tpl', 'template' => 'page/checkout/thankyou.tpl',
'block' => 'checkout_thankyou_main', 'block' => 'checkout_thankyou_main',
'file' => 'views/smarty/blocks/purchase.tpl', 'file' => '/Application/views/blocks/purchase.tpl'
'position' => 150,
], ],
// Lists // Lists
// view_item_list // view_item_list
[ [
'template' => 'page/list/list.tpl', 'template' => 'page/list/list.tpl',
'block' => 'page_list_productlist', 'block' => 'page_list_productlist',
'file' => 'views/smarty/blocks/view_item_list.tpl', 'file' => '/Application/views/blocks/view_item_list.tpl',
'position' => 150, 'position' => 150
], ],
// view_search_result // view_search_result
[ [
'template' => 'page/search/search.tpl', 'template' => 'page/search/search.tpl',
'block' => 'search_results', 'block' => 'search_results',
'file' => 'views/smarty/blocks/view_search_result.tpl', 'file' => '/Application/views/blocks/view_search_result.tpl',
'position' => 150, 'position' => 150
], ],
[ [
'template' => 'page/list/list.tpl', 'template' => 'page/list/list.tpl',
'block' => 'page_list_listbody', 'block' => 'page_list_listbody',
'file' => 'views/smarty/blocks/page_list_listbody.tpl', 'file' => '/Application/views/blocks/page_list_listbody.tpl',
'position' => 150, 'position' => 150
], ],
[ [
'template' => 'page/shop/start.tpl', 'template' => 'page/shop/start.tpl',
'block' => 'start_welcome_text', 'block' => 'start_welcome_text',
'file' => 'views/smarty/blocks/start_welcome_text.tpl', 'file' => '/Application/views/blocks/start_welcome_text.tpl',
'position' => 150, 'position' => 150
], ],
// Checkout process // Checkout process
// Begin CHeckout // Begin CHeckout
[ [
'template' => 'page/checkout/user.tpl', 'template' => 'page/checkout/user.tpl',
'block' => 'checkout_user_main', 'block' => 'checkout_user_main',
'file' => 'views/smarty/blocks/begin_checkout.tpl', 'file' => '/Application/views/blocks/begin_checkout.tpl',
'position' => 150, 'position' => 150
], ],
// Add payment info
// We add it into checkout_order_main ( checkout/order.tpl ) to make sure a payment is actually added;
// we'll also do it like that in the future for add_shipping_info ( not planed yet )
[ [
'template' => 'page/checkout/order.tpl', 'template' => 'page/checkout/order.tpl',
'block' => 'checkout_order_main', 'block' => 'checkout_order_main',
'file' => 'views/smarty/blocks/add_payment_info.tpl', 'file' => '/Application/views/blocks/add_payment_info.tpl',
'position' => 150, 'position' => 150
], ],
], ],
'settings' => [
/* String values */
[
'name' => Constants::OXID_MODULE_ID.'_sContainerID',
'type' => 'str',
'value' => 'GTM-'
],
[
'name' => Constants::OXID_MODULE_ID.'_sControlParameter',
'type' => 'str',
'value' => ''
],
[
'name' => Constants::OXID_MODULE_ID.'_sServersidetagging_js',
'type' => 'str',
'value' => 'https://www.googletagmanager.com/gtm.js'
],
[
'name' => Constants::OXID_MODULE_ID.'_sServersidetagging_nojs',
'type' => 'str',
'value' => 'https://www.googletagmanager.com/ns.html'
],
[
'name' => Constants::OXID_MODULE_ID.'_sReplaceChars',
'type' => 'str',
'value' => ''
],
[
'name' => Constants::OXID_MODULE_ID.'_sMeasurementCapabilities',
'type' => 'str',
'value' => ''
],
[
'name' => Constants::OXID_MODULE_ID.'_sUsercentricsConsentModeApi',
'type' => 'str',
'value' => 'Testshop'
],
[
'name' => Constants::OXID_MODULE_ID.'_HAS_STD_MANAGER',
'type' => 'str',
'value' => 'externalService'
],
/* Bool values */
[
'name' => Constants::OXID_MODULE_ID.'_blEnableGa4',
'type' => 'bool',
'value' => false
],
[
'name' => Constants::OXID_MODULE_ID.'_blEnableDebug',
'type' => 'bool',
'value' => false
],
[
'name' => Constants::OXID_MODULE_ID.'_blEnableConsentMode',
'type' => 'bool',
'value' => false
],
[
'name' => Constants::OXID_MODULE_ID.'_blEnableOwnCookieManager',
'type' => 'bool',
'value' => false
],
[
'name' => Constants::OXID_MODULE_ID.'_blViewItemAddVariants',
'type' => 'bool',
'value' => false
],
[
'name' => Constants::OXID_MODULE_ID.'_blUseRealCategoyTitles',
'type' => 'bool',
'value' => false
],
[
'name' => Constants::OXID_MODULE_ID.'_blEnableMeasurementCapabilities',
'type' => 'bool',
'value' => false
],
[
'name' => Constants::OXID_MODULE_ID.'_blEnableUsercentricsConsentModeApi',
'type' => 'bool',
'value' => false
]
],
'events' => [ 'events' => [
'onActivate' => '\D3\GoogleAnalytics4\Setup\Events::onActivate', 'onActivate' => '\D3\GoogleAnalytics4\Setup\Events::onActivate',
'onDeactivate' => '\D3\GoogleAnalytics4\Setup\Events::onDeactivate', 'onDeactivate' => '\D3\GoogleAnalytics4\Setup\Events::onDeactivate',
], ],
]; ];

0
assets/thumbnail.png → thumbnail.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

View File

@ -1,3 +0,0 @@
[{$smarty.block.parent}]
[{include file="@d3googleanalytics4/event/add_payment_info.tpl"}]

View File

@ -1,3 +0,0 @@
[{$smarty.block.parent}]
[{include file="@d3googleanalytics4/event/begin_checkout.tpl"}]

View File

@ -1,3 +0,0 @@
[{$smarty.block.parent}]
[{include file='@d3googleanalytics4/event/add_to_cart.tpl' htmlIdAmountOfArticles='#amountToBasket'}]

View File

@ -1,3 +0,0 @@
[{$smarty.block.parent}]
[{include file='@d3googleanalytics4/event/add_to_cart.tpl' htmlIdAmountOfArticles='#amountToBasket'}]

View File

@ -1,3 +0,0 @@
[{$smarty.block.parent}]
[{include file="@d3googleanalytics4/event/purchase.tpl"}]

View File

@ -1,3 +0,0 @@
[{$smarty.block.parent}]
[{include file="@d3googleanalytics4/event/remove_from_cart.tpl"}]

View File

@ -1,3 +0,0 @@
[{$smarty.block.parent}]
[{include file='@d3googleanalytics4/event/add_to_cart.tpl' htmlIdAmountOfArticles='#amountToBasket'}]

View File

@ -1,3 +0,0 @@
[{$smarty.block.parent}]
[{include file="@d3googleanalytics4/event/view_cart.tpl"}]

View File

@ -1,3 +0,0 @@
[{$smarty.block.parent}]
[{include file="@d3googleanalytics4/event/view_item.tpl"}]

View File

@ -1,3 +0,0 @@
[{$smarty.block.parent}]
[{include file="@d3googleanalytics4/event/view_item_list.tpl"}]

View File

@ -1,3 +0,0 @@
[{$smarty.block.parent}]
[{include file="@d3googleanalytics4/event/view_search_result.tpl"}]

View File

@ -1,61 +0,0 @@
[{assign var="gtmProduct" value=$oView->getProduct()}]
[{assign var="gtmCategory" value=$gtmProduct->getCategory()}]
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
[{block name="d3_ga4_view_item_block"}]
[{capture name="d3_ga4_view_item"}]
[{strip}]
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
dataLayer.push({
'event': 'view_item',
'eventLabel':'Product View',
'ecommerce':
{
'currency': '[{$currency->name}]',
'items':
[
{
'item_oxid': '[{$gtmProduct->getFieldData("oxid")}]',
'item_name': '[{$gtmProduct->getRawFieldData("oxtitle")}]',
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
'item_variant': '[{if $gtmProduct->getFieldData("oxvarselect")}][{$gtmProduct->getFieldData("oxvarselect")}][{/if}]',
[{if $gtmCategory}]
'item_category': '[{$gtmCategory->getSplitCategoryArray(0, true)}]',
'item_category2': '[{$gtmCategory->getSplitCategoryArray(1, true)}]',
'item_category3': '[{$gtmCategory->getSplitCategoryArray(2, true)}]',
'item_category4': '[{$gtmCategory->getSplitCategoryArray(3, true)}]',
'item_list_name': '[{$gtmCategory->getSplitCategoryArray()}]',
[{/if}]
[{assign var="d3PriceObject" value=$gtmProduct->getPrice()}]
'price': [{$d3PriceObject->getPrice()}]
}
[{if $oViewConf->d3GetModuleConfigParam('_blViewItemAddVariants')}],
[{foreach from=$gtmProduct->getVariants() item="oVariant"}]
, {
'item_name': '[{$oVariant->getRawFieldData("oxtitle")}]',
'item_id': '[{$oVariant->getFieldData("oxartnum")}]',
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
'item_variant': '[{if $oVariant->getFieldData("oxvarselect")}][{$oVariant->getFieldData("oxvarselect")}][{/if}]',
[{if $gtmCategory}]
'item_category': '[{$gtmCategory->getSplitCategoryArray(0, true)}]',
'item_category2': '[{$gtmCategory->getSplitCategoryArray(1, true)}]',
'item_category3': '[{$gtmCategory->getSplitCategoryArray(2, true)}]',
'item_category4': '[{$gtmCategory->getSplitCategoryArray(3, true)}]',
'item_list_name': '[{$gtmCategory->getSplitCategoryArray()}]',
[{/if}]
[{assign var="d3PriceObject" value=$oVariant->getPrice()}]
'price': [{$d3PriceObject->getPrice()}]
}
[{/foreach}]
[{/if}]
]
}[{if $oViewConf->isDebugModeOn()}],
'debug_mode': 'true'
[{/if}]
});
[{/strip}]
[{/capture}]
[{oxscript add=$smarty.capture.d3_ga4_view_item}]
[{/block}]

View File

@ -1,108 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>{{ title }}</title>
<meta http-equiv="Content-Type" content="text/html; charset={{ charset }}">
{% if isset(meta_refresh_sec, meta_refresh_url) %}
<meta http-equiv=Refresh content="{{ meta_refresh_sec }};URL={{ meta_refresh_url|replace({"&amp;": "&"}) }}">
{% endif %}
<link rel="shortcut icon" href="{{ oViewConf.getBaseDir() }}favicon.ico">
{% block admin_headitem_inccss %}
<link rel="stylesheet" href="{{ oViewConf.getResourceUrl() }}main.css">
<link rel="stylesheet" href="{{ oViewConf.getResourceUrl() }}colors_{{ oViewConf.getEdition()|lower }}.css">
<link rel="stylesheet" type="text/css" href="{{ oViewConf.getResourceUrl() }}yui/build/assets/skins/sam/container.css">
{% endblock %}
{% block admin_headitem_incjs %}
<script type="text/javascript" src="{{ oViewConf.getResourceUrl() }}yui/build/utilities/utilities.js"></script>
<script type="text/javascript" src="{{ oViewConf.getResourceUrl() }}yui/build/container/container-min.js"></script>
<script type="text/javascript" src="{{ oViewConf.getResourceUrl() }}yui/oxid-help.js"></script>
{% endblock %}
{% block admin_headitem_js %}
<script type="text/javascript">
<!--
// standard messages
var sUnassignMessage = "{{ translate({ ident: 'GENERAL_YOUWANTTOUNASSIGN' }) }}";
var sDeleteMessage = "{{ translate({ ident: 'GENERAL_YOUWANTTODELETE' }) }}";
// class info
var sDefClass = '{{ default_edit }}';
var sActClass = '{{ actlocation }}';
{% if updatelist == 1 %}
window.onload = function ()
{
top.oxid.admin.updateList('{{ oxid }}');
}
{% endif %}
var ajaxpopup = null;
function showDialog( sParams )
{
ajaxpopup = window.open('{{ oViewConf.getSelfLink()|replace({"&amp;": "&"}) }}'+sParams, 'ajaxpopup', 'width=850,height=680,scrollbars=yes,resizable=yes');
}
function focusPopup()
{
if ( ajaxpopup )ajaxpopup.focus();
}
window.onclick = focusPopup;
function cleanupLongDesc( sValue )
{
if ( sValue == '<br>' || sValue == '<br />' ) {
return '';
}
return sValue;
}
function copyLongDesc( sIdent )
{
var textVal = null;
try {
if ( WPro.editors[sIdent] != null ) {
WPro.editors[sIdent].prepareSubmission();
textVal = cleanupLongDesc( WPro.editors[sIdent].getValue() );
}
} catch(err) {
var varEl = document.getElementById(sIdent);
if (varEl != null) {
textVal = cleanupLongDesc( varEl.value );
}
}
if (textVal == null) {
var varName = 'editor_'+sIdent;
var varEl = document.getElementById(varName);
if (varEl != null) {
textVal = cleanupLongDesc( varEl.value );
}
}
if (textVal != null) {
var oTarget = document.getElementsByName( 'editval['+ sIdent + ']' );
if ( oTarget != null && ( oField = oTarget.item( 0 ) ) != null ) {
oField.value = textVal;
}
}
}
-->
</script>
{% endblock %}
</head>
<body>
{% include "tooltips.html.twig" %}
<div id="oxajax_data"></div>
<div class="{{ box|default('box') }}" style="height: 100%;">
{% include "inc_error.html.twig" with {Errorlist: Errors.default} %}
<!-- Input help popup -->
<div id="helpTextContainer" class="yui-skin-sam">
<div id="helpPanel"></div>
</div>

View File

@ -1,236 +0,0 @@
{% include "@d3googleanalytics4/admin/d3ga4uiheaditem.html.twig" with {title: "GENERAL_ADMIN_TITLE"|translate} %}
<style>
body {
background-image: linear-gradient(to top, #d5d4d0 0%, #d5d4d0 1%, #eeeeec 31%, #efeeec 75%, #e9e9e7 100%);
}
</style>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
{% if readonly %}
{% set readonly = "readonly disabled" %}
{% else %}
{% set readonly = "" %}
{% endif %}
<div>
<form name="d3gtmformedit" id="d3gtmformedit" action="{{ oViewConf.getSelfLink() }}" enctype="multipart/form-data" method="post">
<div class="row">
<div class="col-6">
{{ oViewConf.getHiddenSid()|raw }}
<input type="hidden" name="cl" value="{{ oViewConf.getActiveClassName() }}">
<input type="hidden" name="fnc" value="">
<input type="hidden" name="editlanguage" value="{{ editlanguage }}">
<div class="card mb-5">
<div class="card-header">
{{ translate({ ident: "D3BASECONFIG" }) }}
</div>
<div class="card-body">
<div class="form-check mb-3">
<input class="form-check-input" type="checkbox" value="" name="editval[bool][_blEnableGa4]" {% if d3ViewObject.d3GetModuleConfigParam('_blEnableGa4') %}checked{% endif %} id="blGA4enab">
<label class="form-check-label" for="flexCheckDefault">
{{ translate({ ident: "D3ACTIVATEMOD" }) }} {% if false is same as(d3ViewObject.d3GetModuleConfigParam('_blEnableGa4')) %}<span style="color: red">{{ translate({ ident: "D3INACTIVATEMOD" }) }}</span>{% endif %}
</label>
</div>
<div class="mb-3">
<div class="input-group w-50">
<span class="input-group-text" id="basic-addon3">{{ translate({ ident: "D3CONTAINERID" }) }}</span>
<input type="text" class="form-control" id="_sContainerID" name="editval[str][_sContainerID]" aria-describedby="basic-addon3" value="{{ d3ViewObject.d3GetModuleConfigParam('_sContainerID') }}">
</div>
<div class="text-muted">{{ translate({ ident: "D3CONTAINERID_HELP" }) }}</div>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="_blEnableDebug" name="editval[bool][_blEnableDebug]" {% if d3ViewObject.d3GetModuleConfigParam('_blEnableDebug') %}checked{% endif %}>
<label class="form-check-label" for="flexCheckDefault">
{{ translate({ ident: "D3USEDEBUGMODE" }) }}{% include "inputhelp.html.twig" with {'sHelpId': help_id("D3USEDEBUGMODE_HELP"), 'sHelpText': help_text("D3USEDEBUGMODE_HELP")} %}
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="_blActivateConsentMode" name="editval[bool][_blEnableConsentMode]" {% if d3ViewObject.d3GetModuleConfigParam('_blEnableConsentMode') %}checked{% endif %}>
<label class="form-check-label" for="flexCheckChecked">
{{ translate({ ident: "D3USEGOOGLECONSENTMODE" }) }}{% include "inputhelp.html.twig" with {'sHelpId': help_id("D3USEGOOGLECONSENTMODE_HELP"), 'sHelpText': help_text("D3USEGOOGLECONSENTMODE_HELP")} %}
</label>
</div>
</div>
<button type="submit" name="save" class="btn btn-light" onClick="Javascript:document.d3gtmformedit.fnc.value='save'">{{ translate({ ident: "GENERAL_SAVE" }) }}</button>
</div>
</div>
<div class="col-6">
<div class="card border border-0">
<div class="accordion" id="accordionPanelsStayOpenExample">
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#panelsStayOpen-cmpsettings" aria-expanded="true" aria-controls="panelsStayOpen-cmpsettings">
{{ translate({ ident: "D3CMPTABTITLE" }) }}
</button>
</h2>
<div id="panelsStayOpen-cmpsettings" class="accordion-collapse collapse show">
<div class="accordion-body">
<div class="form-check">
<input class="form-check-input" type="checkbox" name="editval[bool][_blEnableOwnCookieManager]" value="" id="_hasOwnCookieManager" {% if d3ViewObject.d3GetModuleConfigParam('_blEnableOwnCookieManager') %}checked{% endif %}>
<label class="form-check-label" for="flexCheckChecked">
{{ translate({ ident: "D3CMPUSEQ" }) }}{% include "inputhelp.html.twig" with {'sHelpId': help_id("D3CMPUSEQ_HELP"), 'sHelpText': help_text("D3CMPUSEQ_HELP")} %}
</label>
</div>
<div class="mb-3">
<label>
{{ translate({ ident: "D3CMP" }) }}
</label>
<select class="form-select w-50" name="editval[select][_HAS_STD_MANAGER]" aria-label="Default select example">
{% for sInternalName, sPublicName in d3ManagerTypeArray %}
<option value="{{ sInternalName }}" {% if sInternalName is same as(d3CurrentCMP) %}SELECTED{% endif %}>{{ sPublicName }}</option>
{% endfor %}
</select>
</div>
<div>
<div class="input-group w-75">
<span class="input-group-text" id="basic-addon3">{{ translate({ ident: "D3CNTRLPARAM" }) }}</span>
<input type="text" class="form-control" id="_controlParameter" name="editval[str][_sControlParameter]" value="{{ d3ViewObject.d3GetModuleConfigParam('_sControlParameter') }}" aria-describedby="basic-addon3">
</div>
<div class="text-muted">{{ translate({ ident: "D3CNTRLPARAM_HELP" }) }}</div>
</div>
</div>
<button type="submit" name="save" class="btn btn-light w-100" onClick="Javascript:document.d3gtmformedit.fnc.value='save'">{{ translate({ ident: "GENERAL_SAVE" }) }}</button>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#panelsStayOpen-serversidetagging" aria-expanded="false" aria-controls="panelsStayOpen-serversidetagging">
{{ translate({ ident: "D3SERVERSIDETAGGING" }) }}
</button>
</h2>
<div id="panelsStayOpen-serversidetagging" class="accordion-collapse collapse">
<div class="accordion-body">
<div class="card bg-light rounded mb-3">
<div class="card-body">
{{ translate({ ident: "D3SERVERSIDETAGGING_HINT" }) }}
</div>
</div>
<div class="input-group mb-3">
<span class="input-group-text w-25" id="basic-addon3">{{ translate({ ident: "D3SERVERSIDETAGGING_TITLE_ACTIVE" }) }}</span>
<input type="text" class="form-control" id="_serversidetagging_js" name="editval[str][_sServersidetagging_js]" value="{{ d3ViewObject.d3GetModuleConfigParam('_sServersidetagging_js') }}" aria-describedby="basic-addon3">
</div>
<div class="input-group mb-3">
<span class="input-group-text w-25" id="basic-addon3">{{ translate({ ident: "D3SERVERSIDETAGGING_TITLE_PASSIVE" }) }}</span>
<input type="text" class="form-control" id="_serversidetagging_nojs" name="editval[str][_sServersidetagging_nojs]" value="{{ d3ViewObject.d3GetModuleConfigParam('_sServersidetagging_nojs') }}" aria-describedby="basic-addon3">
</div>
<div>
<button type="button" class="btn btn-light mt-3" data-bs-toggle="modal" data-bs-target="#exampleModal">
{{ translate({ ident: "D3DETAILED_DESC" }) }}
</button>
<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<h4>{{ translate({ ident: "D3SERVERSIDETAGGING_TITLE_ACTIVE" }) }}</h4>
{{ translate({ ident: "D3SERVERSIDETAGGING_ACTIVE" }) }}
<hr>
<h4>{{ translate({ ident: "D3SERVERSIDETAGGING_TITLE_PASSIVE" }) }}</h4>
{{ translate({ ident: "D3SERVERSIDETAGGING_PASSIVE" }) }}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">{{ translate({ ident: "D3CLOSE" }) }}</button>
</div>
</div>
</div>
</div>
</div>
</div>
<button type="submit" name="save" class="btn btn-light w-100" onClick="Javascript:document.d3gtmformedit.fnc.value='save'">{{ translate({ ident: "GENERAL_SAVE" }) }}</button>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#panelsStayOpen-viewitemvariants" aria-expanded="false" aria-controls="panelsStayOpen-viewitemvariants">
{{ translate({ ident: "D3EXTENDEDCONFIG" }) }}
</button>
</h2>
<div id="panelsStayOpen-viewitemvariants" class="accordion-collapse collapse">
<div class="accordion-body">
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" name="editval[bool][_blViewItemAddVariants]" {% if d3ViewObject.d3GetModuleConfigParam('_blViewItemAddVariants') %}checked{% endif %} id="_blViewItemAddVariants">
<label class="form-check-label" for="flexCheckDefault">
{{ translate({ ident: "D3VIEWITEMADDVARIANTS" }) }}{% include "inputhelp.html.twig" with {'sHelpId': help_id("D3VIEWITEMADDVARIANTS_HELP"), 'sHelpText': help_text("D3VIEWITEMADDVARIANTS_HELP")} %}
</label>
</div>
<hr>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="_blUseRealCategoyTitles"
name="editval[bool][_blUseRealCategoyTitles]"
{% if d3ViewObject.d3GetModuleConfigParam('_blUseRealCategoyTitles') %}checked{% endif %}>
<label class="form-check-label" for="flexCheckChecked">
{{ translate({ ident: "D3USEREALCATTITLES" }) }}{% include "inputhelp.html.twig" with {'sHelpId': help_id("D3USEREALCATTITLES_HELP"), 'sHelpText': help_text("D3USEREALCATTITLES_HELP")} %}
</label>
</div>
<div class="mb-3">
<div class="input-group w-50">
<span class="input-group-text"
id="basic-addon3">{{ translate({ ident: "D3REPLACECHARS" }) }}</span>
<input type="text" class="form-control" id="_sReplaceChars"
name="editval[str][_sReplaceChars]" aria-describedby="basic-addon3"
value='{{ d3ViewObject.d3GetModuleConfigParam('_sReplaceChars') }}'/>
</div>
<div class="text-muted">{{ translate({ ident: "D3REPLACECHARS_HELP" }) }}</div>
</div>
</div>
<button type="submit" name="save" class="btn btn-light w-100" onClick="Javascript:document.d3gtmformedit.fnc.value='save'">{{ translate({ ident: "GENERAL_SAVE" }) }}</button>
</div>
</div>
{% if d3ViewConfObject.d3IsUsercentricsCMPChosen() %}
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#panelsStayOpen-usercentricsdynamicoptions" aria-expanded="false" aria-controls="panelsStayOpen-usercentricsdynamicoptions">
{{ translate({ ident: "D3USRCNTRCSDYNOPT" }) }}
</button>
</h2>
<div id="panelsStayOpen-usercentricsdynamicoptions" class="accordion-collapse collapse">
<div class="accordion-body">
<div class="card bg-light rounded mb-3">
<div class="card-body">
<div class="text-danger mb-3">
{{ translate({ ident: "D3USRCNTRCSCFG_WARNING" }) }}
</div>
{{ translate({ ident: "D3USRCNTRCSCFG_DOCS" }) }}
</div>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="enabledefaultmeasurementvalues" name="editval[bool][_blEnableMeasurementCapabilities]" {% if d3ViewObject.d3GetModuleConfigParam('_blEnableMeasurementCapabilities') %}checked{% endif %}>
<label class="form-check-label" for="flexCheckDefault">
{{ translate({ ident: "D3USRCNTRCSCFG_ACT_INDIVDEFVAL" }) }}
</label>
</div>
<div class="input-group mb-3">
<span class="input-group-text w-25" id="basic-addon3">{{ translate({ ident: "D3USRCNTRCSCFG_STD_CNST" }) }}</span>
<textarea name="editval[str][_sMeasurementCapabilities]" class="form-control" rows="15">{{ d3ViewObject.d3GetModuleConfigParam('_sMeasurementCapabilities') }}</textarea>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="enableUsercentricsConsentModeApi" name="editval[bool][_blEnableUsercentricsConsentModeApi]" {% if d3ViewObject.d3GetModuleConfigParam('_blEnableUsercentricsConsentModeApi') %}checked{% endif %}>
<label class="form-check-label" for="flexCheckDefault">
{{ translate({ ident: "D3USRCNTRCSCFG_ACT_CNSTMDE_API" }) }}
</label>
</div>
<div class="input-group mb-3">
<span class="input-group-text w-25" id="basic-addon3">{{ translate({ ident: "D3USRCNTRCSCFG_CNSTMDE_API" }) }}</span>
<textarea name="editval[str][_sUsercentricsConsentModeApi]" class="form-control" rows="40">{{ d3ViewObject.d3GetModuleConfigParam('_sUsercentricsConsentModeApi') }}</textarea>
</div>
</div>
<button type="submit" name="save" class="btn btn-light w-100" onClick="Javascript:document.d3gtmformedit.fnc.value='save'">{{ translate({ ident: "GENERAL_SAVE" }) }}</button>
</div>
</div>
{% endif %}
</div>
</div>
</div>
</div>
</form>
</div>

View File

@ -1,18 +0,0 @@
{% set oxidBlock_content %}
{% set template_title = "MY_WISH_LIST"|translate %}
<h1 class="page-header">{{ translate({ ident: "MY_WISH_LIST" }) }}</h1>
{% if oView.getNoticeProductList() %}
{% include "widget/product/list.html.twig" with {type: "line", listId: "noticelistProductList", title: "", products: oView.getNoticeProductList(), removeFunction: "tonoticelist", owishid: oxcmp_user.oxuser__oxid.value} %}
{% else %}
<p class="alert alert-info">{{ translate({ ident: "WISH_LIST_EMPTY" }) }}</p>
{% endif %}
{% include '@d3googleanalytics4/event/add_to_cart.html.twig' with {htmlIdAmountOfArticles: 'amountToBasket'} %}
{{ insert_tracker({title: template_title}) }}
{% endset %}
{% set oxidBlock_sidebar %}
{% include "page/account/inc/account_menu.html.twig" with {active_link: "noticelist"} %}
{% endset %}
{% include "layout/page.html.twig" with {sidebar: "Left"} %}

View File

@ -1,32 +0,0 @@
{% set oxidBlock_content %}
{% set template_title = "LISTMANIA"|translate %}
{% set _actvrecommlist = oView.getActiveRecommList() %}
<h1 class="page-header">{{ translate({ ident: "LISTMANIA" }) }}</h1>
{% if oView.isSavedList() %}
{% set _statusMessage = "LISTMANIA_LIST_SAVED"|translate %}
{% include "message/success.html.twig" with {statusMessage: _statusMessage} %}
{% endif %}
{% block account_redommendationlist_content %}
{% include "form/recommendation_edit.html.twig" with {actvrecommlist: _actvrecommlist} %}
<hr>
{% if not oView.getActiveRecommList() %}
{% set blEdit = true %}
{% include "page/recommendations/inc/list.html.twig" %}
{% endif %}
{% endblock %}
{% include '@d3googleanalytics4/event/add_to_cart.html.twig' with {htmlIdAmountOfArticles: 'amountToBasket'} %}
{{ insert_tracker({title: template_title}) }}
{% endset %}
{% set oxidBlock_sidebar %}
{% include "page/account/inc/account_menu.html.twig" with {active_link: "recommendationlist"} %}
{% endset %}
{% include "layout/page.html.twig" with {sidebar: "Left"} %}

View File

@ -1,44 +0,0 @@
{% set oxidBlock_content %}
{% set template_title = "MY_GIFT_REGISTRY"|translate %}
{% if not oView.getWishListUsers() and oView.getWishListSearchParam() %}
{% set _statusMessage = "MESSAGE_SORRY_NO_GIFT_REGISTRY"|translate %}
{% include "message/error.html.twig" with {statusMessage: _statusMessage} %}
{% endif %}
{% set editval = oView.getEnteredData() %}
{% if oView.isWishListEmailSent() %}
{% set _statusMessage = "GIFT_REGISTRY_SENT_SUCCESSFULLY"|translate(editval.rec_email) %}
{% include "message/notice.html.twig" with {statusMessage: _statusMessage} %}
{% endif %}
<h1 class="page-header">{{ oView.getTitle() }}</h1>
<div class="wishlist-search">
{% include "form/wishlist_search.html.twig" with {searchClass: "account_wishlist"} %}
</div>
<hr>
<div class="wishlist">
{% if oView.getWishList() %}
{% include "form/wishlist_publish.html.twig" %}
<hr>
{% include "form/wishlist_suggest.html.twig" %}
{% endif %}
</div>
{% if oView.getWishList() %}
{% include "widget/product/list.html.twig" with {type: "line", listId: "wishlistProductList", title: "", products: oView.getWishProductList(), removeFunction: "towishlist", toBasketFunction: "tobasket", owishid: oxcmp_user.oxuser__oxid.value} %}
{% else %}
<p class="alert alert-info">
{{ translate({ ident: "GIFT_REGISTRY_EMPTY" }) }}
</p>
{% endif %}
{% include '@d3googleanalytics4/event/add_to_cart.html.twig' with {htmlIdAmountOfArticles: 'amountToBasket'} %}
{{ insert_tracker({title: template_title}) }}
{% endset %}
{% set oxidBlock_sidebar %}
{% include "page/account/inc/account_menu.html.twig" with {active_link: "wishlist"} %}
{% endset %}
{% include "layout/page.html.twig" with {sidebar: "Left"} %}

View File

@ -1,55 +0,0 @@
{% set gtmBasketPrice = oxcmp_basket.getPrice() %}
{% set gtmBasketObject = oxcmp_basket %}
{% set gtmCartArticles = gtmBasketObject.getBasketArticles() %}
{% set gtmPaymentObject = oView.getPayment() %}
{% block gtm_ga4_add_payment_info_block %}
{% set doNotShow %}{% apply spaceless %}
<script type="text/javascript">
{% set gtm_ga4_add_payment_info %}
{% apply spaceless %}
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null});
dataLayer.push({
'event': 'add_payment_info',
'eventLabel':'Checkout - Payment info',
'payment_type':'{{ gtmPaymentObject.gtmGetSelectedPaymentName() }}',
'ecommerce':
{
'actionField': "Payment-Info",
'currency': "{{ oView.getActCurrency().name }}",
'value': {{ gtmBasketPrice.getPrice() }},
'coupon': '{% for key, sVoucher in oxcmp_basket.getVouchers() %}{{ sVoucher.sVoucherNr }}{% if not loop.last %}, {% endif %}{% endfor %}',
'items': [
{% for basketindex, basketitem in oxcmp_basket.getContents() %}
{% set gtmItemPriceObject = basketitem.getPrice() %}
{% set gtmBasketItem = basketitem.getArticle() %}
{% set gtmBasketItemCategory = gtmBasketItem.getCategory() %}
{
'item_oxid': '{{ gtmProduct.getFieldData("oxid") }}',
'item_id': '{{ gtmCartArticles[basketindex].getFieldData('oxartnum') }}',
'item_name': '{{ gtmCartArticles[basketindex].getRawFieldData('oxtitle')|raw }}',
'item_variant': '{{ gtmCartArticles[basketindex].getFieldData('oxvarselect') }}',
{% if gtmBasketItemCategory %}
'item_category': '{{ gtmBasketItemCategory.getSplitCategoryArray(0, true) }}',
'item_category2': '{{ gtmBasketItemCategory.getSplitCategoryArray(1, true) }}',
'item_category3': '{{ gtmBasketItemCategory.getSplitCategoryArray(2, true) }}',
'item_category4': '{{ gtmBasketItemCategory.getSplitCategoryArray(3, true) }}',
'item_list_name': '{{ gtmBasketItemCategory.getSplitCategoryArray() }}',
{% endif %}
'price': {{ gtmItemPriceObject.getPrice() }},
'coupon': '{% for key, sVoucher in oxcmp_basket.getVouchers() %}{{ sVoucher.sVoucherNr }}{% if not loop.last %}, {% endif %}{% endfor %}',
'quantity': {{ basketitem.getAmount() }},
'position': {{ loop.index0 }}
}{% if not loop.last %},{% endif %}
{% endfor %}
]
}{% if oViewConf.isDebugModeOn() %},
'debug_mode': 'true'
{% endif %}
});
{% endapply %}
{% endset %}
{{ script({ add: gtm_ga4_add_payment_info.__toString(), dynamic: __oxid_include_dynamic }) }}
</script>
{% endapply %}{% endset %}
{% endblock %}

View File

@ -1,66 +0,0 @@
{% if d3CmpBasket and d3CmpBasket.d3GtmRequestedArticleLoadedByAnid() != "null" %}
{% set oGtmProduct = d3CmpBasket.d3GtmRequestedArticleLoadedByAnid() %}
{% set oGtmAmountArticlesAdded = d3CmpBasket.getD3GtmAddToCartAmountArticles() %}
{% set d3PriceObject = oGtmProduct.getPrice() %}
{% set gtmCurrency = oView.getActCurrency() %}
{% set gtmManufacturer = oGtmProduct.getManufacturer() %}
{% set gtmCategory = oGtmProduct.getCategory() %}
{% block d3_ga4_add_to_cart_list_block %}
{% set doNotShow %}{% apply spaceless %}
<script type="text/javascript">
{% set d3_ga4_add_to_cart_listtpl %}
{% apply spaceless %}
document.addEventListener('DOMContentLoaded', function() {
var toBasketButton = document.getElementById('toBasket');
if (toBasketButton) {
toBasketButton.addEventListener('click', function() {
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null});
let iArtQuantity = document.getElementById("{{ htmlIdAmountOfArticles }}").value;
let iArtQuantityAdded = {{ oGtmAmountArticlesAdded }};
if(!iArtQuantity && (iArtQuantityAdded === 1)){
iArtQuantity = 1;
}else{
iArtQuantity = iArtQuantityAdded;
}
dataLayer.push({
'isAddToBasket': true,
'event':'add_to_cart',
'eventLabel': 'add_to_cart',
'ecommerce': {
'currency': "{{ currency.name }}",
'value': iArtQuantity*{{ d3PriceObject.getPrice() }},
'items': [{
'item_oxid': '{{ gtmProduct.getFieldData("oxid") }}',
'item_id': '{{ oGtmProduct.getFieldData('oxartnum') }}',
'item_name': '{{ oGtmProduct.getRawFieldData('oxtitle')|raw }}',
'price': {{ d3PriceObject.getPrice() }},
'item_brand': '{% if gtmManufacturer %}{{ gtmManufacturer.getFieldData('oxtitle')|raw }}{% endif %}',
'item_variant': '{% if oGtmProduct.getFieldData('oxvarselect') %}{{ oGtmProduct.getFieldData('oxvarselect') }}{% endif %}',
{% if gtmCategory %}
'item_category': '{{ gtmCategory.getSplitCategoryArray(0, true) }}',
'item_category2':'{{ gtmCategory.getSplitCategoryArray(1, true) }}',
'item_category3':'{{ gtmCategory.getSplitCategoryArray(2, true) }}',
'item_category4':'{{ gtmCategory.getSplitCategoryArray(3, true) }}',
'item_list_name':'{{ gtmCategory.getSplitCategoryArray() }}',
{% endif %}
'quantity': iArtQuantity
}]
}{% if oViewConf.isDebugModeOn() %},
'debug_mode': 'true'
{% endif %}
});
});
}
});
{% endapply %}
{% endset %}
</script>
{% endapply %}{% endset %}
{{ script({ add: d3_ga4_add_to_cart_listtpl.__toString(), dynamic: __oxid_include_dynamic }) }}
{% endblock %}
{% endif %}

View File

@ -1,55 +0,0 @@
{% set d3BasketPrice = oxcmp_basket.getPrice() %}
{% set d3BasketObject = oxcmp_basket %}
{% set gtmCartArticles = d3BasketObject.getBasketArticles() %}
{% set gtmCurrency = oView.getActCurrency() %}
{% block d3_ga4_begin_checkout_block %}
{% set doNotShow %}{% apply spaceless %}
<script type="text/javascript">
{% set d3_ga4_begin_checkout %}
{% apply spaceless %}
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null});
dataLayer.push({
'event': 'begin_checkout',
'eventLabel':'Begin of checkout',
'ecommerce': {
'actionField': "Begin Checkout - Step 2",
'currency': "{{ gtmCurrency.name }}",
'value': {{ d3BasketPrice.getPrice() }},
'coupon': '{% for key, sVoucher in oxcmp_basket.getVouchers() %}{{ sVoucher.sVoucherNr }}{% if not loop.last %}, {% endif %}{% endfor %}',
'items': [
{% for basketindex, basketitem in oxcmp_basket.getContents() %}
{% set d3oItemPrice = basketitem.getPrice() %}
{% set gtmBasketItem = basketitem.getArticle() %}
{% set gtmBasketItemCategory = gtmBasketItem.getCategory() %}
{% set gtmManufacturer = gtmBasketItem.getManufacturer() %}
{
'item_oxid': '{{ gtmProduct.getFieldData("oxid") }}',
'item_id': '{{ gtmCartArticles[basketindex].getFieldData('oxartnum') }}',
'item_name': '{{ gtmCartArticles[basketindex].getRawFieldData('oxtitle')|raw }}',
'item_variant': '{{ gtmCartArticles[basketindex].getFieldData('oxvarselect') }}',
'item_brand': '{% if gtmManufacturer %}{{ gtmManufacturer.getRawFieldData('oxtitle') }}{% endif %}',
{% if gtmBasketItemCategory %}
'item_category': '{{ gtmBasketItemCategory.getSplitCategoryArray(0, true) }}',
'item_category2': '{{ gtmBasketItemCategory.getSplitCategoryArray(1, true) }}',
'item_category3': '{{ gtmBasketItemCategory.getSplitCategoryArray(2, true) }}',
'item_category4': '{{ gtmBasketItemCategory.getSplitCategoryArray(3, true) }}',
'item_list_name': '{{ gtmBasketItemCategory.getSplitCategoryArray() }}',
{% endif %}
'price': {{ d3oItemPrice.getPrice() }},
'coupon': '{% for key, sVoucher in oxcmp_basket.getVouchers() %}{{ sVoucher.sVoucherNr }}{% if not loop.last %}, {% endif %}{% endfor %}',
'quantity': {{ basketitem.getAmount() }},
'position': {{ loop.index0 }}
}{% if not loop.last %},{% endif %}
{% endfor %}
]
}{% if oViewConf.isDebugModeOn() %},
'debug_mode': 'true'
{% endif %}
});
{% endapply %}
{% endset %}
{{ script({ add: d3_ga4_begin_checkout.__toString(), dynamic: __oxid_include_dynamic }) }}
</script>
{% endapply %}{% endset %}
{% endblock %}

View File

@ -1,62 +0,0 @@
{% block d3_ga4_purchase_block %}
{% set doNotShow %}{% apply spaceless %}
<script type="text/javascript">
{% set d3_ga4_purchase %}
{% apply spaceless %}
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null});
{% set gtmOrder = oView.getOrder() %}
{% set gtmBasket = oView.getBasket() %}
{% set gtmArticles = gtmOrder.getOrderArticles() %}
{% set gtmOrderVouchers = gtmOrder.getVoucherNrList() %}
dataLayer.push({
'event': 'purchase',
'eventLabel':'Checkout Step 5',
'ecommerce':
{
'transaction_id': '{{ gtmOrder.getFieldData("oxordernr") }}',
'affiliation': '{{ oxcmp_shop.getFieldData("oxname") }}',
'value': {{ gtmOrder.getTotalOrderSum() }},
'tax': {{ gtmOrder.getFieldData("oxartvatprice1")+gtmOrder.getFieldData("oxartvatprice2") }},
'shipping': {{ gtmOrder.getFieldData("oxdelcost") }},
'currency': '{{ gtmOrder.getFieldData('oxcurrency') }}',
'coupon': '{% for gtmOrderVoucher in gtmOrderVouchers %}{{ gtmOrderVoucher }}{% if not loop.last %}, {% endif %}{% endfor %}',
'paymentType': '{{ gtmBasket.getPaymentOnPaymentId() }}',
'items':
[
{% for gtmBasketItem in gtmArticles %}
{% set gtmPurchaseItemPriceObject = gtmBasketItem.getPrice() %}
{% set gtmPurchaseItem = gtmBasketItem.getArticle() %}
{% set gtmPurchaseItemCategory = gtmPurchaseItem.getCategory() %}
{% set gtmManufacturer = gtmBasketItem.getArticle().getManufacturer() %}
{
'item_oxid': '{{ gtmProduct.getFieldData("oxid") }}',
'item_id': '{{ gtmBasketItem.getFieldData("oxartnum") }}',
'item_name': '{{ gtmBasketItem.getFieldData('oxtitle')|raw }}',
'affiliation': '{{ gtmBasketItem.getFieldData('oxtitle')|raw }}',
'coupon': '{% for gtmOrderVoucher in gtmOrderVouchers %}{{ gtmOrderVoucher }}{% if not loop.last %}, {% endif %}{% endfor %}',
'item_variant': '{{ gtmBasketItem.getFieldData("oxselvariant") }}',
'item_brand': '{% if gtmManufacturer %}{{ gtmManufacturer.getRawFieldData('oxtitle') }}{% endif %}',
{% if gtmPurchaseItemCategory %}
'item_category': '{{ gtmPurchaseItemCategory.getSplitCategoryArray(0, true) }}',
'item_category2': '{{ gtmPurchaseItemCategory.getSplitCategoryArray(1, true) }}',
'item_category3': '{{ gtmPurchaseItemCategory.getSplitCategoryArray(2, true) }}',
'item_category4': '{{ gtmPurchaseItemCategory.getSplitCategoryArray(3, true) }}',
'item_list_name': '{{ gtmPurchaseItemCategory.getSplitCategoryArray() }}',
{% endif %}
'price': {{ gtmPurchaseItemPriceObject.getPrice() }},
'quantity': {{ gtmBasketItem.getFieldData("oxamount") }},
'position': {{ loop.index }}
}{% if not loop.last %},{% endif %}
{% endfor %}
]
}{% if oViewConf.isDebugModeOn() %},
'debug_mode': 'true'
{% endif %}
});
{% endapply %}
{% endset %}
{{ script({ add: d3_ga4_purchase.__toString(), dynamic: __oxid_include_dynamic }) }}
</script>
{% endapply %}{% endset %}
{% endblock %}

View File

@ -1,53 +0,0 @@
{% block d3_ga4_remove_from_cart_block %}
{% if hasBeenReloaded %}
{% set doNotShow %}{% apply spaceless %}
<script type="text/javascript">
{% set d3BasketPrice = oxcmp_basket.getPrice() %}
{% set d3_ga4_remove_from_cart %}
{% apply spaceless %}
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null});
dataLayer.push({
'isRemoveFromCart': true,
'event': 'remove_from_cart',
'eventLabel':'remove_from_cart',
'ecommerce': {
'actionField': "step: 1",
'currency': "{{ currency.name }}",
'value': {{ d3BasketPrice.getPrice() }},
'coupon': '{% for key, sVoucher in oxcmp_basket.getVouchers() %}{{ sVoucher.sVoucherNr }}{% if not loop.last %}, {% endif %}{% endfor %}',
'items': [
{% for rmItemindex, rmItem in toRemoveArticles.getArray() %}
{% set d3oItemPrice = rmItem.getPrice() %}
{% set gtmBasketItemCategory = rmItem.getCategory() %}
{% set gtmManufacturer = gtmBasketItem.getManufacturer() %}
{
'item_oxid': '{{ gtmProduct.getFieldData("oxid") }}',
'item_id': '{{ rmItem.getFieldData('oxartnum') }}',
'item_name': '{{ rmItem.getFieldData('oxtitle')|raw }}',
'item_variant': '{{ rmItem.getFieldData('oxvarselect') }}',
'item_brand': '{% if gtmManufacturer %}{{ gtmManufacturer.getRawFieldData('oxtitle') }}{% endif %}',
{% if gtmBasketItemCategory %}
'item_category': '{{ gtmBasketItemCategory.getSplitCategoryArray(0, true) }}',
'item_category2': '{{ gtmBasketItemCategory.getSplitCategoryArray(1, true) }}',
'item_category3': '{{ gtmBasketItemCategory.getSplitCategoryArray(2, true) }}',
'item_category4': '{{ gtmBasketItemCategory.getSplitCategoryArray(3, true) }}',
'item_list_name': '{{ gtmBasketItemCategory.getSplitCategoryArray() }}',
{% endif %}
'price': {{ d3oItemPrice.getPrice() }},
'coupon': '{% for key, sVoucher in oxcmp_basket.getVouchers() %}{{ sVoucher.sVoucherNr }}{% if not loop.last %}, {% endif %}{% endfor %}',
'quantity': '{{ rmItem.getFieldData('d3AmountThatGotRemoved') }}',
'position': {{ loop.index0 }}
}{% if not loop.last %},{% endif %}
{% endfor %}
]
}{% if oViewConf.isDebugModeOn() %},
'debug_mode': 'true'
{% endif %}
});
{% endapply %}
{% endset %}
{{ script({ add: d3_ga4_remove_from_cart.__toString(), dynamic: __oxid_include_dynamic }) }}
</script>
{% endapply %}{% endset %}
{% endif %}
{% endblock %}

View File

@ -1,55 +0,0 @@
{% set d3BasketPrice = oxcmp_basket.getPrice() %}
{% set gtmCartArticles = oView.getBasketArticles() %}
{% block d3_ga4_view_cart_block %}
{% set doNotShow %}{% apply spaceless %}
<script type="text/javascript">
{% set d3_ga4_view_cart %}
{% apply spaceless %}
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null});
dataLayer.push({
'event': 'view_cart',
'eventLabel':'Checkout Step 1',
'ecommerce':
{
'actionField': "step: 1",
'currency': "{{ oView.getActCurrency().name }}",
'value': {{ d3BasketPrice.getPrice() }},
'coupon': '{% for key, sVoucher in oxcmp_basket.getVouchers() %}{{ sVoucher.sVoucherNr }}{% if not loop.last %}, {% endif %}{% endfor %}',
'items':
[
{% for basketindex, basketitem in oxcmp_basket.getContents() %}
{% set d3oItemPrice = basketitem.getPrice() %}
{% set gtmBasketItem = basketitem.getArticle() %}
{% set gtmBasketItemCategory = gtmBasketItem.getCategory() %}
{% set gtmManufacturer = gtmBasketItem.getManufacturer() %}
{
'item_oxid': '{{ gtmProduct.getFieldData("oxid") }}',
'item_id': '{{ gtmCartArticles[basketindex].getFieldData('oxartnum') }}',
'item_name': '{{ gtmCartArticles[basketindex].getFieldData('oxtitle')|raw }}',
'item_variant': '{{ gtmCartArticles[basketindex].getFieldData('oxvarselect') }}',
'item_brand': '{% if gtmManufacturer %}{{ gtmManufacturer.getRawFieldData('oxtitle') }}{% endif %}',
{% if gtmBasketItemCategory %}
'item_category': '{{ gtmBasketItemCategory.getSplitCategoryArray(0, true) }}',
'item_category2': '{{ gtmBasketItemCategory.getSplitCategoryArray(1, true) }}',
'item_category3': '{{ gtmBasketItemCategory.getSplitCategoryArray(2, true) }}',
'item_category4': '{{ gtmBasketItemCategory.getSplitCategoryArray(3, true) }}',
'item_list_name': '{{ gtmBasketItemCategory.getSplitCategoryArray() }}',
{% endif %}
'price': {{ d3oItemPrice.getPrice() }},
'coupon': '{% for key, sVoucher in oxcmp_basket.getVouchers() %}{{ sVoucher.sVoucherNr }}{% if not loop.last %}, {% endif %}{% endfor %}',
'quantity': {{ basketitem.getAmount() }},
'position': {{ loop.index0 }}
}{% if not loop.last %},{% endif %}
{% endfor %}
]
}{% if oViewConf.isDebugModeOn() %},
'debug_mode': 'true'
{% endif %}
});
{% endapply %}
{% endset %}
{{ script({ add: d3_ga4_view_cart.__toString(), dynamic: __oxid_include_dynamic }) }}
</script>
{% endapply %}{% endset %}
{% endblock %}

View File

@ -1,64 +0,0 @@
{% set gtmProduct = oView.getProduct() %}
{% set gtmCategory = gtmProduct.getCategory() %}
{% set gtmManufacturer = gtmProduct.getManufacturer() %}
{% block d3_ga4_view_item_block %}
{% set doNotShow %}{% apply spaceless %}
<script type="text/javascript">
{% set d3_ga4_view_item %}{% apply spaceless %}
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null});
dataLayer.push({
'event': 'view_item',
'eventLabel':'Product View',
'ecommerce': {
'currency': '{{ currency.name }}',
'items': [
{
'item_oxid': '{{ gtmProduct.getFieldData("oxid") }}',
'item_name': '{{ gtmProduct.getFieldData('oxtitle')|raw }}',
'item_id': '{{ gtmProduct.getFieldData("oxartnum") }}',
'item_brand': '{% if gtmManufacturer %}{{ gtmManufacturer.getFieldData('oxtitle')|raw }}{% endif %}',
'item_variant': '{% if gtmProduct.getFieldData("oxvarselect") %}{{ gtmProduct.getFieldData("oxvarselect") }}{% endif %}',
{% if gtmCategory %}
'item_category': '{{ gtmCategory.getSplitCategoryArray(0, true) }}',
'item_category2':'{{ gtmCategory.getSplitCategoryArray(1, true) }}',
'item_category3':'{{ gtmCategory.getSplitCategoryArray(2, true) }}',
'item_category4':'{{ gtmCategory.getSplitCategoryArray(3, true) }}',
'item_list_name':'{{ gtmCategory.getSplitCategoryArray() }}',
{% endif %}
{% set d3PriceObject = gtmProduct.getPrice() %}
'price': {{ d3PriceObject.getPrice() }}
}
]
{% if oViewConf.d3GetModuleConfigParam('_blViewItemAddVariants') %}
,'item_variants':
[
{% for oVariant in gtmProduct.getVariants() %}
{
'item_name': '{{ oVariant.getRawFieldData("oxtitle") }}',
'item_id': '{{ oVariant.getFieldData("oxartnum") }}',
'item_brand': '{% if gtmManufacturer %}{{ gtmManufacturer.getFieldData('oxtitle')|raw }}{% endif %}',
'item_variant': '{% if oVariant.getFieldData("oxvarselect") %}{{ oVariant.getFieldData("oxvarselect") }}{% endif %}',
{% if gtmCategory %}
'item_category': '{{ gtmCategory.getSplitCategoryArray(0, true) }}',
'item_category2':'{{ gtmCategory.getSplitCategoryArray(1, true) }}',
'item_category3':'{{ gtmCategory.getSplitCategoryArray(2, true) }}',
'item_category4':'{{ gtmCategory.getSplitCategoryArray(3, true) }}',
'item_list_name':'{{ gtmCategory.getSplitCategoryArray() }}',
{% endif %}
{% set d3PriceObject = oVariant.getPrice() %}
'price': {{ d3PriceObject.getPrice() }}
},
{% endfor %}
]
{% endif %}
}{% if oViewConf.isDebugModeOn() %},
'debug_mode': 'true'
{% endif %}
});
{% endapply %}{% endset %}
</script>
{% endapply %}{% endset %}
{{ script({ add: d3_ga4_view_item.__toString(), dynamic: __oxid_include_dynamic }) }}
{% endblock %}

View File

@ -1,48 +0,0 @@
{% set gtmProducts = oView.getArticleList() %}
{% set gtmCategory = oView.getActiveCategory() %}
{% set breadCrumb = '' %}
{% block d3_ga4_view_item_list_block %}
{% if gtmProducts|length %}
{% set doNotShow %}{% apply spaceless %}
<script type="text/javascript">
{% set d3_ga4_view_item_list %}{% apply spaceless %}
dataLayer.push({ecommerce: null});
dataLayer.push({
'event':'view_item_list',
'event_name': 'view_item_list',
'ecommerce': {
'item_list_id': '{{ oView.getCategoryId() }}',
'item_list_name': '{% for sCrum in oView.getBreadCrumb() %}{% if sCrum.title %}{{ breadCrumb|cat(sCrum.title)|cat(" > ")|raw }}{% endif %}{% endfor %}',
'items': [
{% for gtmProduct in gtmProducts %}
{% set d3PriceObject = gtmProduct.getPrice() %}
{% set gtmManufacturer = gtmProduct.getManufacturer() %}
{% if not gtmCategory %}{% set gtmCategory = gtmProduct.getCategory() %}{% endif %}
{
'item_oxid': '{{ gtmProduct.getFieldData("oxid") }}',
'item_id': '{{ gtmProduct.getFieldData("oxartnum") }}',
'item_name': '{{ gtmProduct.getRawFieldData('oxtitle')|raw }}',
'price': {{ d3PriceObject.getPrice() }},
'item_brand': '{% if gtmManufacturer %}{{ gtmManufacturer.getFieldData('oxtitle')|raw }}{% endif %}',
{% if gtmCategory %}
'item_category': '{{ gtmCategory.getSplitCategoryArray(0, true) }}',
'item_category2':'{{ gtmCategory.getSplitCategoryArray(1, true) }}',
'item_category3':'{{ gtmCategory.getSplitCategoryArray(2, true) }}',
'item_category4':'{{ gtmCategory.getSplitCategoryArray(3, true) }}',
{% endif %}
'quantity': 1
}{% if not loop.last %},{% endif %}
{% endfor %}
]
}{% if oViewConf.isDebugModeOn() %},
'debug_mode': 'true'
{% endif %}
});
{% endapply %}{% endset %}
{{ script({ add: d3_ga4_view_item_list.__toString(), dynamic: __oxid_include_dynamic }) }}
</script>
{% endapply %}{% endset %}
{% endif %}
{% endblock %}

View File

@ -1,48 +0,0 @@
{% set gtmProducts = oView.getArticleList() %}
{% block d3_ga4_view_search_result_block %}
{% if gtmProducts %}
{% set doNotShow %}{% apply spaceless %}
<script type="text/javascript">
{% set d3_ga4_view_search_result %}{% apply spaceless %}
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null});
dataLayer.push({
'event': 'view_search_result',
'eventLabel':'view_search_result{% if oViewConf.isDebugModeOn() %}_test{% endif %}',
'ecommerce': {
'search_term': '{{ searchparamforhtml }}',
'items': [
{% for gtmProduct in gtmProducts %}
{% set d3PriceObject = gtmProduct.getPrice() %}
{% set gtmManufacturer = gtmProduct.getManufacturer() %}
{% set gtmCategory = gtmProduct.getCategory() %}
{
'item_oxid': '{{ gtmProduct.getFieldData("oxid") }}',
'item_id': '{{ gtmProduct.getFieldData("oxartnum") }}',
'item_name': '{{ gtmProduct.getRawFieldData('oxtitle')|raw }}',
'price': {{ d3PriceObject.getPrice() }},
'item_brand': '{% if gtmManufacturer %}{{ gtmManufacturer.getFieldData('oxtitle')|raw }}{% endif %}',
{% if gtmCategory %}
'item_category': '{{ gtmCategory.getSplitCategoryArray(0, true) }}',
'item_category2':'{{ gtmCategory.getSplitCategoryArray(1, true) }}',
'item_category3':'{{ gtmCategory.getSplitCategoryArray(2, true) }}',
'item_category4':'{{ gtmCategory.getSplitCategoryArray(3, true) }}',
'item_list_name':'{{ gtmCategory.getSplitCategoryArray() }}',
{% endif %}
'quantity': 1
}{% if not loop.last %},{% endif %}
{% endfor %}
]
}{% if oViewConf.isDebugModeOn() %},
'debug_mode': 'true'
{% endif %}
});
{% endapply %}{% endset %}
{{ script({ add: d3_ga4_view_search_result.__toString(), dynamic: __oxid_include_dynamic }) }}
</script>
{% endapply %}{% endset %}
{% endif %}
{% endblock %}
{# ToDo: fix add_to_cart! #}
{# {% include '@d3googleanalytics4/event/add_to_cart.html.twig' with {htmlIdAmountOfArticles: 'amountToBasket'} %} #}

View File

@ -1,75 +0,0 @@
{# setAttribute muss hier mal noch dynamisch hinzufĂĽgbar sein! -> bei consentmanager, muss ein "Attribute Feld" or 'Bool: data-cmp-ab="1" hinzufĂĽgen?' hinzugefĂĽgt werden -> https://help.consentmanager.net/books/cmp/page/automatic-blocking-of-codes-and-cookies #}
{% extends "layout/base.html.twig" %}
{% block head_meta_robots %}
{# Always prepare the data layer to avoid errors #}
{% if oViewConf.isGA4enabled() %}
{% set d3GtmContainerIdString = oViewConf.getGtmContainerId() %}
<script>
var dataLayer = {{ oViewConf.getGtmDataLayer()|raw }} || [];
</script>
{% endif %}
{% if oViewConf.isGA4enabled() and oViewConf.D3blShowGtmScript() %}
{% if d3GtmContainerIdString %}
{% apply spaceless %}
{% if oViewConf.isGtmConsentModeSetActivated() %}
<script type="text/javascript">
{% if oViewConf.d3IsUsercentricsCMPChosen() and oViewConf.d3GetModuleConfigParam('_blEnableMeasurementCapabilities') %}
{{ oViewConf.d3GetModuleConfigParam('_sMeasurementCapabilities')|striptags }}
{% else %}
function gtag() {
dataLayer.push(arguments);
}
gtag("consent", "default", {
ad_user_data: "denied",
ad_personalization: "denied",
ad_storage: "denied",
analytics_storage: "denied",
wait_for_update: 2000
});
{% endif %}
</script>
{% endif %}
{% if oViewConf.d3IsUsercentricsCMPChosen() and oViewConf.d3GetModuleConfigParam('_blEnableUsercentricsConsentModeApi') %}
<script type="text/javascript">
{{ oViewConf.d3GetModuleConfigParam('_sUsercentricsConsentModeApi')|striptags }}
</script>
{% endif %}
<!-- Google Tag Manager -->
<script {{ oViewConf.getGtmScriptAttributes() }}>
(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 = '{{ oViewConf.getServerSidetaggingJsDomain() }}?id=' + i + dl;
f.parentNode.insertBefore(j, f);
})(window, document, 'script', 'dataLayer', '{{ d3GtmContainerIdString }}');
</script>
<!-- End Google Tag Manager -->
{% endapply %}
{% endif %}
{% endif %}
{{ parent() }}
{% endblock %}
{% block theme_svg_icons %}
{% if oViewConf.D3blShowGtmScript() %}
{% if oViewConf.getGtmContainerId() %}{% apply spaceless %}
<!-- Google Tag Manager (noscript) -->
<noscript>
<iframe src="{{ oViewConf.getServerSidetaggingNoJsDomain() }}?id={{ oViewConf.getGtmContainerId() }}"
height="0" width="0" style="display:none;visibility:hidden"></iframe>
</noscript>
<!-- End Google Tag Manager (noscript) -->
{% endapply %}{% endif %}
{% endif %}
{{ parent() }}
{% endblock %}

View File

@ -1,9 +0,0 @@
{% extends "page/checkout/basket.html.twig" %}
{% block checkout_basket_main %}
{{ parent() }}
{% include "@d3googleanalytics4/event/view_cart.html.twig" %}
{% include "@d3googleanalytics4/event/remove_from_cart.html.twig" %}
{% endblock %}

View File

@ -1,7 +0,0 @@
{% extends "page/checkout/order.html.twig" %}
{% block checkout_order_main %}
{{ parent() }}
{% include "@d3googleanalytics4/event/add_payment_info.html.twig" %}
{% endblock %}

View File

@ -1,7 +0,0 @@
{% extends "page/checkout/thankyou.html.twig" %}
{% block checkout_thankyou_main %}
{{ parent() }}
{% include "@d3googleanalytics4/event/purchase.html.twig" %}
{% endblock %}

Some files were not shown because too many files have changed in this diff Show More