Compare commits
25 Commits
Author | SHA1 | Date | |
---|---|---|---|
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 |
@ -6,10 +6,8 @@
|
||||
|
||||
$config = new PhpCsFixer\Config();
|
||||
return $config->setRules([
|
||||
'@PHP81Migration' => true,
|
||||
'@PSR12' => true,
|
||||
'php_unit_test_class_requires_covers' => true,
|
||||
'doctrine_annotation_indentation' => true,
|
||||
'@PHP73Migration' => true,
|
||||
'@PSR12' => true
|
||||
])
|
||||
->setFinder($finder)
|
||||
;
|
@ -12,7 +12,7 @@ use OxidEsales\Eshop\Core\ViewConfig;
|
||||
|
||||
class GA4AdminUserInterface_main extends \OxidEsales\Eshop\Application\Controller\Admin\AdminDetailsController
|
||||
{
|
||||
protected $_sThisTemplate = '@' . Constants::OXID_MODULE_ID . '/admin/d3ga4uimain';
|
||||
protected $_sThisTemplate = 'ga4/admin/d3ga4uimain.tpl';
|
||||
|
||||
public function render()
|
||||
{
|
||||
@ -37,8 +37,10 @@ class GA4AdminUserInterface_main extends \OxidEsales\Eshop\Application\Controlle
|
||||
'_blEnableDebug',
|
||||
'_blEnableConsentMode',
|
||||
'_blEnableOwnCookieManager',
|
||||
'_blUseRealCategoyTitles',
|
||||
'_blEnableMeasurementCapabilities',
|
||||
'_blEnableUsercentricsConsentModeApi',
|
||||
'_blViewItemAddVariants',
|
||||
];
|
||||
|
||||
foreach ($aCheckBoxParams as $checkBoxName){
|
||||
|
@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace D3\GoogleAnalytics4\Application\Model\CMP;
|
||||
|
||||
|
||||
abstract class ConsentManagementPlatformBaseModel extends \OxidEsales\Eshop\Core\Model\BaseModel implements ConsentManagementPlatformInterface
|
||||
{
|
||||
public string $sCMPName;
|
||||
|
@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace D3\GoogleAnalytics4\Application\Model\CMP;
|
||||
|
||||
|
||||
use D3\GoogleAnalytics4\Application\Model\ManagerTypes;
|
||||
|
||||
/**
|
||||
@ -17,8 +18,8 @@ use D3\GoogleAnalytics4\Application\Model\ManagerTypes;
|
||||
*/
|
||||
class Usercentrics extends ConsentManagementPlatformBaseModel
|
||||
{
|
||||
public const sExternalIncludationPublicName = "( Externe Einbindung ) Usercentrics";
|
||||
public const sExternalIncludationInternalName = "usercentrics";
|
||||
public const sModuleIncludationPublicName = "( Modul ) Usercentrics";
|
||||
public const sModuleIncludationInternalName = "oxps_usercentrics";
|
||||
const sExternalIncludationPublicName = "( Externe Einbindung ) Usercentrics";
|
||||
const sExternalIncludationInternalName = "usercentrics";
|
||||
const sModuleIncludationPublicName = "( Modul ) Usercentrics";
|
||||
const sModuleIncludationInternalName = "oxps_usercentrics";
|
||||
}
|
@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace D3\GoogleAnalytics4\Application\Model;
|
||||
|
||||
|
||||
class Constants
|
||||
{
|
||||
public const OXID_MODULE_ID = 'd3googleanalytics4';
|
||||
|
@ -6,26 +6,26 @@ use D3\GoogleAnalytics4\Application\Model\CMP\Usercentrics;
|
||||
|
||||
class ManagerTypes
|
||||
{
|
||||
public const EXTERNAL_SERVICE = "eigener Service";
|
||||
public const INTERNAL_EXTERNAL_SERVICE = "externalService";
|
||||
public const NET_COOKIE_MANAGER = "Netensio Cookie Manager";
|
||||
public const INTERNAL_NET_COOKIE_MANAGER = "net_cookie_manager";
|
||||
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
|
||||
*/
|
||||
public const AGCOOKIECOMPLIANCE = "Aggrosoft Cookie Compliance";
|
||||
public const INTERNAL_AGCOOKIECOMPLIANCE = "agcookiecompliance";
|
||||
const AGCOOKIECOMPLIANCE = "Aggrosoft Cookie Compliance";
|
||||
const INTERNAL_AGCOOKIECOMPLIANCE = "agcookiecompliance";
|
||||
|
||||
public const CONSENTMANAGER = "Consentmanager";
|
||||
public const INTERNAL_CONSENTMANAGER = "cmconsentmanager";
|
||||
const CONSENTMANAGER = "Consentmanager";
|
||||
const INTERNAL_CONSENTMANAGER = "cmconsentmanager";
|
||||
|
||||
public const COOKIEFIRST = "Cookiefirst";
|
||||
public const INTERNAL_COOKIEFIRST = "cookiefirst";
|
||||
const COOKIEFIRST = "Cookiefirst";
|
||||
const INTERNAL_COOKIEFIRST = "cookiefirst";
|
||||
|
||||
public const COOKIEBOT = "Cookiebot";
|
||||
public const INTERNAL_COOKIEBOT = "cookiebot";
|
||||
const COOKIEBOT = "Cookiebot";
|
||||
const INTERNAL_COOKIEBOT = "cookiebot";
|
||||
|
||||
/**
|
||||
* @return array
|
||||
@ -66,7 +66,7 @@ class ManagerTypes
|
||||
ManagerTypes::INTERNAL_CONSENTMANAGER,
|
||||
ManagerTypes::INTERNAL_COOKIEFIRST,
|
||||
ManagerTypes::INTERNAL_COOKIEBOT,
|
||||
ManagerTypes::INTERNAL_EXTERNAL_SERVICE,
|
||||
ManagerTypes::INTERNAL_EXTERNAL_SERVICE
|
||||
];
|
||||
}
|
||||
}
|
@ -1,13 +1,13 @@
|
||||
<?php
|
||||
|
||||
$sLangName = "Deutsch";
|
||||
// -------------------------------
|
||||
// RESOURCE IDENTITFIER = STRING
|
||||
// -------------------------------
|
||||
$aLang = [
|
||||
$aLang = array(
|
||||
'charset' => 'UTF-8',
|
||||
|
||||
'd3mxgoogleanalytics4' => 'Google Analytics 4',
|
||||
'd3mxd3modules' => $aLangCache['d3mxd3modules'] ?? 'Google Analytics 4',
|
||||
'd3mxgoogleanalytics4set' => 'Einstellungen',
|
||||
|
||||
// Base Translations
|
||||
@ -42,6 +42,17 @@ $aLang = [
|
||||
<br>
|
||||
Ein einfaches anschalten dieser Funktion regelt noch <strong>nicht</strong> die völlige Funktionsweise
|
||||
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',
|
||||
@ -121,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.',
|
||||
);
|
2
Application/views/admin_smarty/de/module_options.php → Application/views/admin/de/module_options.php
Normal file → Executable file
2
Application/views/admin_smarty/de/module_options.php → Application/views/admin/de/module_options.php
Normal file → Executable file
@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
@ -32,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',
|
@ -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>
|
||||
body {
|
||||
background-image: linear-gradient(to top, #d5d4d0 0%, #d5d4d0 1%, #eeeeec 31%, #efeeec 75%, #e9e9e7 100%);
|
||||
@ -145,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">
|
0
views/smarty/blocks/_gtm_js.tpl → Application/views/blocks/_gtm_js.tpl
Normal file → Executable file
0
views/smarty/blocks/_gtm_js.tpl → Application/views/blocks/_gtm_js.tpl
Normal file → Executable file
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"}]
|
@ -0,0 +1,3 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="event/add_to_cart.tpl" htmlIdAmountOfArticles='#amountToBasket'}]
|
3
Application/views/blocks/page_list_listbody.tpl
Normal file
3
Application/views/blocks/page_list_listbody.tpl
Normal file
@ -0,0 +1,3 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="event/add_to_cart.tpl" htmlIdAmountOfArticles='#amountToBasket'}]
|
3
Application/views/blocks/purchase.tpl
Normal file
3
Application/views/blocks/purchase.tpl
Normal file
@ -0,0 +1,3 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="event/purchase.tpl"}]
|
3
Application/views/blocks/remove_from_cart.tpl
Normal file
3
Application/views/blocks/remove_from_cart.tpl
Normal file
@ -0,0 +1,3 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="event/remove_from_cart.tpl"}]
|
3
Application/views/blocks/start_welcome_text.tpl
Normal file
3
Application/views/blocks/start_welcome_text.tpl
Normal file
@ -0,0 +1,3 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="event/add_to_cart.tpl" htmlIdAmountOfArticles='#amountToBasket'}]
|
3
Application/views/blocks/view_cart.tpl
Normal file
3
Application/views/blocks/view_cart.tpl
Normal file
@ -0,0 +1,3 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="event/view_cart.tpl"}]
|
3
Application/views/blocks/view_item.tpl
Normal file
3
Application/views/blocks/view_item.tpl
Normal file
@ -0,0 +1,3 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="event/view_item.tpl"}]
|
3
Application/views/blocks/view_item_list.tpl
Normal file
3
Application/views/blocks/view_item_list.tpl
Normal file
@ -0,0 +1,3 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="event/view_item_list.tpl"}]
|
3
Application/views/blocks/view_search_result.tpl
Normal file
3
Application/views/blocks/view_search_result.tpl
Normal file
@ -0,0 +1,3 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="event/view_search_result.tpl"}]
|
@ -26,17 +26,19 @@
|
||||
[{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')}]',
|
||||
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
|
||||
[{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': [{$gtmItemPriceObject->getPrice()}],
|
||||
[{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}]
|
@ -35,16 +35,17 @@
|
||||
'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_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
|
@ -24,18 +24,21 @@
|
||||
[{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]->getFieldData('oxtitle')}]',
|
||||
'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_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}]
|
@ -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}]
|
62
Application/views/event/view_item.tpl
Normal file
62
Application/views/event/view_item.tpl
Normal file
@ -0,0 +1,62 @@
|
||||
[{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()}]
|
||||
[{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}]
|
||||
});
|
||||
[{/strip}]
|
||||
[{/capture}]
|
||||
[{oxscript add=$smarty.capture.d3_ga4_view_item}]
|
||||
[{/block}]
|
@ -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_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
|
||||
@ -41,4 +42,4 @@
|
||||
[{/if}]
|
||||
[{/block}]
|
||||
|
||||
[{include file='@d3googleanalytics4/event/add_to_cart.tpl' htmlIdAmountOfArticles='#amountToBasket'}]
|
||||
[{include file="event/add_to_cart.tpl" htmlIdAmountOfArticles='#amountToBasket'}]
|
@ -8,7 +8,7 @@
|
||||
<p class="alert alert-info">[{oxmultilang ident="WISH_LIST_EMPTY"}]</p>
|
||||
[{/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}]
|
||||
[{/capture}]
|
@ -21,7 +21,7 @@
|
||||
[{/if}]
|
||||
[{/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}]
|
||||
[{/capture}]
|
@ -34,7 +34,7 @@
|
||||
</p>
|
||||
[{/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}]
|
||||
[{/capture}]
|
21
CHANGELOG.md
21
CHANGELOG.md
@ -4,18 +4,25 @@ 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/3.0.0.1...rel_3.x) - 2025-x
|
||||
## [unreleased](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.24.0.0...rel_2.x) - 2025-x
|
||||
|
||||
## [3.0.0.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/3.0.0.0...3.0.0.1) - 2024-03-19
|
||||
## [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
|
||||
|
||||
## [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.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
|
||||
|
@ -14,28 +14,18 @@
|
||||
*/
|
||||
|
||||
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{
|
||||
|
||||
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 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
|
||||
{
|
||||
}
|
||||
class gtmPayment_parent extends Payment {}
|
||||
}
|
||||
|
||||
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\StartController;
|
||||
|
||||
class BasketController_parent extends \OxidEsales\Eshop\Application\Controller\BasketController
|
||||
{
|
||||
}
|
||||
class ThankYouController_parent extends \OxidEsales\Eshop\Application\Controller\ThankYouController
|
||||
{
|
||||
}
|
||||
class BasketController_parent extends \OxidEsales\Eshop\Application\Controller\BasketController {}
|
||||
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{
|
||||
|
||||
use OxidEsales\Eshop\Application\Component\BasketComponent;
|
||||
|
||||
class d3GtmBasketComponentExtension_parent extends BasketComponent
|
||||
{
|
||||
}
|
||||
class d3GtmBasketComponentExtension_parent extends BasketComponent {}
|
||||
}
|
||||
|
||||
namespace D3\GoogleAnalytics4\Modules\Application\Component\Widget{
|
||||
|
||||
use OxidEsales\Eshop\Application\Component\Widget\ArticleDetails;
|
||||
|
||||
class d3GtmWidgetArticleDetails_parent extends ArticleDetails
|
||||
{
|
||||
}
|
||||
class d3GtmWidgetArticleDetails_parent extends ArticleDetails {}
|
||||
}
|
@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace D3\GoogleAnalytics4\Modules\Application\Component\Widget;
|
||||
|
||||
|
||||
class d3GtmWidgetArticleDetails extends d3GtmWidgetArticleDetails_parent
|
||||
{
|
||||
public function render()
|
||||
|
@ -52,7 +52,7 @@ class BasketController extends BasketController_parent
|
||||
'am' => $dAmount,
|
||||
'sel' => $aSel,
|
||||
'persparam' => $aPersParam,
|
||||
'basketitemid' => $sBasketItemId,
|
||||
'basketitemid' => $sBasketItemId
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@ class ThankYouController extends ThankYouController_parent
|
||||
$oOrder = $this->getOrder();
|
||||
$sCountryId = $oOrder->getFieldData('oxbillcountryid');
|
||||
|
||||
/** @var Country::class $oCountry */
|
||||
/** @var Country $oCountry */
|
||||
$oCountry = oxNew(Country::class);
|
||||
$oCountry->load($sCountryId);
|
||||
|
||||
|
@ -2,11 +2,9 @@
|
||||
|
||||
namespace D3\GoogleAnalytics4\Modules\Application\Controller;
|
||||
|
||||
use D3\GoogleAnalytics4\Application\Model\Constants;
|
||||
|
||||
class d3GtmAccountNoticeListController extends d3GtmAccountNoticeListController_parent
|
||||
{
|
||||
protected $_sThisTemplate = '@' . Constants::OXID_MODULE_ID . '/page/account/d3gtmnoticelist.tpl';
|
||||
protected $_sThisTemplate = 'page/account/d3gtmnoticelist.tpl';
|
||||
|
||||
public function render()
|
||||
{
|
||||
|
@ -2,11 +2,9 @@
|
||||
|
||||
namespace D3\GoogleAnalytics4\Modules\Application\Controller;
|
||||
|
||||
use D3\GoogleAnalytics4\Application\Model\Constants;
|
||||
|
||||
class d3GtmAccountRecommlistController extends d3GtmAccountRecommlistController_parent
|
||||
{
|
||||
protected $_sThisTemplate = '@' . Constants::OXID_MODULE_ID . '/page/account/d3gtmrecommendationlist.tpl';
|
||||
protected $_sThisTemplate = 'page/account/d3gtmrecommendationlist.tpl';
|
||||
|
||||
public function render()
|
||||
{
|
||||
|
@ -2,11 +2,9 @@
|
||||
|
||||
namespace D3\GoogleAnalytics4\Modules\Application\Controller;
|
||||
|
||||
use D3\GoogleAnalytics4\Application\Model\Constants;
|
||||
|
||||
class d3GtmAccountWishlistController extends d3GtmAccountWishlistController_parent
|
||||
{
|
||||
protected $_sThisTemplate = '@' . Constants::OXID_MODULE_ID . '/page/account/d3gtmwishlist.tpl';
|
||||
protected $_sThisTemplate = 'page/account/d3gtmwishlist.tpl';
|
||||
|
||||
public function render()
|
||||
{
|
||||
|
@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace D3\GoogleAnalytics4\Modules\Application\Controller;
|
||||
|
||||
|
||||
class d3GtmManufacturerListController extends d3GtmManufacturerListController_parent
|
||||
{
|
||||
public function render()
|
||||
|
@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace D3\GoogleAnalytics4\Modules\Application\Controller;
|
||||
|
||||
|
||||
class d3GtmSearchController extends d3GtmSearchController_parent
|
||||
{
|
||||
/**
|
||||
|
@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace D3\GoogleAnalytics4\Modules\Application\Model;
|
||||
|
||||
|
||||
class Vendor extends \OxidEsales\Eshop\Application\Model\Vendor
|
||||
{
|
||||
use articleTreeStructure;
|
||||
|
@ -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(
|
||||
|
@ -4,9 +4,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace D3\GoogleAnalytics4\Modules\Application\Model;
|
||||
|
||||
use OxidEsales\Eshop\Application\Model\Payment;
|
||||
use OxidEsales\Eshop\Core\Registry;
|
||||
|
||||
class gtmPayment extends gtmPayment_parent
|
||||
{
|
||||
/**
|
||||
@ -14,6 +11,6 @@ class gtmPayment extends gtmPayment_parent
|
||||
*/
|
||||
public function gtmGetSelectedPaymentName() :string
|
||||
{
|
||||
return $this->getFieldData('oxpayments__oxdesc') ?: 'No payment name available';
|
||||
return (string)$this->getFieldData('oxpayments__oxdesc')?: 'No payment name available';
|
||||
}
|
||||
}
|
@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
@ -19,16 +18,15 @@ use D3\GoogleAnalytics4\Application\Model\ManagerHandler;
|
||||
use D3\GoogleAnalytics4\Application\Model\ManagerTypes;
|
||||
use OxidEsales\Eshop\Application\Controller\FrontendController;
|
||||
use OxidEsales\Eshop\Core\Config;
|
||||
use OxidEsales\Eshop\Application\Model\User;
|
||||
use OxidEsales\Eshop\Core\Registry;
|
||||
use OxidEsales\Eshop\Application\Model\User;use OxidEsales\Eshop\Core\Registry;
|
||||
use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory;
|
||||
use OxidEsales\EshopCommunity\Internal\Framework\Module\Configuration\Exception\ModuleConfigurationNotFoundException;
|
||||
use OxidEsales\EshopCommunity\Internal\Framework\Module\Setup\Bridge\ModuleActivationBridgeInterface;
|
||||
use OxidEsales\EshopCommunity\Internal\Framework\Module\Configuration\Bridge\ModuleSettingBridgeInterface;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
class ViewConfig extends ViewConfig_parent
|
||||
{
|
||||
|
||||
// Google Tag Manager Container ID
|
||||
private $sContainerId = null;
|
||||
|
||||
@ -40,7 +38,8 @@ class ViewConfig extends ViewConfig_parent
|
||||
|
||||
public function getGtmContainerId()
|
||||
{
|
||||
if ($this->sContainerId === null) {
|
||||
if ($this->sContainerId === null)
|
||||
{
|
||||
$this->sContainerId = $this->d3GetModuleConfigParam("_sContainerID");
|
||||
}
|
||||
return $this->sContainerId;
|
||||
@ -51,7 +50,8 @@ class ViewConfig extends ViewConfig_parent
|
||||
*/
|
||||
public function defineCookieManagerType() :void
|
||||
{
|
||||
if ($this->sCookieManagerType === null) {
|
||||
if ($this->sCookieManagerType === null)
|
||||
{
|
||||
/** @var ManagerHandler $oManagerHandler */
|
||||
$oManagerHandler = oxNew(ManagerHandler::class);
|
||||
$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
|
||||
*/
|
||||
@ -103,11 +111,13 @@ class ViewConfig extends ViewConfig_parent
|
||||
}
|
||||
|
||||
if (
|
||||
in_array(
|
||||
in_array
|
||||
(
|
||||
$this->sCookieManagerType,
|
||||
(oxNew(ManagerTypes::class)->scriptTagDeliveredByDefaultArray())
|
||||
)
|
||||
) {
|
||||
)
|
||||
{
|
||||
// Always needs the script-tags delivered to the DOM.
|
||||
return true;
|
||||
}
|
||||
@ -132,11 +142,13 @@ class ViewConfig extends ViewConfig_parent
|
||||
if (
|
||||
$this->sCookieManagerType === Usercentrics::sModuleIncludationInternalName
|
||||
or $this->sCookieManagerType === Usercentrics::sExternalIncludationInternalName
|
||||
) {
|
||||
)
|
||||
{
|
||||
return 'data-usercentrics="' . $sControlParameter . '" type="text/plain" async=""';
|
||||
}
|
||||
|
||||
if ($this->sCookieManagerType === ManagerTypes::INTERNAL_CONSENTMANAGER) {
|
||||
if ($this->sCookieManagerType === ManagerTypes::INTERNAL_CONSENTMANAGER)
|
||||
{
|
||||
return 'type="text/plain" class="cmplazyload" data-cmp-vendor="'.$sControlParameter.'"';
|
||||
}
|
||||
|
||||
@ -157,7 +169,8 @@ class ViewConfig extends ViewConfig_parent
|
||||
*/
|
||||
public function isGA4enabled()
|
||||
{
|
||||
if ($this->blGA4enabled === null) {
|
||||
if ($this->blGA4enabled === null)
|
||||
{
|
||||
$this->blGA4enabled = $this->d3GetModuleConfigParam("_blEnableGA4");
|
||||
}
|
||||
|
||||
@ -171,9 +184,7 @@ class ViewConfig extends ViewConfig_parent
|
||||
|
||||
public function getGtmDataLayer()
|
||||
{
|
||||
if (!$this->getGtmContainerId()) {
|
||||
return "[]";
|
||||
}
|
||||
if (!$this->getGtmContainerId()) return "[]";
|
||||
|
||||
$oConfig = Registry::getConfig();
|
||||
$oView = $oConfig->getTopActiveView();
|
||||
@ -205,14 +216,49 @@ class ViewConfig extends ViewConfig_parent
|
||||
//'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
|
||||
@ -253,26 +299,4 @@ class ViewConfig extends ViewConfig_parent
|
||||
return (bool) ($sCMPPubName === Usercentrics::sExternalIncludationInternalName
|
||||
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;
|
||||
}
|
||||
}
|
@ -4,8 +4,7 @@ namespace D3\GoogleAnalytics4\Modules\Core;
|
||||
|
||||
use OxidEsales\EshopCommunity\Core\Registry;
|
||||
|
||||
class WidgetControl extends WidgetControl_parent
|
||||
{
|
||||
class WidgetControl extends WidgetControl_parent{
|
||||
protected function getFrontendStartControllerKey() // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
|
||||
{
|
||||
/*
|
||||
@ -28,12 +27,14 @@ class WidgetControl extends WidgetControl_parent
|
||||
)
|
||||
*/
|
||||
$sScriptName = $_SERVER['SCRIPT_NAME'];
|
||||
if ($sScriptName !== '/widget.php') {
|
||||
if($sScriptName !== '/widget.php')
|
||||
{
|
||||
return parent::getFrontendStartControllerKey();
|
||||
}
|
||||
|
||||
$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';
|
||||
}
|
||||
|
||||
|
12
README.md
12
README.md
@ -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.
|
||||
|
||||
```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.
|
||||
|
||||
```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".
|
||||
|
||||
### Wichtig!
|
||||
|
@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace D3\GoogleAnalytics4\Setup;
|
||||
|
||||
|
||||
use D3\GoogleAnalytics4\Application\Model\Constants;
|
||||
use OxidEsales\Eshop\Core\Registry;
|
||||
use OxidEsales\Eshop\Core\ViewConfig;
|
||||
@ -16,8 +17,7 @@ class Actions
|
||||
* @param string $sSettingValue
|
||||
* @return void
|
||||
*/
|
||||
public function d3SaveDefaultSettings(string $sVarType, string $sSettingName, string $sSettingValue)
|
||||
{
|
||||
public function d3SaveDefaultSettings(string $sVarType, string $sSettingName, string $sSettingValue){
|
||||
$oConfig = Registry::getConfig();
|
||||
|
||||
if ($this->d3GetModuleConfigParam($sSettingName) and (trim($this->d3GetModuleConfigParam($sSettingName)) !== trim($sSettingValue))){
|
||||
|
@ -4,6 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace D3\GoogleAnalytics4\Setup;
|
||||
|
||||
|
||||
class Events
|
||||
{
|
||||
/**
|
||||
@ -32,7 +33,5 @@ class Events
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public static function onDeactivate()
|
||||
{
|
||||
}
|
||||
public static function onDeactivate(){}
|
||||
}
|
@ -28,25 +28,35 @@
|
||||
"homepage": "https://www.d3data.de"
|
||||
}
|
||||
],
|
||||
"supports": {
|
||||
"support": {
|
||||
"email": "support@shopmodule.com"
|
||||
},
|
||||
"extra": {
|
||||
"oxideshop": {
|
||||
"blacklist-filter": [
|
||||
"*.md",
|
||||
"composer.json",
|
||||
".php-cs-fixer.php",
|
||||
"*.neon"
|
||||
],
|
||||
"target-directory": "d3/googleanalytics4"
|
||||
}
|
||||
},
|
||||
"require": {
|
||||
"php": "^8.0",
|
||||
"oxid-esales/oxideshop-ce": "7.0 - 7.1",
|
||||
"google/apiclient":" ^2.0",
|
||||
"phpstan/phpstan": "^1.10"
|
||||
"php": "7.1 - 8.2",
|
||||
"oxid-esales/oxideshop-ce": "^6.5.3",
|
||||
"google/apiclient":" ^2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"friendsofphp/php-cs-fixer": "^3.9"
|
||||
"phpstan/phpstan": "^1.10"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"D3\\GoogleAnalytics4\\": ""
|
||||
"D3\\GoogleAnalytics4\\": "../../../source/modules/d3/googleanalytics4"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"php-cs-fixer_audit": "./vendor/bin/php-cs-fixer list-files --config=./vendor/d3/google-analytics4/.php-cs-fixer.php",
|
||||
"php-cs-fixer_fix": "./vendor/bin/php-cs-fixer fix --config=./vendor/d3/google-analytics4/.php-cs-fixer.php"
|
||||
"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"
|
||||
}
|
||||
}
|
81
metadata.php
81
metadata.php
@ -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>
|
||||
",
|
||||
'thumbnail' => 'thumbnail.png',
|
||||
'version' => '3.0.0.1',
|
||||
'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,
|
||||
'd3googleanalytics4_main' => GA4AdminUserInterfaceMainController::class
|
||||
],
|
||||
'extend' => [
|
||||
// Core
|
||||
@ -88,109 +88,106 @@ $aModule = [
|
||||
],
|
||||
'templates' => [
|
||||
// Event files that store the GA4 Event-Information
|
||||
'@' . Constants::OXID_MODULE_ID . '/event/add_to_cart.tpl' => 'views/smarty/event/add_to_cart.tpl',
|
||||
'@' . Constants::OXID_MODULE_ID . '/event/view_item.tpl' => 'views/smarty/event/view_item.tpl',
|
||||
'@' . Constants::OXID_MODULE_ID . '/event/view_cart.tpl' => 'views/smarty/event/view_cart.tpl',
|
||||
'@' . Constants::OXID_MODULE_ID . '/event/begin_checkout.tpl' => 'views/smarty/event/begin_checkout.tpl',
|
||||
'@' . Constants::OXID_MODULE_ID . '/event/add_payment_info.tpl' => 'views/smarty/event/add_payment_info.tpl',
|
||||
'@' . Constants::OXID_MODULE_ID . '/event/purchase.tpl' => 'views/smarty/event/purchase.tpl',
|
||||
'@' . Constants::OXID_MODULE_ID . '/event/view_item_list.tpl' => 'views/smarty/event/view_item_list.tpl',
|
||||
'@' . Constants::OXID_MODULE_ID . '/event/view_search_result.tpl' => 'views/smarty/event/view_search_result.tpl',
|
||||
'@' . Constants::OXID_MODULE_ID . '/event/remove_from_cart.tpl' => 'views/smarty/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/->
|
||||
'@' . Constants::OXID_MODULE_ID . '/page/account/d3gtmnoticelist.tpl' => 'views/smarty/page/account/d3gtmnoticelist.tpl',
|
||||
'@' . Constants::OXID_MODULE_ID . '/page/account/d3gtmrecommendationlist.tpl' => 'views/smarty/page/account/d3gtmrecommendationlist.tpl',
|
||||
'@' . Constants::OXID_MODULE_ID . '/page/account/d3gtmwishlist.tpl' => 'views/smarty/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
|
||||
'@' . Constants::OXID_MODULE_ID . '/admin/d3ga4uimain.tpl' => 'views/smarty/admin/d3googleanalytics4_main.tpl',
|
||||
'@' . Constants::OXID_MODULE_ID . '/admin/d3ga4uiheaditem.tpl' => 'views/smarty/admin/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' => [
|
||||
// tag manager js
|
||||
[
|
||||
'template' => 'layout/base.tpl',
|
||||
'block' => 'head_meta_robots',
|
||||
'file' => 'views/smarty/blocks/_gtm_js.tpl',
|
||||
'position' => 150,
|
||||
'file' => '/Application/views/blocks/_gtm_js.tpl',
|
||||
'position' => 150
|
||||
],
|
||||
// tag manager nojs
|
||||
[
|
||||
'template' => 'layout/base.tpl',
|
||||
'block' => 'theme_svg_icons',
|
||||
'file' => 'views/smarty/blocks/_gtm_nojs.tpl',
|
||||
'position' => 150,
|
||||
'file' => '/Application/views/blocks/_gtm_nojs.tpl'
|
||||
],
|
||||
// details
|
||||
[
|
||||
'template' => 'page/details/inc/productmain.tpl',
|
||||
'block' => 'details_productmain_title',
|
||||
'file' => 'views/smarty/blocks/view_item.tpl',
|
||||
'position' => 150,
|
||||
'file' => '/Application/views/blocks/view_item.tpl',
|
||||
'position' => 150
|
||||
],
|
||||
// View Cart
|
||||
[
|
||||
'template' => 'page/checkout/basket.tpl',
|
||||
'block' => 'checkout_basket_main',
|
||||
'file' => 'views/smarty/blocks/view_cart.tpl',
|
||||
'position' => 150,
|
||||
'file' => '/Application/views/blocks/view_cart.tpl'
|
||||
],
|
||||
// add_to_cart
|
||||
[
|
||||
'template' => 'page/details/inc/productmain.tpl',
|
||||
'block' => 'details_productmain_tobasket',
|
||||
'file' => 'views/smarty/blocks/details_productmain_tobasket.tpl',
|
||||
'position' => 150,
|
||||
'file' => '/Application/views/blocks/details_productmain_tobasket.tpl',
|
||||
'position' => 150
|
||||
],
|
||||
// remove_from_cart
|
||||
[
|
||||
'template' => 'page/checkout/basket.tpl',
|
||||
'block' => 'checkout_basket_main',
|
||||
'file' => 'views/smarty/blocks/remove_from_cart.tpl',
|
||||
'position' => 150,
|
||||
'file' => '/Application/views/blocks/remove_from_cart.tpl',
|
||||
'position' => 150
|
||||
],
|
||||
[
|
||||
'template' => 'page/checkout/thankyou.tpl',
|
||||
'block' => 'checkout_thankyou_main',
|
||||
'file' => 'views/smarty/blocks/purchase.tpl',
|
||||
'position' => 150,
|
||||
'file' => '/Application/views/blocks/purchase.tpl'
|
||||
],
|
||||
// Lists
|
||||
// view_item_list
|
||||
[
|
||||
'template' => 'page/list/list.tpl',
|
||||
'block' => 'page_list_productlist',
|
||||
'file' => 'views/smarty/blocks/view_item_list.tpl',
|
||||
'position' => 150,
|
||||
'file' => '/Application/views/blocks/view_item_list.tpl',
|
||||
'position' => 150
|
||||
],
|
||||
// view_search_result
|
||||
[
|
||||
'template' => 'page/search/search.tpl',
|
||||
'block' => 'search_results',
|
||||
'file' => 'views/smarty/blocks/view_search_result.tpl',
|
||||
'position' => 150,
|
||||
'file' => '/Application/views/blocks/view_search_result.tpl',
|
||||
'position' => 150
|
||||
],
|
||||
[
|
||||
'template' => 'page/list/list.tpl',
|
||||
'block' => 'page_list_listbody',
|
||||
'file' => 'views/smarty/blocks/page_list_listbody.tpl',
|
||||
'position' => 150,
|
||||
'file' => '/Application/views/blocks/page_list_listbody.tpl',
|
||||
'position' => 150
|
||||
],
|
||||
[
|
||||
'template' => 'page/shop/start.tpl',
|
||||
'block' => 'start_welcome_text',
|
||||
'file' => 'views/smarty/blocks/start_welcome_text.tpl',
|
||||
'position' => 150,
|
||||
'file' => '/Application/views/blocks/start_welcome_text.tpl',
|
||||
'position' => 150
|
||||
],
|
||||
// Checkout process
|
||||
// Begin CHeckout
|
||||
[
|
||||
'template' => 'page/checkout/user.tpl',
|
||||
'block' => 'checkout_user_main',
|
||||
'file' => 'views/smarty/blocks/begin_checkout.tpl',
|
||||
'position' => 150,
|
||||
'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;
|
||||
@ -198,8 +195,8 @@ $aModule = [
|
||||
[
|
||||
'template' => 'page/checkout/order.tpl',
|
||||
'block' => 'checkout_order_main',
|
||||
'file' => 'views/smarty/blocks/add_payment_info.tpl',
|
||||
'position' => 150,
|
||||
'file' => '/Application/views/blocks/add_payment_info.tpl',
|
||||
'position' => 150
|
||||
],
|
||||
],
|
||||
'events' => [
|
||||
|
0
assets/thumbnail.png → thumbnail.png
Normal file → Executable file
0
assets/thumbnail.png → thumbnail.png
Normal file → Executable file
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 31 KiB |
@ -1,3 +0,0 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="@d3googleanalytics4/event/add_payment_info.tpl"}]
|
@ -1,3 +0,0 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="@d3googleanalytics4/event/begin_checkout.tpl"}]
|
@ -1,3 +0,0 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file='@d3googleanalytics4/event/add_to_cart.tpl' htmlIdAmountOfArticles='#amountToBasket'}]
|
@ -1,3 +0,0 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file='@d3googleanalytics4/event/add_to_cart.tpl' htmlIdAmountOfArticles='#amountToBasket'}]
|
@ -1,3 +0,0 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="@d3googleanalytics4/event/purchase.tpl"}]
|
@ -1,3 +0,0 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="@d3googleanalytics4/event/remove_from_cart.tpl"}]
|
@ -1,3 +0,0 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file='@d3googleanalytics4/event/add_to_cart.tpl' htmlIdAmountOfArticles='#amountToBasket'}]
|
@ -1,3 +0,0 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="@d3googleanalytics4/event/view_cart.tpl"}]
|
@ -1,3 +0,0 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="@d3googleanalytics4/event/view_item.tpl"}]
|
@ -1,3 +0,0 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="@d3googleanalytics4/event/view_item_list.tpl"}]
|
@ -1,3 +0,0 @@
|
||||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="@d3googleanalytics4/event/view_search_result.tpl"}]
|
@ -1,41 +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_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}]
|
Reference in New Issue
Block a user