Vergelijk commits
48 Commits
Auteur | SHA1 | Datum | |
---|---|---|---|
3c29ded321 | |||
6a4297ea2e | |||
f239e7e5d7 | |||
4577e89ee3 | |||
bf9725c9be | |||
bf316c2463 | |||
e65f4ff581 | |||
cf463a60e2 | |||
2b8192da26 | |||
14b07749aa | |||
12b2f85f52 | |||
c35a95bc57 | |||
9b8a5b9365 | |||
2ea16f2b62 | |||
b2a302fbb3 | |||
e347739bd3 | |||
3250f2bf91 | |||
14adccc4d5 | |||
9d4f51e574 | |||
31f7578aa4 | |||
05fbafea6e | |||
c0951277b8 | |||
28f04c8281 | |||
f7bef420aa | |||
c0c78ce63d | |||
2ec373c95f | |||
6fcb9f8b84 | |||
53b3c878ce | |||
65b618e25c | |||
4b2c978035 | |||
2a27b25c5a | |||
a8ca33b10d | |||
31bafa621b | |||
48e2dc58ad | |||
f27040e7dd | |||
79994eae69 | |||
6bdf788ebf | |||
98ddc51a4d | |||
9edf3b9265 | |||
48a598da51 | |||
bc1dafbbfa | |||
2a1f8f5794 | |||
7bc73893c3 | |||
2f7b07ab95 | |||
84240f96a9 | |||
542471b053 | |||
7873714f17 | |||
6dff6860bf |
15
Application/Component/Widget/d3GtmStartWidget.php
Normal file
15
Application/Component/Widget/d3GtmStartWidget.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace D3\GoogleAnalytics4\Application\Component\Widget;
|
||||
|
||||
class d3GtmStartWidget extends \OxidEsales\Eshop\Application\Component\Widget\WidgetController
|
||||
{
|
||||
public function render()
|
||||
{
|
||||
parent::render();
|
||||
|
||||
return '';
|
||||
}
|
||||
}
|
@ -21,7 +21,7 @@ class GA4AdminUserInterface_main extends \OxidEsales\Eshop\Application\Controlle
|
||||
$this->addTplParam('d3ViewObject', $this);
|
||||
$this->addTplParam('d3ViewConfObject', Registry::get(ViewConfig::class));
|
||||
$this->addTplParam('d3ManagerTypeArray', oxNew(ManagerTypes::class)->getManagerList());
|
||||
$this->addTplParam('d3CurrentCMP', oxNew(ManagerHandler::class)->getCurrManager());
|
||||
$this->addTplParam('d3CurrentCMP', oxNew(ManagerHandler::class)->getActManager());
|
||||
|
||||
return $return;
|
||||
}
|
||||
@ -37,8 +37,10 @@ class GA4AdminUserInterface_main extends \OxidEsales\Eshop\Application\Controlle
|
||||
'_blEnableDebug',
|
||||
'_blEnableConsentMode',
|
||||
'_blEnableOwnCookieManager',
|
||||
'_blUseRealCategoyTitles',
|
||||
'_blEnableMeasurementCapabilities',
|
||||
'_blEnableUsercentricsConsentModeApi',
|
||||
'_blViewItemAddVariants',
|
||||
];
|
||||
|
||||
foreach ($aCheckBoxParams as $checkBoxName){
|
||||
|
@ -7,35 +7,6 @@ use OxidEsales\Eshop\Core\ViewConfig;
|
||||
|
||||
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
|
||||
* @return void
|
||||
@ -53,26 +24,8 @@ class ManagerHandler
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getModuleSettingExplicitManagerSelectValue() :string
|
||||
public function getActManager() :string
|
||||
{
|
||||
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;
|
||||
return Registry::get(ViewConfig::class)->d3GetModuleConfigParam('_HAS_STD_MANAGER')?:"";
|
||||
}
|
||||
}
|
@ -7,19 +7,25 @@ use D3\GoogleAnalytics4\Application\Model\CMP\Usercentrics;
|
||||
class ManagerTypes
|
||||
{
|
||||
const EXTERNAL_SERVICE = "eigener Service";
|
||||
const INTERNAL_EXTERNAL_SERVICE = "externalService";
|
||||
const NET_COOKIE_MANAGER = "Netensio Cookie Manager";
|
||||
const INTERNAL_NET_COOKIE_MANAGER = "net_cookie_manager";
|
||||
|
||||
/**
|
||||
* Further information's:
|
||||
* https://github.com/aggrosoft/oxid-cookie-compliance
|
||||
*/
|
||||
const AGCOOKIECOMPLIANCE = "Aggrosoft Cookie Compliance";
|
||||
const INTERNAL_AGCOOKIECOMPLIANCE = "agcookiecompliance";
|
||||
|
||||
const CONSENTMANAGER = "Consentmanager";
|
||||
const INTERNAL_CONSENTMANAGER = "cmconsentmanager";
|
||||
|
||||
const COOKIEFIRST = "Cookiefirst";
|
||||
const INTERNAL_COOKIEFIRST = "cookiefirst";
|
||||
|
||||
const COOKIEBOT = "Cookiebot";
|
||||
const INTERNAL_COOKIEBOT = "cookiebot";
|
||||
|
||||
/**
|
||||
* @return array
|
||||
@ -27,14 +33,14 @@ class ManagerTypes
|
||||
public function getManagerList(): array
|
||||
{
|
||||
return [
|
||||
"externalService" => self::EXTERNAL_SERVICE,
|
||||
"agcookiecompliance" => self::AGCOOKIECOMPLIANCE,
|
||||
"net_cookie_manager" => self::NET_COOKIE_MANAGER,
|
||||
self::INTERNAL_EXTERNAL_SERVICE => self::EXTERNAL_SERVICE,
|
||||
self::INTERNAL_AGCOOKIECOMPLIANCE => self::AGCOOKIECOMPLIANCE,
|
||||
self::INTERNAL_NET_COOKIE_MANAGER => self::NET_COOKIE_MANAGER,
|
||||
Usercentrics::sModuleIncludationInternalName => Usercentrics::sModuleIncludationPublicName,
|
||||
Usercentrics::sExternalIncludationInternalName => Usercentrics::sExternalIncludationPublicName,
|
||||
"cmconsentmanager" => self::CONSENTMANAGER,
|
||||
"cookiefirst" => self::COOKIEFIRST,
|
||||
"cookiebot" => self::COOKIEBOT,
|
||||
self::INTERNAL_CONSENTMANAGER => self::CONSENTMANAGER,
|
||||
self::INTERNAL_COOKIEFIRST => self::COOKIEFIRST,
|
||||
self::INTERNAL_COOKIEBOT => self::COOKIEBOT,
|
||||
];
|
||||
}
|
||||
|
||||
@ -46,4 +52,21 @@ class ManagerTypes
|
||||
{
|
||||
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
|
||||
];
|
||||
}
|
||||
}
|
@ -7,6 +7,7 @@ $aLang = array(
|
||||
'charset' => 'UTF-8',
|
||||
|
||||
'd3mxgoogleanalytics4' => 'Google Analytics 4',
|
||||
'd3mxd3modules' => $aLangCache['d3mxd3modules'] ?? 'Google Analytics 4',
|
||||
'd3mxgoogleanalytics4set' => 'Einstellungen',
|
||||
|
||||
// Base Translations
|
||||
@ -18,7 +19,7 @@ $aLang = array(
|
||||
'D3ACTIVATEMOD' => 'Modul aktivieren',
|
||||
'D3CNTRLPARAM' => 'Steuerungsparameter',
|
||||
'D3CNTRLPARAM_HELP' => '<a target="_blank" href="https://github.com/d3datadevelopment/GoogleAnalytics4/blob/master/Docs/README.md#steuerungsparameter" class="text-muted text-decoration-none"><i class="bi bi-book-half"></i> Was ist der <strong>Steuerungsparameter</strong>?</a>',
|
||||
'D3INACTIVATEMOD' => 'Modul ist nicht aktiv! Es werde keine Funktionen ausgespielt!',
|
||||
'D3INACTIVATEMOD' => 'Modul ist nicht aktiv! Es werden keine Funktionen ausgespielt!',
|
||||
// Usercentrics Dynamische Optionen
|
||||
'D3USRCNTRCSDYNOPT' => 'Usercentrics Dynamische Optionen',
|
||||
|
||||
@ -40,7 +41,18 @@ $aLang = array(
|
||||
völlig verhindert, solange keine Zustimmung erteilt wurde.<br>
|
||||
<br>
|
||||
Ein einfaches anschalten dieser Funktion regelt noch <strong>nicht</strong> die völlige Funktionsweise
|
||||
aller beteiligten Instanzen; diese bedarf eine detailiertere 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?
|
||||
'D3CMPTABTITLE' => 'Cookie Manager Einstellungen',
|
||||
@ -57,12 +69,12 @@ $aLang = array(
|
||||
Diese konformen CMP sind in
|
||||
<a target="_blank" href="https://cmppartnerprogram.withgoogle.com/">offizieller Partnerschaft mit Google ( Liste der Partner )</a>
|
||||
und unterliegen strengen Vorschriften, um ein ordnungsgemäßes Senden und
|
||||
Verarbeiten der Zustimmung unterliegenden Daten sicher zu stellen.',
|
||||
Verarbeiten der Zustimmung unterliegenden Daten sicher stellen zu können.',
|
||||
'D3CMP' => 'Consent Management Platform ( CMP ) wählen',
|
||||
|
||||
// Usercentrics Config
|
||||
// activate Individual Default Values
|
||||
'D3USRCNTRCSCFG_ACT_INDIVDEFVAL' => "usercentrics individual 'Default Values' aktiveren",
|
||||
'D3USRCNTRCSCFG_ACT_INDIVDEFVAL' => "Usercentrics individual 'Default Values' aktiveren",
|
||||
// standard Consent
|
||||
'D3USRCNTRCSCFG_STD_CNST' => "GTM Standard Consent",
|
||||
// activate consent mode API
|
||||
@ -70,7 +82,7 @@ $aLang = array(
|
||||
// consent mode api
|
||||
'D3USRCNTRCSCFG_CNSTMDE_API' => "Consent Mode API",
|
||||
'D3USRCNTRCSCFG_DOCS' => 'Nähere Infos zu den hier konfigurierbaren Einstellungen entnehmen Sie bitte der offiziellen
|
||||
Dokumentation von Usercentrics selbst: <a href="https://docs.usercentrics.com/#/consent-mode" class="text-primary"><i class="bi bi-book-half"></i> Dokumentation</a>',
|
||||
Dokumentation von Usercentrics selbst: <a target="_blank" href="https://docs.usercentrics.com/#/consent-mode" class="text-primary"><i class="bi bi-book-half"></i> Dokumentation</a>',
|
||||
'D3USRCNTRCSCFG_WARNING' => "Bevor Sie hier Anpassungen machen, konsultieren Sie bitte einen technischen Support!<br>
|
||||
Anpassungen können zu Beeinträchtigungen und Ausfall von Funktionen im Frontend führen!",
|
||||
|
||||
@ -120,4 +132,14 @@ Nachher:
|
||||
src="{Domain}?id={Container-ID}"
|
||||
</code>
|
||||
</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.',
|
||||
);
|
@ -31,6 +31,7 @@ $aLang = [
|
||||
'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',
|
||||
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_blUseRealCategoyTitles' => 'Statt URL-Teilen die tatsächlichen Kategorie-Titel verwenden (item_category)',
|
||||
|
||||
// Serverside - tagging
|
||||
'SHOP_MODULE_GROUP_'.Constants::OXID_MODULE_ID.'_serversidetagging' => 'Server-Side tagging',
|
||||
|
@ -80,7 +80,6 @@
|
||||
[{oxmultilang ident="D3CMP"}]
|
||||
</label>
|
||||
<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]"}]
|
||||
<option value="[{$sInternalName}]" [{if $sInternalName === $d3CurrentCMP}]SELECTED[{/if}]>[{$sPublicName}]</option>
|
||||
[{/foreach}]
|
||||
@ -146,6 +145,43 @@
|
||||
<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 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()}]
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header">
|
||||
|
3
Application/views/blocks/add_payment_info.tpl
Normal file
3
Application/views/blocks/add_payment_info.tpl
Normal file
@ -0,0 +1,3 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="event/add_payment_info.tpl"}]
|
3
Application/views/blocks/begin_checkout.tpl
Normal file
3
Application/views/blocks/begin_checkout.tpl
Normal file
@ -0,0 +1,3 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="event/begin_checkout.tpl"}]
|
55
Application/views/event/add_payment_info.tpl
Normal file
55
Application/views/event/add_payment_info.tpl
Normal file
@ -0,0 +1,55 @@
|
||||
[{*$oxcmp_basket|get_class_methods|dumpvar*}]
|
||||
|
||||
[{assign var="gtmBasketPrice" value=$oxcmp_basket->getPrice()}]
|
||||
[{assign var="gtmBasketObject" value=$oxcmp_basket}]
|
||||
[{assign var='gtmCartArticles' value=$gtmBasketObject->getBasketArticles()}]
|
||||
[{assign var="gtmPaymentObject" value=$oView->getPayment()}]
|
||||
|
||||
[{block name="gtm_ga4_add_payment_info_block"}]
|
||||
[{capture name="gtm_ga4_add_payment_info"}]
|
||||
[{strip}]
|
||||
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
||||
dataLayer.push({
|
||||
'event': 'add_payment_info',
|
||||
'eventLabel':'Checkout - Payment info',
|
||||
'payment_type':'[{$gtmPaymentObject->gtmGetSelectedPaymentName()}]',
|
||||
'ecommerce':
|
||||
{
|
||||
'actionField': "Payment-Info",
|
||||
'currency': "[{$currency->name}]",
|
||||
'value': [{$gtmBasketPrice->getPrice()}],
|
||||
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
|
||||
'items':
|
||||
[
|
||||
[{foreach from=$oxcmp_basket->getContents() item=basketitem name=gtmCartContents key=basketindex}]
|
||||
[{assign var="gtmItemPriceObject" value=$basketitem->getPrice()}]
|
||||
[{assign var="gtmBasketItem" value=$basketitem->getArticle()}]
|
||||
[{assign var="gtmBasketItemCategory" value=$gtmBasketItem->getCategory()}]
|
||||
{
|
||||
'item_oxid': '[{$gtmCartArticles[$basketindex]->getFieldData('oxid')}]',
|
||||
'item_id': '[{$gtmCartArticles[$basketindex]->getFieldData('oxartnum')}]',
|
||||
'item_name': '[{$gtmCartArticles[$basketindex]->getRawFieldData('oxtitle')}]',
|
||||
'item_variant': '[{$gtmCartArticles[$basketindex]->getFieldData('oxvarselect')}]',
|
||||
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
||||
[{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()}]',
|
||||
[{/if}]
|
||||
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$gtmItemPriceObject->getPrice()}],[{/oxhasrights}]
|
||||
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
|
||||
'quantity': [{$basketitem->getAmount()}],
|
||||
'position': [{$smarty.foreach.gtmCartContents.index}]
|
||||
}[{if !$smarty.foreach.gtmCartContents.last}],[{/if}]
|
||||
[{/foreach}]
|
||||
]
|
||||
}[{if $oViewConf->isDebugModeOn()}],
|
||||
'debug_mode': 'true'
|
||||
[{/if}]
|
||||
});
|
||||
[{/strip}]
|
||||
[{/capture}]
|
||||
[{oxscript add=$smarty.capture.gtm_ga4_add_payment_info}]
|
||||
[{/block}]
|
@ -35,17 +35,18 @@
|
||||
'value': iArtQuantity*[{$d3PriceObject->getPrice()}],
|
||||
'items': [
|
||||
{
|
||||
'item_oxid': '[{$oGtmProduct->getFieldData('oxid')}]',
|
||||
'item_id': '[{$oGtmProduct->getFieldData('oxartnum')}]',
|
||||
'item_name': '[{$oGtmProduct->getFieldData('oxtitle')}]',
|
||||
'price': [{$d3PriceObject->getPrice()}],
|
||||
'item_name': '[{$oGtmProduct->getRawFieldData('oxtitle')}]',
|
||||
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$d3PriceObject->getPrice()}],[{/oxhasrights}]
|
||||
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
||||
'item_variant': '[{if $oGtmProduct->getFieldData('oxvarselect')}][{$oGtmProduct->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()}]',
|
||||
'item_category2': '[{$gtmCategory->getSplitCategoryArray(1, true)}]',
|
||||
'item_category3': '[{$gtmCategory->getSplitCategoryArray(2, true)}]',
|
||||
'item_category4': '[{$gtmCategory->getSplitCategoryArray(3, true)}]',
|
||||
'item_list_name': '[{$gtmCategory->getSplitCategoryArray()}]',
|
||||
[{/if}]
|
||||
'quantity': iArtQuantity
|
||||
}
|
||||
|
55
Application/views/event/begin_checkout.tpl
Normal file
55
Application/views/event/begin_checkout.tpl
Normal file
@ -0,0 +1,55 @@
|
||||
[{*$oxcmp_basket|get_class_methods|dumpvar*}]
|
||||
|
||||
[{assign var="d3BasketPrice" value=$oxcmp_basket->getPrice()}]
|
||||
[{assign var="d3BasketObject" value=$oxcmp_basket}]
|
||||
[{assign var='gtmCartArticles' value=$d3BasketObject->getBasketArticles()}]
|
||||
[{assign var="gtmCurrency" value=$oView->getActCurrency()}]
|
||||
|
||||
[{block name="d3_ga4_begin_checkout_block"}]
|
||||
[{capture name="d3_ga4_begin_checkout"}]
|
||||
[{strip}]
|
||||
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
||||
dataLayer.push({
|
||||
'event': 'begin_checkout',
|
||||
'eventLabel':'Begin of checkout',
|
||||
'ecommerce':
|
||||
{
|
||||
'actionField': "Begin",
|
||||
'currency': "[{$gtmCurrency->name}]",
|
||||
'value': [{$d3BasketPrice->getPrice()}],
|
||||
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
|
||||
'items':
|
||||
[
|
||||
[{foreach from=$oxcmp_basket->getContents() item=basketitem name=gtmCartContents key=basketindex}]
|
||||
[{assign var="d3oItemPrice" value=$basketitem->getPrice()}]
|
||||
[{assign var="gtmBasketItem" value=$basketitem->getArticle()}]
|
||||
[{assign var="gtmBasketItemCategory" value=$gtmBasketItem->getCategory()}]
|
||||
[{assign var="gtmManufacturer" value=$gtmBasketItem->getManufacturer()}]
|
||||
{
|
||||
'item_oxid': '[{$gtmCartArticles[$basketindex]->getFieldData('oxid')}]',
|
||||
'item_id': '[{$gtmCartArticles[$basketindex]->getFieldData('oxartnum')}]',
|
||||
'item_name': '[{$gtmCartArticles[$basketindex]->getRawFieldData('oxtitle')}]',
|
||||
'item_variant': '[{$gtmCartArticles[$basketindex]->getFieldData('oxvarselect')}]',
|
||||
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
||||
[{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()}]',
|
||||
[{/if}]
|
||||
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$d3oItemPrice->getPrice()}],[{/oxhasrights}]
|
||||
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
|
||||
'quantity': [{$basketitem->getAmount()}],
|
||||
'position': [{$smarty.foreach.gtmCartContents.index}]
|
||||
}[{if !$smarty.foreach.gtmCartContents.last}],[{/if}]
|
||||
[{/foreach}]
|
||||
]
|
||||
}[{if $oViewConf->isDebugModeOn()}],
|
||||
'debug_mode': 'true'
|
||||
[{/if}]
|
||||
});
|
||||
[{/strip}]
|
||||
[{/capture}]
|
||||
[{oxscript add=$smarty.capture.d3_ga4_begin_checkout}]
|
||||
[{/block}]
|
@ -26,21 +26,24 @@
|
||||
[{assign var="gtmPurchaseItemPriceObject" value=$gtmBasketItem->getPrice()}]
|
||||
[{assign var="gtmPurchaseItem" value=$gtmBasketItem->getArticle()}]
|
||||
[{assign var="gtmPurchaseItemCategory" value=$gtmPurchaseItem->getCategory()}]
|
||||
[{assign var="gtmManufacturer" value=$gtmPurchaseItem->getManufacturer()}]
|
||||
|
||||
{
|
||||
'item_oxid': '[{$gtmBasketItem->getFieldData("oxid")}]',
|
||||
'item_id': '[{$gtmBasketItem->getFieldData("oxartnum")}]',
|
||||
'item_name': '[{$gtmBasketItem->getFieldData("oxtitle")}]',
|
||||
'affiliation': '[{$gtmBasketItem->getFieldData("oxtitle")}]',
|
||||
'item_name': '[{$gtmBasketItem->getRawFieldData("oxtitle")}]',
|
||||
'affiliation': '[{$gtmBasketItem->getRawFieldData("oxtitle")}]',
|
||||
'coupon': '[{foreach from=$gtmOrderVouchers item="gtmOrderVoucher" name="gtmOrderVoucherIteration"}][{$gtmOrderVoucher}][{if !$smarty.foreach.gtmOrderVoucherIteration.last}], [{/if}][{/foreach}]',
|
||||
'item_variant': '[{$gtmBasketItem->getFieldData("oxselvariant")}]',
|
||||
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
||||
[{if $gtmPurchaseItemCategory}]
|
||||
'item_category': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(0, true)}]',
|
||||
'item_category_2': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(1, true)}]',
|
||||
'item_category_3': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(2, true)}]',
|
||||
'item_category_4': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(3, true)}]',
|
||||
'item_category2': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(1, true)}]',
|
||||
'item_category3': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(2, true)}]',
|
||||
'item_category4': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(3, true)}]',
|
||||
'item_list_name': '[{$gtmPurchaseItemCategory->getSplitCategoryArray()}]',
|
||||
[{/if}]
|
||||
'price': [{$gtmPurchaseItemPriceObject->getPrice()}],
|
||||
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$gtmPurchaseItemPriceObject->getPrice()}],[{/oxhasrights}]
|
||||
'quantity': [{$gtmBasketItem->getFieldData("oxamount")}],
|
||||
'position': [{$smarty.foreach.gtmArticles.iteration}]
|
||||
}[{if !$smarty.foreach.gtmArticles.last}],[{/if}]
|
||||
@ -49,7 +52,7 @@
|
||||
}[{if $oViewConf->isDebugModeOn()}],
|
||||
'debug_mode': 'true'
|
||||
[{/if}]
|
||||
})
|
||||
});
|
||||
[{/strip}]
|
||||
[{/capture}]
|
||||
[{oxscript add=$smarty.capture.d3_ga4_purchase}]
|
||||
|
@ -18,17 +18,18 @@
|
||||
[{assign var="d3oItemPrice" value=$rmItem->getPrice()}]
|
||||
[{assign var="gtmBasketItemCategory" value=$rmItem->getCategory()}]
|
||||
{
|
||||
'item_oxid': '[{$rmItem->getFieldData('oxid')}]',
|
||||
'item_id': '[{$rmItem->getFieldData('oxartnum')}]',
|
||||
'item_name': '[{$rmItem->getFieldData('oxtitle')}]',
|
||||
'item_name': '[{$rmItem->getRawFieldData('oxtitle')}]',
|
||||
'item_variant': '[{$rmItem->getFieldData('oxvarselect')}]',
|
||||
[{if $gtmBasketItemCategory}]
|
||||
'item_category': '[{$gtmBasketItemCategory->getSplitCategoryArray(0, true)}]',
|
||||
'item_category_2': '[{$gtmBasketItemCategory->getSplitCategoryArray(1, true)}]',
|
||||
'item_category_3': '[{$gtmBasketItemCategory->getSplitCategoryArray(2, true)}]',
|
||||
'item_category_4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3, true)}]',
|
||||
'item_category2': '[{$gtmBasketItemCategory->getSplitCategoryArray(1, true)}]',
|
||||
'item_category3': '[{$gtmBasketItemCategory->getSplitCategoryArray(2, true)}]',
|
||||
'item_category4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3, true)}]',
|
||||
'item_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]',
|
||||
[{/if}]
|
||||
'price': [{$d3oItemPrice->getPrice()}],
|
||||
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$d3oItemPrice->getPrice()}],[{/oxhasrights}]
|
||||
'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')}]',
|
||||
'position': [{$smarty.foreach.gtmRemovedItems.index}]
|
||||
|
@ -23,17 +23,18 @@
|
||||
[{assign var="gtmBasketItem" value=$basketitem->getArticle()}]
|
||||
[{assign var="gtmBasketItemCategory" value=$gtmBasketItem->getCategory()}]
|
||||
{
|
||||
'item_oxid': '[{$gtmCartArticles[$basketindex]->getFieldData('oxid')}]',
|
||||
'item_id': '[{$gtmCartArticles[$basketindex]->getFieldData('oxartnum')}]',
|
||||
'item_name': '[{$gtmCartArticles[$basketindex]->getFieldData('oxtitle')}]',
|
||||
'item_name': '[{$gtmCartArticles[$basketindex]->getRawFieldData('oxtitle')}]',
|
||||
'item_variant': '[{$gtmCartArticles[$basketindex]->getFieldData('oxvarselect')}]',
|
||||
[{if $gtmBasketItemCategory}]
|
||||
'item_category': '[{$gtmBasketItemCategory->getSplitCategoryArray(0, true)}]',
|
||||
'item_category_2': '[{$gtmBasketItemCategory->getSplitCategoryArray(1, true)}]',
|
||||
'item_category_3': '[{$gtmBasketItemCategory->getSplitCategoryArray(2, true)}]',
|
||||
'item_category_4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3, true)}]',
|
||||
'item_category2': '[{$gtmBasketItemCategory->getSplitCategoryArray(1, true)}]',
|
||||
'item_category3': '[{$gtmBasketItemCategory->getSplitCategoryArray(2, true)}]',
|
||||
'item_category4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3, true)}]',
|
||||
'item_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]',
|
||||
[{/if}]
|
||||
'price': [{$d3oItemPrice->getPrice()}],
|
||||
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$d3oItemPrice->getPrice()}],[{/oxhasrights}]
|
||||
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
|
||||
'quantity': [{$basketitem->getAmount()}],
|
||||
'position': [{$smarty.foreach.gtmCartContents.index}]
|
||||
|
@ -6,7 +6,6 @@
|
||||
[{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',
|
||||
@ -16,21 +15,43 @@
|
||||
'items':
|
||||
[
|
||||
{
|
||||
'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]',
|
||||
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
|
||||
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
||||
'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_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()}]',
|
||||
'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()}]
|
||||
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$d3PriceObject->getPrice()}][{/oxhasrights}]
|
||||
}
|
||||
]
|
||||
[{if $oViewConf->d3GetModuleConfigParam('_blViewItemAddVariants')}]
|
||||
,'item_variants':[
|
||||
[{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}]
|
||||
|
@ -20,15 +20,16 @@
|
||||
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
|
||||
[{if !$gtmCategory}][{assign var="gtmCategory" value=$gtmProduct->getCategory()}][{/if}]
|
||||
{
|
||||
'item_oxid': '[{$gtmProduct->getFieldData("oxid")}]',
|
||||
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
|
||||
'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]',
|
||||
'price': [{$d3PriceObject->getPrice()}],
|
||||
'item_name': '[{$gtmProduct->getRawFieldData("oxtitle")}]',
|
||||
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$d3PriceObject->getPrice()}],[{/oxhasrights}]
|
||||
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/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_category': '[{$gtmCategory->getSplitCategoryArray(0, true)}]',
|
||||
'item_category2': '[{$gtmCategory->getSplitCategoryArray(1, true)}]',
|
||||
'item_category3': '[{$gtmCategory->getSplitCategoryArray(2, true)}]',
|
||||
'item_category4': '[{$gtmCategory->getSplitCategoryArray(3, true)}]',
|
||||
[{/if}]
|
||||
'quantity': 1
|
||||
}[{if !$smarty.foreach.gtmProducts.last}],[{/if}]
|
||||
|
@ -16,15 +16,16 @@
|
||||
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
|
||||
[{assign var="gtmCategory" value=$gtmProduct->getCategory()}]
|
||||
{
|
||||
'item_oxid': '[{$gtmProduct->getFieldData("oxid")}]',
|
||||
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
|
||||
'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]',
|
||||
'price': [{$d3PriceObject->getPrice()}],
|
||||
'item_name': '[{$gtmProduct->getRawFieldData("oxtitle")}]',
|
||||
[{oxhasrights ident="SHOWARTICLEPRICE"}]'price': [{$d3PriceObject->getPrice()}],[{/oxhasrights}]
|
||||
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/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_category2': '[{$gtmCategory->getSplitCategoryArray(1, true)}]',
|
||||
'item_category3': '[{$gtmCategory->getSplitCategoryArray(2, true)}]',
|
||||
'item_category4': '[{$gtmCategory->getSplitCategoryArray(3, true)}]',
|
||||
'item_list_name':'[{$gtmCategory->getSplitCategoryArray()}]',
|
||||
[{/if}]
|
||||
'quantity': 1
|
||||
|
@ -1,48 +0,0 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{block name="d3_ga4_remove_from_cart_block"}]
|
||||
[{if $hasBeenReloaded}]
|
||||
[{assign var="d3BasketPrice" value=$oxcmp_basket->getPrice()}]
|
||||
[{capture assign=d3_ga4_remove_from_cart}]
|
||||
[{strip}]
|
||||
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
||||
dataLayer.push({
|
||||
'isRemoveFromCart': true,
|
||||
'event': 'remove_from_cart',
|
||||
'eventLabel':'remove_from_cart',
|
||||
'ecommerce': {
|
||||
'actionField': "step: 1",
|
||||
'currency': "[{$currency->name}]",
|
||||
'value': [{$d3BasketPrice->getPrice()}],
|
||||
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
|
||||
'items': [
|
||||
[{foreach from=$toRemoveArticles->getArray() name=gtmRemovedItems item=rmItem key=rmItemindex}]
|
||||
[{assign var="d3oItemPrice" value=$rmItem->getPrice()}]
|
||||
[{assign var="gtmBasketItemCategory" value=$rmItem->getCategory()}]
|
||||
{
|
||||
'item_id': '[{$rmItem->getFieldData('oxartnum')}]',
|
||||
'item_name': '[{$rmItem->getFieldData('oxtitle')}]',
|
||||
'item_variant': '[{$rmItem->getFieldData('oxvarselect')}]',
|
||||
[{if $gtmBasketItemCategory}]
|
||||
'item_category': '[{$gtmBasketItemCategory->getSplitCategoryArray(0)}]',
|
||||
'item_category_2': '[{$gtmBasketItemCategory->getSplitCategoryArray(1)}]',
|
||||
'item_category_3': '[{$gtmBasketItemCategory->getSplitCategoryArray(2)}]',
|
||||
'item_category_4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3)}]',
|
||||
'item_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]',
|
||||
[{/if}]
|
||||
'price': [{$d3oItemPrice->getPrice()}],
|
||||
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
|
||||
'quantity': '[{$rmItem->getFieldData('d3AmountThatGotRemoved')}]',
|
||||
'position': [{$smarty.foreach.gtmRemovedItems.index}]
|
||||
}[{if !$smarty.foreach.gtmRemovedItems.last}],[{/if}]
|
||||
[{/foreach}]
|
||||
]
|
||||
}[{if $oViewConf->isDebugModeOn()}],
|
||||
'debug_mode': 'true'
|
||||
[{/if}]
|
||||
});
|
||||
[{/strip}]
|
||||
[{/capture}]
|
||||
[{oxscript add=$d3_ga4_remove_from_cart}]
|
||||
[{/if}]
|
||||
[{/block}]
|
@ -1,44 +0,0 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{assign var="gtmProducts" value=$oView->getArticleList()}]
|
||||
|
||||
[{block name="d3_ga4_view_search_result_block"}]
|
||||
[{if $gtmProducts}]
|
||||
[{capture assign=d3_ga4_view_search_result}]
|
||||
[{strip}]
|
||||
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
|
||||
dataLayer.push({
|
||||
'event': 'view_search_result',
|
||||
'eventLabel':'view_search_result[{if $oViewConf->isDebugModeOn()}]_test[{/if}]',
|
||||
'ecommerce': {
|
||||
'search_term': '[{$searchparamforhtml}]',
|
||||
'items': [
|
||||
[{foreach from=$gtmProducts name="gtmProducts" item="gtmProduct"}]
|
||||
[{assign var="d3PriceObject" value=$gtmProduct->getPrice()}]
|
||||
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
|
||||
[{assign var="gtmCategory" value=$gtmProduct->getCategory()}]
|
||||
{
|
||||
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
|
||||
'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]',
|
||||
'price': [{$d3PriceObject->getPrice()}],
|
||||
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
||||
[{if $gtmCategory}]
|
||||
'item_category': '[{$gtmCategory->getSplitCategoryArray(0)}]',
|
||||
'item_category_2':'[{$gtmCategory->getSplitCategoryArray(1)}]',
|
||||
'item_category_3':'[{$gtmCategory->getSplitCategoryArray(2)}]',
|
||||
'item_category_4':'[{$gtmCategory->getSplitCategoryArray(3)}]',
|
||||
'item_list_name':'[{$gtmCategory->getSplitCategoryArray()}]',
|
||||
[{/if}]
|
||||
'quantity': 1
|
||||
}[{if !$smarty.foreach.gtmProducts.last}],[{/if}]
|
||||
[{/foreach}]
|
||||
]
|
||||
}[{if $oViewConf->isDebugModeOn()}],
|
||||
'debug_mode': 'true'
|
||||
[{/if}]
|
||||
});
|
||||
[{/strip}]
|
||||
[{/capture}]
|
||||
[{oxscript add=$d3_ga4_view_search_result}]
|
||||
[{/if}]
|
||||
[{/block}]
|
55
CHANGELOG.md
55
CHANGELOG.md
@ -4,9 +4,60 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [unreleased](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.17.2...rel_2.x) - 2024-x
|
||||
## [unreleased](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.24.0.0...rel_2.x) - 2025-x
|
||||
|
||||
## [2.18.2](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.18.0...2.18.1) - 2024-06-25
|
||||
## [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
|
||||
### Fixed
|
||||
- missing parameters for widget.php call
|
||||
|
||||
## [2.20.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.20.0...2.20.1) - 2024-09-11
|
||||
### Fixed
|
||||
- missing currency name in begin_checkout template
|
||||
## [2.20.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.19.0...2.20.0) - 2024-08-20
|
||||
### Added
|
||||
- new event "begin_checkout"
|
||||
- new event "add_payment_info"
|
||||
|
||||
## [2.19.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.18.2...2.19.0) - 2024-08-10
|
||||
### Fixed
|
||||
- usage of not yet existing function
|
||||
|
||||
## [2.18.2](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.18.1...2.18.2) - 2024-06-25
|
||||
### Fixed
|
||||
- oe-console apply-configuration triggers on-activate and overwrites existing values
|
||||
|
||||
|
@ -18,9 +18,14 @@ namespace D3\GoogleAnalytics4\Modules\Core{
|
||||
}
|
||||
|
||||
namespace D3\GoogleAnalytics4\Modules\Application\Model{
|
||||
|
||||
use OxidEsales\Eshop\Application\Model\Payment;
|
||||
|
||||
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 gtmPayment_parent extends Payment {}
|
||||
}
|
||||
|
||||
namespace D3\GoogleAnalytics4\Modules\Application\Controller{
|
||||
|
@ -2,8 +2,51 @@
|
||||
|
||||
namespace D3\GoogleAnalytics4\Modules\Application\Model;
|
||||
|
||||
use OxidEsales\Eshop\Core\Registry;
|
||||
use OxidEsales\Eshop\Core\ViewConfig;
|
||||
|
||||
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
|
||||
* @return string
|
||||
@ -11,7 +54,8 @@ trait articleTreeStructure
|
||||
public function getSplitCategoryArray(int $indexOfArray = -1, bool $bShallTakeStd = false) :string
|
||||
{
|
||||
if ($bShallTakeStd){
|
||||
$splitCatArray =
|
||||
$bUseRealCatTitles = (bool)Registry::get(ViewConfig::class)->d3GetModuleConfigParam('_blUseRealCategoyTitles');
|
||||
$splitCatArray = $bUseRealCatTitles ? $this->getParentCategoryTitles() :
|
||||
array_values(
|
||||
array_filter(
|
||||
explode(
|
||||
|
16
Modules/Application/Model/gtmPayment.php
Normal file
16
Modules/Application/Model/gtmPayment.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace D3\GoogleAnalytics4\Modules\Application\Model;
|
||||
|
||||
class gtmPayment extends gtmPayment_parent
|
||||
{
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function gtmGetSelectedPaymentName() :string
|
||||
{
|
||||
return (string)$this->getFieldData('oxpayments__oxdesc')?: 'No payment name available';
|
||||
}
|
||||
}
|
@ -54,7 +54,7 @@ class ViewConfig extends ViewConfig_parent
|
||||
{
|
||||
/** @var ManagerHandler $oManagerHandler */
|
||||
$oManagerHandler = oxNew(ManagerHandler::class);
|
||||
$this->sCookieManagerType = $oManagerHandler->getCurrManager();
|
||||
$this->sCookieManagerType = $oManagerHandler->getActManager();
|
||||
}
|
||||
}
|
||||
|
||||
@ -66,6 +66,14 @@ class ViewConfig extends ViewConfig_parent
|
||||
return (bool) $this->d3GetModuleConfigParam('_blEnableOwnCookieManager');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getCharsToReplaceInCategorTitles(): string
|
||||
{
|
||||
return (string) $this->d3GetModuleConfigParam('_sReplaceChars');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
@ -88,7 +96,7 @@ class ViewConfig extends ViewConfig_parent
|
||||
$sCookieID = trim($this->d3GetModuleConfigParam('_sControlParameter'));
|
||||
|
||||
// Netensio Cookie Manager
|
||||
if ($this->sCookieManagerType === ManagerTypes::NET_COOKIE_MANAGER) {
|
||||
if ($this->sCookieManagerType === ManagerTypes::INTERNAL_NET_COOKIE_MANAGER) {
|
||||
$oSession = Registry::getSession();
|
||||
$aCookies = $oSession->getVariable("aCookieSel");
|
||||
|
||||
@ -96,20 +104,18 @@ class ViewConfig extends ViewConfig_parent
|
||||
}
|
||||
|
||||
// Aggrosoft Cookie Consent
|
||||
if ($this->sCookieManagerType === ManagerTypes::AGCOOKIECOMPLIANCE) {
|
||||
if ($this->sCookieManagerType === ManagerTypes::INTERNAL_AGCOOKIECOMPLIANCE) {
|
||||
if (method_exists($this, "isCookieCategoryEnabled")) {
|
||||
return $this->isCookieCategoryEnabled($sCookieID);
|
||||
}
|
||||
}
|
||||
|
||||
// UserCentrics or consentmanager
|
||||
|
||||
if (
|
||||
$this->sCookieManagerType === Usercentrics::sModuleIncludationInternalName
|
||||
or $this->sCookieManagerType === Usercentrics::sExternalIncludationInternalName
|
||||
or $this->sCookieManagerType === ManagerTypes::CONSENTMANAGER
|
||||
or $this->sCookieManagerType === ManagerTypes::COOKIEFIRST
|
||||
or $this->sCookieManagerType === ManagerTypes::COOKIEBOT
|
||||
or $this->sCookieManagerType === ManagerTypes::EXTERNAL_SERVICE
|
||||
in_array
|
||||
(
|
||||
$this->sCookieManagerType,
|
||||
(oxNew(ManagerTypes::class)->scriptTagDeliveredByDefaultArray())
|
||||
)
|
||||
)
|
||||
{
|
||||
// Always needs the script-tags delivered to the DOM.
|
||||
@ -141,16 +147,16 @@ class ViewConfig extends ViewConfig_parent
|
||||
return 'data-usercentrics="' . $sControlParameter . '" type="text/plain" async=""';
|
||||
}
|
||||
|
||||
if ($this->sCookieManagerType === ManagerTypes::CONSENTMANAGER)
|
||||
if ($this->sCookieManagerType === ManagerTypes::INTERNAL_CONSENTMANAGER)
|
||||
{
|
||||
return 'type="text/plain" class="cmplazyload" data-cmp-vendor="'.$sControlParameter.'"';
|
||||
}
|
||||
|
||||
if ($this->sCookieManagerType === ManagerTypes::COOKIEFIRST){
|
||||
if ($this->sCookieManagerType === ManagerTypes::INTERNAL_COOKIEFIRST){
|
||||
return 'type="text/plain" data-cookiefirst-category="' . $sControlParameter .'"';
|
||||
}
|
||||
|
||||
if ($this->sCookieManagerType === ManagerTypes::COOKIEBOT){
|
||||
if ($this->sCookieManagerType === ManagerTypes::INTERNAL_COOKIEBOT){
|
||||
return 'type="text/plain" data-cookieconsent="' . $sControlParameter .'"';
|
||||
}
|
||||
|
||||
@ -209,15 +215,50 @@ class ViewConfig extends ViewConfig_parent
|
||||
'sessionid' => session_id(),
|
||||
//'httpref' => $_SERVER["HTTP_REFERER"] ?? "unknown"
|
||||
];
|
||||
|
||||
$dataLayer = $this->d3AdditionalGlobalAnalyticsVariables($dataLayer);
|
||||
|
||||
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
|
||||
{
|
||||
return $this->d3GetModuleConfigParam("_blEnableDebug")?: false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function useRealCategoryTitles(): bool
|
||||
{
|
||||
return $this->d3GetModuleConfigParam("_blUseRealCategoyTitles") ?: false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @throws ContainerExceptionInterface
|
||||
|
43
Modules/Core/WidgetControl.php
Normal file
43
Modules/Core/WidgetControl.php
Normal file
@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace D3\GoogleAnalytics4\Modules\Core;
|
||||
|
||||
use OxidEsales\EshopCommunity\Core\Registry;
|
||||
|
||||
class WidgetControl extends WidgetControl_parent{
|
||||
protected function getFrontendStartControllerKey() // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
|
||||
{
|
||||
/*
|
||||
* array (
|
||||
'force_sid' => '2pistlaubiq58qtg3moudei0la',
|
||||
'lang' => '0',
|
||||
'actcontrol' => 'details',
|
||||
'anid' => '064471',
|
||||
'cl' => 'oxwarticledetails',
|
||||
'cnid' => '159dd0f2fb2bd6e24ace53a0f1913797',
|
||||
'listtype' => 'list',
|
||||
'nocookie' => '1',
|
||||
'oxwparent' => 'details',
|
||||
'sid' => '2pistlaubiq58qtg3moudei0la',
|
||||
'stoken' => 'A22D0F9E',
|
||||
'varselid' =>
|
||||
array (
|
||||
0 => 'b842982bf522aa839bd88221f562fce8',
|
||||
),
|
||||
)
|
||||
*/
|
||||
$sScriptName = $_SERVER['SCRIPT_NAME'];
|
||||
if($sScriptName !== '/widget.php')
|
||||
{
|
||||
return parent::getFrontendStartControllerKey();
|
||||
}
|
||||
|
||||
$aParameter = $_GET;
|
||||
if(is_null($aParameter['actcontrol']) and is_null($aParameter['oxwparent']))
|
||||
{
|
||||
return 'D3\GoogleAnalytics4\Application\Component\Widget\d3GtmStartWidget';
|
||||
}
|
||||
|
||||
return parent::getFrontendStartControllerKey();
|
||||
}
|
||||
}
|
@ -20,7 +20,7 @@ class Actions
|
||||
public function d3SaveDefaultSettings(string $sVarType, string $sSettingName, string $sSettingValue){
|
||||
$oConfig = Registry::getConfig();
|
||||
|
||||
if (trim($this->d3GetModuleConfigParam($sSettingName)) !== trim($sSettingValue)){
|
||||
if ($this->d3GetModuleConfigParam($sSettingName) and (trim($this->d3GetModuleConfigParam($sSettingName)) !== trim($sSettingValue))){
|
||||
$sSettingValue = trim($this->d3GetModuleConfigParam($sSettingName));
|
||||
}
|
||||
|
||||
@ -39,6 +39,6 @@ class Actions
|
||||
*/
|
||||
public function d3GetModuleConfigParam(string $configParamName)
|
||||
{
|
||||
return Registry::get(ViewConfig::class)->d3GetModuleConfigParam($configParamName);
|
||||
return Registry::getConfig()->getShopConfVar(Constants::OXID_MODULE_ID.$configParamName, null, Constants::OXID_MODULE_ID);
|
||||
}
|
||||
}
|
@ -43,13 +43,20 @@
|
||||
}
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1",
|
||||
"oxid-esales/oxideshop-ce": "^6.5",
|
||||
"google/apiclient":" ^2.0",
|
||||
"phpstan/phpstan": "^1.10" },
|
||||
"autoload": {
|
||||
"php": "7.1 - 8.2",
|
||||
"oxid-esales/oxideshop-ce": "^6.5.3",
|
||||
"google/apiclient":" ^2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpstan/phpstan": "^1.10"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"D3\\GoogleAnalytics4\\": "../../../source/modules/d3/googleanalytics4"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"php-cs-fixer_audit": "./vendor/bin/php-cs-fixer list-files --config=./vendor/d3/googleanalytics4/.php-cs-fixer.php",
|
||||
"php-cs-fixer_fix": "./vendor/bin/php-cs-fixer fix --config=./vendor/d3/googleanalytics4/.php-cs-fixer.php"
|
||||
}
|
||||
}
|
197
metadata.php
197
metadata.php
@ -16,6 +16,7 @@ use D3\GoogleAnalytics4\Modules\Application\Controller\d3GtmStartController;
|
||||
use D3\GoogleAnalytics4\Modules\Application\Controller\ThankYouController;
|
||||
use D3\GoogleAnalytics4\Modules\Application\Model\Basket as Basket;
|
||||
use D3\GoogleAnalytics4\Modules\Application\Model\Category as Category;
|
||||
use D3\GoogleAnalytics4\Modules\Application\Model\gtmPayment as gtmPayment;
|
||||
use D3\GoogleAnalytics4\Modules\Application\Model\Manufacturer as Manufacturer;
|
||||
use D3\GoogleAnalytics4\Modules\Core\ViewConfig;
|
||||
use OxidEsales\Eshop\Application\Component\BasketComponent as OEBasketComponent;
|
||||
@ -33,12 +34,13 @@ use OxidEsales\Eshop\Application\Controller\ThankYouController as OEThankYouCont
|
||||
use OxidEsales\Eshop\Application\Model\Basket as OEBasket;
|
||||
use OxidEsales\Eshop\Application\Model\Category as OECategory;
|
||||
use OxidEsales\Eshop\Application\Model\Manufacturer as OEManufacturer;
|
||||
use OxidEsales\Eshop\Application\Model\Payment as OEPayment;
|
||||
use OxidEsales\Eshop\Core\ViewConfig as OEViewConfig;
|
||||
|
||||
$sMetadataVersion = '2.1';
|
||||
$aModule = [
|
||||
'id' => Constants::OXID_MODULE_ID,
|
||||
'title' => 'Google Analytics 4',
|
||||
$aModule = [
|
||||
'id' => Constants::OXID_MODULE_ID,
|
||||
'title' => 'Google Analytics 4',
|
||||
'description' => "Dieses Modul bietet die Möglichkeit in Ihrem OXID eShop (6.x) die neue 'Property'
|
||||
Google Analytics 4 (GA4) von Google zu integrieren.<br>
|
||||
Hierfür stehen Ihnen verschiedene 'templates' zur verfügung,
|
||||
@ -49,135 +51,156 @@ $aModule = [
|
||||
<hr>
|
||||
Die Entwicklung basiert auf einem Fork von Marat Bedoev - <a href='https://github.com/vanilla-thunder/oxid-module-gtm'>Github-Link</a>
|
||||
",
|
||||
'thumbnail' => 'thumbnail.png',
|
||||
'version' => '2.18.2',
|
||||
'author' => 'Data Development (Inh.: Thomas Dartsch)',
|
||||
'email' => 'support@shopmodule.com',
|
||||
'url' => 'https://www.oxidmodule.com/',
|
||||
'thumbnail' => 'thumbnail.png',
|
||||
'version' => '2.24.0.0',
|
||||
'author' => 'Data Development (Inh.: Thomas Dartsch)',
|
||||
'email' => 'support@shopmodule.com',
|
||||
'url' => 'https://www.oxidmodule.com/',
|
||||
'controllers' => [
|
||||
'd3googleanalytics4_main' => GA4AdminUserInterfaceMainController::class
|
||||
],
|
||||
'extend' => [
|
||||
'extend' => [
|
||||
// Core
|
||||
OEViewConfig::class => ViewConfig::class,
|
||||
\OxidEsales\Eshop\Core\WidgetControl::class => \D3\GoogleAnalytics4\Modules\Core\WidgetControl::class,
|
||||
|
||||
// Model
|
||||
OECategory::class => Category::class,
|
||||
OEBasket::class => Basket::class,
|
||||
OEManufacturer::class => Manufacturer::class,
|
||||
OECategory::class => Category::class,
|
||||
OEBasket::class => Basket::class,
|
||||
OEManufacturer::class => Manufacturer::class,
|
||||
OEPayment::class => gtmPayment::class,
|
||||
|
||||
// Controller
|
||||
OEBasketController::class => BasketController::class,
|
||||
OEThankYouController::class => ThankYouController::class,
|
||||
OEArticleListController::class => ArticleListController_AddToCartHelpMethods::class,
|
||||
OEArticleDetailsController::class => ArticleDetailsController::class,
|
||||
OEAccountNoticeListController::class => d3GtmAccountNoticeListController::class,
|
||||
OEAccountRecommlistController::class => d3GtmAccountRecommlistController::class,
|
||||
OEAccountWishlistController::class => d3GtmAccountWishlistController::class,
|
||||
OEStartController::class => d3GtmStartController::class,
|
||||
OESearchController::class => d3GtmSearchController::class,
|
||||
OEManufacturerListController::class => d3GtmManufacturerListController::class,
|
||||
OEBasketController::class => BasketController::class,
|
||||
OEThankYouController::class => ThankYouController::class,
|
||||
OEArticleListController::class => ArticleListController_AddToCartHelpMethods::class,
|
||||
OEArticleDetailsController::class => ArticleDetailsController::class,
|
||||
OEAccountNoticeListController::class => d3GtmAccountNoticeListController::class,
|
||||
OEAccountRecommlistController::class => d3GtmAccountRecommlistController::class,
|
||||
OEAccountWishlistController::class => d3GtmAccountWishlistController::class,
|
||||
OEStartController::class => d3GtmStartController::class,
|
||||
OESearchController::class => d3GtmSearchController::class,
|
||||
OEManufacturerListController::class => d3GtmManufacturerListController::class,
|
||||
|
||||
// Component
|
||||
OEArticleDetails::class => d3GtmWidgetArticleDetails::class,
|
||||
OEBasketComponent::class => d3GtmBasketComponentExtension::class,
|
||||
OEArticleDetails::class => d3GtmWidgetArticleDetails::class,
|
||||
OEBasketComponent::class => d3GtmBasketComponentExtension::class,
|
||||
],
|
||||
'templates' => [
|
||||
'templates' => [
|
||||
// Event files that store the GA4 Event-Information
|
||||
'event/add_to_cart.tpl' => 'd3/googleanalytics4/Application/views/event/add_to_cart.tpl',
|
||||
'event/view_item.tpl' => 'd3/googleanalytics4/Application/views/event/view_item.tpl',
|
||||
'event/view_cart.tpl' => 'd3/googleanalytics4/Application/views/event/view_cart.tpl',
|
||||
'event/purchase.tpl' => 'd3/googleanalytics4/Application/views/event/purchase.tpl',
|
||||
'event/view_item_list.tpl' => 'd3/googleanalytics4/Application/views/event/view_item_list.tpl',
|
||||
'event/view_search_result.tpl' => 'd3/googleanalytics4/Application/views/event/view_search_result.tpl',
|
||||
'event/remove_from_cart.tpl' => 'd3/googleanalytics4/Application/views/event/remove_from_cart.tpl',
|
||||
'event/add_to_cart.tpl' => 'd3/googleanalytics4/Application/views/event/add_to_cart.tpl',
|
||||
'event/view_item.tpl' => 'd3/googleanalytics4/Application/views/event/view_item.tpl',
|
||||
'event/view_cart.tpl' => 'd3/googleanalytics4/Application/views/event/view_cart.tpl',
|
||||
'event/begin_checkout.tpl' => 'd3/googleanalytics4/Application/views/event/begin_checkout.tpl',
|
||||
'event/add_payment_info.tpl' => 'd3/googleanalytics4/Application/views/event/add_payment_info.tpl',
|
||||
'event/purchase.tpl' => 'd3/googleanalytics4/Application/views/event/purchase.tpl',
|
||||
'event/view_item_list.tpl' => 'd3/googleanalytics4/Application/views/event/view_item_list.tpl',
|
||||
'event/view_search_result.tpl' => 'd3/googleanalytics4/Application/views/event/view_search_result.tpl',
|
||||
'event/remove_from_cart.tpl' => 'd3/googleanalytics4/Application/views/event/remove_from_cart.tpl',
|
||||
|
||||
// complete overwritten file of OXID-Originals
|
||||
// the path of the template-name is the original path to the file in OXID-context from tpl/->
|
||||
'page/account/d3gtmnoticelist.tpl' => 'd3/googleanalytics4/Application/views/tpl/page/account/d3gtmnoticelist.tpl',
|
||||
'page/account/d3gtmrecommendationlist.tpl' => 'd3/googleanalytics4/Application/views/tpl/page/account/d3gtmrecommendationlist.tpl',
|
||||
'page/account/d3gtmwishlist.tpl' => 'd3/googleanalytics4/Application/views/tpl/page/account/d3gtmwishlist.tpl',
|
||||
'page/account/d3gtmnoticelist.tpl' => 'd3/googleanalytics4/Application/views/tpl/page/account/d3gtmnoticelist.tpl',
|
||||
'page/account/d3gtmrecommendationlist.tpl' => 'd3/googleanalytics4/Application/views/tpl/page/account/d3gtmrecommendationlist.tpl',
|
||||
'page/account/d3gtmwishlist.tpl' => 'd3/googleanalytics4/Application/views/tpl/page/account/d3gtmwishlist.tpl',
|
||||
|
||||
// Admin Templates
|
||||
'ga4/admin/d3ga4uimain.tpl' => 'd3/googleanalytics4/Application/views/admin/tpl/d3googleanalytics4_main.tpl',
|
||||
'ga4/admin/d3ga4uiheaditem.tpl' => 'd3/googleanalytics4/Application/views/admin/tpl/d3googleanalytics4_headitem.tpl',
|
||||
'ga4/admin/d3ga4uimain.tpl' => 'd3/googleanalytics4/Application/views/admin/tpl/d3googleanalytics4_main.tpl',
|
||||
'ga4/admin/d3ga4uiheaditem.tpl' => 'd3/googleanalytics4/Application/views/admin/tpl/d3googleanalytics4_headitem.tpl',
|
||||
],
|
||||
'blocks' => [
|
||||
'blocks' => [
|
||||
// tag manager js
|
||||
[
|
||||
'template' => 'layout/base.tpl',
|
||||
'block' => 'head_meta_robots',
|
||||
'file' => '/Application/views/blocks/_gtm_js.tpl',
|
||||
'block' => 'head_meta_robots',
|
||||
'file' => '/Application/views/blocks/_gtm_js.tpl',
|
||||
'position' => 150
|
||||
],
|
||||
// tag manager nojs
|
||||
[
|
||||
'template' => 'layout/base.tpl',
|
||||
'block' => 'theme_svg_icons',
|
||||
'file' => '/Application/views/blocks/_gtm_nojs.tpl'
|
||||
'block' => 'theme_svg_icons',
|
||||
'file' => '/Application/views/blocks/_gtm_nojs.tpl'
|
||||
],
|
||||
// details
|
||||
[
|
||||
'template' => 'page/details/inc/productmain.tpl',
|
||||
'block' => 'details_productmain_title',
|
||||
'file' => '/Application/views/blocks/view_item.tpl',
|
||||
'block' => 'details_productmain_title',
|
||||
'file' => '/Application/views/blocks/view_item.tpl',
|
||||
'position' => 150
|
||||
],
|
||||
// checkout
|
||||
// View Cart
|
||||
[
|
||||
'template' => 'page/checkout/basket.tpl',
|
||||
'block' => 'checkout_basket_main',
|
||||
'file' => '/Application/views/blocks/view_cart.tpl'
|
||||
],
|
||||
[
|
||||
'template' => 'page/checkout/thankyou.tpl',
|
||||
'block' => 'checkout_thankyou_main',
|
||||
'file' => '/Application/views/blocks/purchase.tpl'
|
||||
],
|
||||
// Lists
|
||||
// view_item_list
|
||||
[
|
||||
'template' => 'page/list/list.tpl',
|
||||
'block' => 'page_list_productlist',
|
||||
'file' => '/Application/views/blocks/view_item_list.tpl',
|
||||
'position' => 150
|
||||
],
|
||||
// view_search_result
|
||||
[
|
||||
'template' => 'page/search/search.tpl',
|
||||
'block' => 'search_results',
|
||||
'file' => '/Application/views/blocks/view_search_result.tpl',
|
||||
'position' => 150
|
||||
'block' => 'checkout_basket_main',
|
||||
'file' => '/Application/views/blocks/view_cart.tpl'
|
||||
],
|
||||
// add_to_cart
|
||||
[
|
||||
'template' => 'page/details/inc/productmain.tpl',
|
||||
'block' => 'details_productmain_tobasket',
|
||||
'file' => '/Application/views/blocks/details_productmain_tobasket.tpl',
|
||||
'position' => 150
|
||||
],
|
||||
[
|
||||
'template' => 'page/list/list.tpl',
|
||||
'block' => 'page_list_listbody',
|
||||
'file' => '/Application/views/blocks/page_list_listbody.tpl',
|
||||
'position' => 150
|
||||
],
|
||||
[
|
||||
'template' => 'page/shop/start.tpl',
|
||||
'block' => 'start_welcome_text',
|
||||
'file' => '/Application/views/blocks/start_welcome_text.tpl',
|
||||
'block' => 'details_productmain_tobasket',
|
||||
'file' => '/Application/views/blocks/details_productmain_tobasket.tpl',
|
||||
'position' => 150
|
||||
],
|
||||
// remove_from_cart
|
||||
[
|
||||
'template' => 'page/checkout/basket.tpl',
|
||||
'block' => 'checkout_basket_main',
|
||||
'file' => '/Application/views/blocks/remove_from_cart.tpl',
|
||||
'block' => 'checkout_basket_main',
|
||||
'file' => '/Application/views/blocks/remove_from_cart.tpl',
|
||||
'position' => 150
|
||||
]
|
||||
],
|
||||
[
|
||||
'template' => 'page/checkout/thankyou.tpl',
|
||||
'block' => 'checkout_thankyou_main',
|
||||
'file' => '/Application/views/blocks/purchase.tpl'
|
||||
],
|
||||
// Lists
|
||||
// view_item_list
|
||||
[
|
||||
'template' => 'page/list/list.tpl',
|
||||
'block' => 'page_list_productlist',
|
||||
'file' => '/Application/views/blocks/view_item_list.tpl',
|
||||
'position' => 150
|
||||
],
|
||||
// view_search_result
|
||||
[
|
||||
'template' => 'page/search/search.tpl',
|
||||
'block' => 'search_results',
|
||||
'file' => '/Application/views/blocks/view_search_result.tpl',
|
||||
'position' => 150
|
||||
],
|
||||
[
|
||||
'template' => 'page/list/list.tpl',
|
||||
'block' => 'page_list_listbody',
|
||||
'file' => '/Application/views/blocks/page_list_listbody.tpl',
|
||||
'position' => 150
|
||||
],
|
||||
[
|
||||
'template' => 'page/shop/start.tpl',
|
||||
'block' => 'start_welcome_text',
|
||||
'file' => '/Application/views/blocks/start_welcome_text.tpl',
|
||||
'position' => 150
|
||||
],
|
||||
// Checkout process
|
||||
// Begin CHeckout
|
||||
[
|
||||
'template' => 'page/checkout/user.tpl',
|
||||
'block' => 'checkout_user_main',
|
||||
'file' => '/Application/views/blocks/begin_checkout.tpl',
|
||||
'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',
|
||||
'block' => 'checkout_order_main',
|
||||
'file' => '/Application/views/blocks/add_payment_info.tpl',
|
||||
'position' => 150
|
||||
],
|
||||
],
|
||||
'events' => [
|
||||
'onActivate' => '\D3\GoogleAnalytics4\Setup\Events::onActivate',
|
||||
'onDeactivate' => '\D3\GoogleAnalytics4\Setup\Events::onDeactivate',
|
||||
'events' => [
|
||||
'onActivate' => '\D3\GoogleAnalytics4\Setup\Events::onActivate',
|
||||
'onDeactivate' => '\D3\GoogleAnalytics4\Setup\Events::onDeactivate',
|
||||
],
|
||||
];
|
Verwijs in nieuw issue
Block a user