Compare commits

..

36 Commits

Author SHA1 Message Date
8097ed01c6 Merge remote-tracking branch 'remotes/origin/rel_2.x' 2024-09-19 16:29:08 +02:00
4b2c978035 [Bump] Metadata && Changelog 2024-09-19 16:20:19 +02:00
2a27b25c5a Merge remote-tracking branch 'remotes/origin/dev_2.x_d3GtmStartController' into rel_2.x 2024-09-19 15:33:02 +02:00
a8ca33b10d Bump metadata && changelog 2024-09-11 17:26:58 +02:00
31bafa621b [Fixed] currency in begin_checkout 2024-09-11 17:23:04 +02:00
48e2dc58ad Methode umbenannt 2024-08-27 14:25:55 +02:00
f27040e7dd [Bump] Metadata 2024-08-20 20:14:56 +02:00
79994eae69 [Added] new Event "add_payment_info"
- add Payment-Model extension for own small method
- new block extension
- new template for the event-data for GA
- metadata adjustments for it
2024-08-20 19:58:02 +02:00
6bdf788ebf [Added] new Event "begin_checkout"
- new block extension
- new template for the event-data for GA
- metadata adjustments for it
- new version ( 2.20.0 )
2024-08-20 18:59:14 +02:00
98ddc51a4d [Changed] clean code 2024-08-18 16:40:49 +02:00
96e5adbece Merge remote-tracking branch 'remotes/origin/rel_2.x' 2024-08-10 13:56:00 +02:00
9edf3b9265 [Bump] Metadata && Changelog 2024-08-10 13:50:49 +02:00
48a598da51 render() ergänzen 2024-08-08 15:03:48 +02:00
bc1dafbbfa Erweiterung verschieben 2024-08-08 14:16:25 +02:00
2a1f8f5794 Erweiterung verschieben 2024-08-08 10:36:55 +02:00
7bc73893c3 Prevent "OXID Logger.ERROR: D3\GoogleAnalytics4\Modules\Application\Controller\d3GtmStartController is not an instance of OxidEsales\Eshop\Application\Component\Widget\WidgetController" 2024-08-08 10:21:22 +02:00
2f7b07ab95 Merge remote-tracking branch 'origin/dev_2.x_12787_bug_fixing' into dev_2.x_12787_bug_fixing 2024-07-30 16:04:34 +02:00
84240f96a9 [Fixed] typo 2024-07-30 16:04:27 +02:00
542471b053 [Fixed] typo 2024-07-30 15:56:02 +02:00
7873714f17 [Fixed] missing class extension
Activating the Module on CLI happens so early, there's no ModuleChain available yet, therefor no extension, therefor no additional methods
2024-07-30 15:55:52 +02:00
6dff6860bf [Change] classify composer requirements more strictly
classify PHP and OXID-CE-Version
2024-07-30 15:05:37 +02:00
8a643a0b8a Merge remote-tracking branch 'remotes/origin/rel_2.x' 2024-03-08 10:10:27 +01:00
7d23204841 Merge remote-tracking branch 'remotes/origin/rel_1.x' 2024-03-08 09:49:12 +01:00
c7d3671265 [Bump] Changelog && Metadata 2024-01-25 14:50:44 +01:00
3621ca606a [Fix] missing Component-ArticleDetails extension; missing ManufacturerList-Extension 2024-01-25 14:49:32 +01:00
e3f4bd16c9 Merge remote-tracking branch 'remotes/origin/rel_2.x' 2024-01-03 13:49:08 +01:00
42618fef79 Merge remote-tracking branch 'remotes/origin/rel_2.x'
# Conflicts:
#	Modules/Core/ViewConfig.php
2023-09-13 16:18:43 +02:00
f02c40cfb7 Merge remote-tracking branch 'remotes/origin/rel_1.x'
# Conflicts:
#	Application/views/admin/de/module_options.php
#	Application/views/ga4/view_item_list.tpl
#	CHANGELOG.md
#	Docs/README.md
#	IntelliSenseHelper.php
#	Modules/Core/ViewConfig.php
#	metadata.php
2023-09-13 16:13:03 +02:00
154147b8d8 Merge remote-tracking branch 'remotes/origin/rel_2.x' 2023-09-07 15:22:13 +02:00
43cdc7e8ae Merge remote-tracking branch 'remotes/origin/rel_2.x' 2023-08-02 11:57:26 +02:00
461f7f15da Merge remote-tracking branch 'remotes/origin/rel_1.x'
# Conflicts:
#	Application/views/admin/de/module_options.php
#	Application/views/ga4/view_item_list.tpl
#	CHANGELOG.md
#	Modules/Core/ViewConfig.php
#	composer.json
#	metadata.php
2023-06-27 10:03:51 +02:00
4f8fa7cdc9 Merge remote-tracking branch 'remotes/origin/rel_2.x'
# Conflicts:
#	CHANGELOG.md
2023-06-27 09:59:00 +02:00
7266416fe4 Merge remote-tracking branch 'remotes/origin/rel_2.x'
# Conflicts:
#	metadata.php
2023-06-19 15:25:00 +02:00
389d4f44ed Merge remote-tracking branch 'remotes/origin/rel_1.x'
# Conflicts:
#	CHANGELOG.md
#	metadata.php
2023-06-19 15:23:42 +02:00
41d6e94fa7 Merge remote-tracking branch 'remotes/origin/rel_2.x' 2023-05-31 14:55:26 +02:00
b8e2aeaa58 Merge remote-tracking branch 'remotes/origin/rel_1.x'
# Conflicts:
#	Application/views/admin/de/module_options.php
#	Application/views/ga4/view_item_list.tpl
#	CHANGELOG.md
#	Modules/Core/ViewConfig.php
#	metadata.php
2023-05-31 14:51:07 +02:00
16 changed files with 335 additions and 123 deletions

View 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 '';
}
}

View File

@ -8,7 +8,6 @@ $aLang = array(
'd3mxgoogleanalytics4' => 'Google Analytics 4', 'd3mxgoogleanalytics4' => 'Google Analytics 4',
'd3mxgoogleanalytics4set' => 'Einstellungen', 'd3mxgoogleanalytics4set' => 'Einstellungen',
'd3mxd3modules' => "<i class='fab fa-fw fa-d3 d3fa-color-blue'></i> Module",
// Base Translations // Base Translations
'D3BASECONFIG' => 'Grundeinstellungen', 'D3BASECONFIG' => 'Grundeinstellungen',
@ -19,7 +18,7 @@ $aLang = array(
'D3ACTIVATEMOD' => 'Modul aktivieren', 'D3ACTIVATEMOD' => 'Modul aktivieren',
'D3CNTRLPARAM' => 'Steuerungsparameter', '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>', '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 // Usercentrics Dynamische Optionen
'D3USRCNTRCSDYNOPT' => 'Usercentrics Dynamische Optionen', 'D3USRCNTRCSDYNOPT' => 'Usercentrics Dynamische Optionen',
@ -41,7 +40,7 @@ $aLang = array(
völlig verhindert, solange keine Zustimmung erteilt wurde.<br> völlig verhindert, solange keine Zustimmung erteilt wurde.<br>
<br> <br>
Ein einfaches anschalten dieser Funktion regelt noch <strong>nicht</strong> die völlige Funktionsweise Ein einfaches anschalten dieser Funktion regelt noch <strong>nicht</strong> die völlige Funktionsweise
aller beteiligten Instanzen; diese bedarf eine detailiertere Konfiguration!<br>", aller beteiligten Instanzen; diese bedarf eine detailliertere Konfiguration!<br>",
// Use CMP? // Use CMP?
'D3CMPTABTITLE' => 'Cookie Manager Einstellungen', 'D3CMPTABTITLE' => 'Cookie Manager Einstellungen',
@ -58,12 +57,12 @@ $aLang = array(
Diese konformen CMP sind in Diese konformen CMP sind in
<a target="_blank" href="https://cmppartnerprogram.withgoogle.com/">offizieller Partnerschaft mit Google ( Liste der Partner )</a> <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 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', 'D3CMP' => 'Consent Management Platform ( CMP ) wählen',
// Usercentrics Config // Usercentrics Config
// activate Individual Default Values // activate Individual Default Values
'D3USRCNTRCSCFG_ACT_INDIVDEFVAL' => "usercentrics individual 'Default Values' aktiveren", 'D3USRCNTRCSCFG_ACT_INDIVDEFVAL' => "Usercentrics individual 'Default Values' aktiveren",
// standard Consent // standard Consent
'D3USRCNTRCSCFG_STD_CNST' => "GTM Standard Consent", 'D3USRCNTRCSCFG_STD_CNST' => "GTM Standard Consent",
// activate consent mode API // activate consent mode API
@ -71,7 +70,7 @@ $aLang = array(
// consent mode api // consent mode api
'D3USRCNTRCSCFG_CNSTMDE_API' => "Consent Mode API", 'D3USRCNTRCSCFG_CNSTMDE_API' => "Consent Mode API",
'D3USRCNTRCSCFG_DOCS' => 'Nähere Infos zu den hier konfigurierbaren Einstellungen entnehmen Sie bitte der offiziellen '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> '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!", Anpassungen können zu Beeinträchtigungen und Ausfall von Funktionen im Frontend führen!",

View File

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

View File

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

View File

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

View File

@ -0,0 +1,53 @@
[{*$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_id': '[{$gtmCartArticles[$basketindex]->getFieldData('oxartnum')}]',
'item_name': '[{$gtmCartArticles[$basketindex]->getFieldData('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_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]',
[{/if}]
'price': [{$gtmItemPriceObject->getPrice()}],
'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}]

View File

@ -0,0 +1,52 @@
[{*$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()}]
{
'item_id': '[{$gtmCartArticles[$basketindex]->getFieldData('oxartnum')}]',
'item_name': '[{$gtmCartArticles[$basketindex]->getFieldData('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_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': [{$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}]

View File

@ -6,7 +6,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [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.17.2...rel_2.x) - 2024-x
## [2.18.2](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.18.0...2.18.1) - 2024-06-25 ## [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 ### Fixed
- oe-console apply-configuration triggers on-activate and overwrites existing values - oe-console apply-configuration triggers on-activate and overwrites existing values

View File

@ -18,9 +18,14 @@ namespace D3\GoogleAnalytics4\Modules\Core{
} }
namespace D3\GoogleAnalytics4\Modules\Application\Model{ namespace D3\GoogleAnalytics4\Modules\Application\Model{
use OxidEsales\Eshop\Application\Model\Payment;
class Category_parent extends \OxidEsales\Eshop\Application\Model\Category {} class Category_parent extends \OxidEsales\Eshop\Application\Model\Category {}
class Basket_parent extends \OxidEsales\Eshop\Application\Model\Basket {} class Basket_parent extends \OxidEsales\Eshop\Application\Model\Basket {}
class Manufacturer_parent extends \OxidEsales\Eshop\Application\Model\Manufacturer {} class Manufacturer_parent extends \OxidEsales\Eshop\Application\Model\Manufacturer {}
class gtmPayment_parent extends Payment {}
} }
namespace D3\GoogleAnalytics4\Modules\Application\Controller{ namespace D3\GoogleAnalytics4\Modules\Application\Controller{

View File

@ -57,26 +57,6 @@ class d3GtmBasketComponentExtension extends d3GtmBasketComponentExtension_parent
return (bool) $decision; return (bool) $decision;
} }
public function getRemoveFromBasketDecision() :bool
{
$decision = Registry::getSession()->getVariable('d3GtmRemoveFromBasketTrigger');
Registry::getSession()->setVariable('d3GtmRemoveFromBasketTrigger', false);
return (bool) $decision;
}
protected function _getItems($sProductId = null, $dAmount = null, $aSel = null, $aPersParam = null, $blOverride = false)
{
$aProducts = parent::_getItems($sProductId, $dAmount, $aSel, $aPersParam, $blOverride);
if (is_array($aProducts) && count($aProducts)) {
Registry::getSession()->setVariable('d3GtmRemoveFromBasketTrigger', true);
}
return $return;
}
/** /**
* @return Article|null * @return Article|null
*/ */

View File

@ -0,0 +1,20 @@
<?php
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
{
/**
* @return string
*/
public function gtmGetSelectedPaymentName() :string
{
return $this->getFieldData('oxpayments__oxdesc')?: 'No payment name available';
}
}

View File

@ -17,8 +17,9 @@ use D3\GoogleAnalytics4\Application\Model\Constants;
use D3\GoogleAnalytics4\Application\Model\ManagerHandler; use D3\GoogleAnalytics4\Application\Model\ManagerHandler;
use D3\GoogleAnalytics4\Application\Model\ManagerTypes; use D3\GoogleAnalytics4\Application\Model\ManagerTypes;
use OxidEsales\Eshop\Application\Controller\FrontendController; use OxidEsales\Eshop\Application\Controller\FrontendController;
use OxidEsales\Eshop\Application\Model\User;
use OxidEsales\Eshop\Core\Config; use OxidEsales\Eshop\Core\Config;
use OxidEsales\Eshop\Application\Model\User;use OxidEsales\Eshop\Core\Registry; use OxidEsales\Eshop\Core\Registry;
use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory; use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory;
use OxidEsales\EshopCommunity\Internal\Framework\Module\Configuration\Bridge\ModuleSettingBridgeInterface; use OxidEsales\EshopCommunity\Internal\Framework\Module\Configuration\Bridge\ModuleSettingBridgeInterface;
use Psr\Container\ContainerExceptionInterface; use Psr\Container\ContainerExceptionInterface;
@ -57,7 +58,6 @@ class ViewConfig extends ViewConfig_parent
$this->sCookieManagerType = $oManagerHandler->getCurrManager(); $this->sCookieManagerType = $oManagerHandler->getCurrManager();
} }
} }
/** /**
* @return bool * @return bool
*/ */
@ -116,7 +116,6 @@ class ViewConfig extends ViewConfig_parent
return true; return true;
} }
// Cookie Manager not (yet) supported
return false; return false;
} }

View 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();
}
}

View File

@ -20,7 +20,7 @@ class Actions
public function d3SaveDefaultSettings(string $sVarType, string $sSettingName, string $sSettingValue){ public function d3SaveDefaultSettings(string $sVarType, string $sSettingName, string $sSettingValue){
$oConfig = Registry::getConfig(); $oConfig = Registry::getConfig();
if (trim($this->d3GetModuleConfigParam($sSettingName)) !== trim($sSettingValue)){ if ($this->d3GetModuleConfigParam($sSettingName) and (trim($this->d3GetModuleConfigParam($sSettingName)) !== trim($sSettingValue))){
$sSettingValue = trim($this->d3GetModuleConfigParam($sSettingName)); $sSettingValue = trim($this->d3GetModuleConfigParam($sSettingName));
} }
@ -39,6 +39,6 @@ class Actions
*/ */
public function d3GetModuleConfigParam(string $configParamName) 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);
} }
} }

View File

@ -43,10 +43,11 @@
} }
}, },
"require": { "require": {
"php": ">=7.1", "php": "7.1 - 8.2",
"oxid-esales/oxideshop-ce": "^6.5", "oxid-esales/oxideshop-ce": "^6.5.3",
"google/apiclient":" ^2.0", "google/apiclient":" ^2.0",
"phpstan/phpstan": "^1.10" }, "phpstan/phpstan": "^1.10"
},
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"D3\\GoogleAnalytics4\\": "../../../source/modules/d3/googleanalytics4" "D3\\GoogleAnalytics4\\": "../../../source/modules/d3/googleanalytics4"

View File

@ -16,6 +16,7 @@ use D3\GoogleAnalytics4\Modules\Application\Controller\d3GtmStartController;
use D3\GoogleAnalytics4\Modules\Application\Controller\ThankYouController; use D3\GoogleAnalytics4\Modules\Application\Controller\ThankYouController;
use D3\GoogleAnalytics4\Modules\Application\Model\Basket as Basket; use D3\GoogleAnalytics4\Modules\Application\Model\Basket as Basket;
use D3\GoogleAnalytics4\Modules\Application\Model\Category as Category; 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\Application\Model\Manufacturer as Manufacturer;
use D3\GoogleAnalytics4\Modules\Core\ViewConfig; use D3\GoogleAnalytics4\Modules\Core\ViewConfig;
use OxidEsales\Eshop\Application\Component\BasketComponent as OEBasketComponent; 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\Basket as OEBasket;
use OxidEsales\Eshop\Application\Model\Category as OECategory; use OxidEsales\Eshop\Application\Model\Category as OECategory;
use OxidEsales\Eshop\Application\Model\Manufacturer as OEManufacturer; use OxidEsales\Eshop\Application\Model\Manufacturer as OEManufacturer;
use OxidEsales\Eshop\Application\Model\Payment as OEPayment;
use OxidEsales\Eshop\Core\ViewConfig as OEViewConfig; use OxidEsales\Eshop\Core\ViewConfig as OEViewConfig;
$sMetadataVersion = '2.1'; $sMetadataVersion = '2.1';
$aModule = [ $aModule = [
'id' => Constants::OXID_MODULE_ID, 'id' => Constants::OXID_MODULE_ID,
'title' => 'Google Analytics 4', 'title' => 'Google Analytics 4',
'description' => "Dieses Modul bietet die Möglichkeit in Ihrem OXID eShop (6.x) die neue 'Property' '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> Google Analytics 4 (GA4) von Google zu integrieren.<br>
Hierfür stehen Ihnen verschiedene 'templates' zur verfügung, Hierfür stehen Ihnen verschiedene 'templates' zur verfügung,
@ -49,135 +51,156 @@ $aModule = [
<hr> <hr>
Die Entwicklung basiert auf einem Fork von Marat Bedoev - <a href='https://github.com/vanilla-thunder/oxid-module-gtm'>Github-Link</a> Die Entwicklung basiert auf einem Fork von Marat Bedoev - <a href='https://github.com/vanilla-thunder/oxid-module-gtm'>Github-Link</a>
", ",
'thumbnail' => 'thumbnail.png', 'thumbnail' => 'thumbnail.png',
'version' => '2.18.2', 'version' => '2.21.0',
'author' => 'Data Development (Inh.: Thomas Dartsch)', 'author' => 'Data Development (Inh.: Thomas Dartsch)',
'email' => 'support@shopmodule.com', 'email' => 'support@shopmodule.com',
'url' => 'https://www.oxidmodule.com/', 'url' => 'https://www.oxidmodule.com/',
'controllers' => [ 'controllers' => [
'd3googleanalytics4_main' => GA4AdminUserInterfaceMainController::class 'd3googleanalytics4_main' => GA4AdminUserInterfaceMainController::class
], ],
'extend' => [ 'extend' => [
// Core // Core
OEViewConfig::class => ViewConfig::class, OEViewConfig::class => ViewConfig::class,
\OxidEsales\Eshop\Core\WidgetControl::class => \D3\GoogleAnalytics4\Modules\Core\WidgetControl::class,
// Model // Model
OECategory::class => Category::class, OECategory::class => Category::class,
OEBasket::class => Basket::class, OEBasket::class => Basket::class,
OEManufacturer::class => Manufacturer::class, OEManufacturer::class => Manufacturer::class,
OEPayment::class => gtmPayment::class,
// Controller // Controller
OEBasketController::class => BasketController::class, OEBasketController::class => BasketController::class,
OEThankYouController::class => ThankYouController::class, OEThankYouController::class => ThankYouController::class,
OEArticleListController::class => ArticleListController_AddToCartHelpMethods::class, OEArticleListController::class => ArticleListController_AddToCartHelpMethods::class,
OEArticleDetailsController::class => ArticleDetailsController::class, OEArticleDetailsController::class => ArticleDetailsController::class,
OEAccountNoticeListController::class => d3GtmAccountNoticeListController::class, OEAccountNoticeListController::class => d3GtmAccountNoticeListController::class,
OEAccountRecommlistController::class => d3GtmAccountRecommlistController::class, OEAccountRecommlistController::class => d3GtmAccountRecommlistController::class,
OEAccountWishlistController::class => d3GtmAccountWishlistController::class, OEAccountWishlistController::class => d3GtmAccountWishlistController::class,
OEStartController::class => d3GtmStartController::class, OEStartController::class => d3GtmStartController::class,
OESearchController::class => d3GtmSearchController::class, OESearchController::class => d3GtmSearchController::class,
OEManufacturerListController::class => d3GtmManufacturerListController::class, OEManufacturerListController::class => d3GtmManufacturerListController::class,
// Component // Component
OEArticleDetails::class => d3GtmWidgetArticleDetails::class, OEArticleDetails::class => d3GtmWidgetArticleDetails::class,
OEBasketComponent::class => d3GtmBasketComponentExtension::class, OEBasketComponent::class => d3GtmBasketComponentExtension::class,
], ],
'templates' => [ 'templates' => [
// Event files that store the GA4 Event-Information // Event files that store the GA4 Event-Information
'event/add_to_cart.tpl' => 'd3/googleanalytics4/Application/views/event/add_to_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_item.tpl' => 'd3/googleanalytics4/Application/views/event/view_item.tpl',
'event/view_cart.tpl' => 'd3/googleanalytics4/Application/views/event/view_cart.tpl', 'event/view_item.tpl' => 'd3/googleanalytics4/Application/views/event/view_item.tpl',
'event/purchase.tpl' => 'd3/googleanalytics4/Application/views/event/purchase.tpl', 'event/begin_checkout.tpl' => 'd3/googleanalytics4/Application/views/event/begin_checkout.tpl',
'event/view_item_list.tpl' => 'd3/googleanalytics4/Application/views/event/view_item_list.tpl', 'event/add_payment_info.tpl' => 'd3/googleanalytics4/Application/views/event/add_payment_info.tpl',
'event/view_search_result.tpl' => 'd3/googleanalytics4/Application/views/event/view_search_result.tpl', 'event/purchase.tpl' => 'd3/googleanalytics4/Application/views/event/purchase.tpl',
'event/remove_from_cart.tpl' => 'd3/googleanalytics4/Application/views/event/remove_from_cart.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 // complete overwritten file of OXID-Originals
// the path of the template-name is the original path to the file in OXID-context from tpl/-> // the path of the template-name is the original path to the file in OXID-context from tpl/->
'page/account/d3gtmnoticelist.tpl' => 'd3/googleanalytics4/Application/views/tpl/page/account/d3gtmnoticelist.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/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/d3gtmwishlist.tpl' => 'd3/googleanalytics4/Application/views/tpl/page/account/d3gtmwishlist.tpl',
// Admin Templates // Admin Templates
'ga4/admin/d3ga4uimain.tpl' => 'd3/googleanalytics4/Application/views/admin/tpl/d3googleanalytics4_main.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', 'ga4/admin/d3ga4uiheaditem.tpl' => 'd3/googleanalytics4/Application/views/admin/tpl/d3googleanalytics4_headitem.tpl',
], ],
'blocks' => [ 'blocks' => [
// tag manager js // tag manager js
[ [
'template' => 'layout/base.tpl', 'template' => 'layout/base.tpl',
'block' => 'head_meta_robots', 'block' => 'head_meta_robots',
'file' => '/Application/views/blocks/_gtm_js.tpl', 'file' => '/Application/views/blocks/_gtm_js.tpl',
'position' => 150 'position' => 150
], ],
// tag manager nojs // tag manager nojs
[ [
'template' => 'layout/base.tpl', 'template' => 'layout/base.tpl',
'block' => 'theme_svg_icons', 'block' => 'theme_svg_icons',
'file' => '/Application/views/blocks/_gtm_nojs.tpl' 'file' => '/Application/views/blocks/_gtm_nojs.tpl'
], ],
// details // details
[ [
'template' => 'page/details/inc/productmain.tpl', 'template' => 'page/details/inc/productmain.tpl',
'block' => 'details_productmain_title', 'block' => 'details_productmain_title',
'file' => '/Application/views/blocks/view_item.tpl', 'file' => '/Application/views/blocks/view_item.tpl',
'position' => 150 'position' => 150
], ],
// checkout // View Cart
[ [
'template' => 'page/checkout/basket.tpl', 'template' => 'page/checkout/basket.tpl',
'block' => 'checkout_basket_main', 'block' => 'checkout_basket_main',
'file' => '/Application/views/blocks/view_cart.tpl' '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
], ],
// add_to_cart // add_to_cart
[ [
'template' => 'page/details/inc/productmain.tpl', 'template' => 'page/details/inc/productmain.tpl',
'block' => 'details_productmain_tobasket', 'block' => 'details_productmain_tobasket',
'file' => '/Application/views/blocks/details_productmain_tobasket.tpl', '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',
'position' => 150 'position' => 150
], ],
// remove_from_cart // remove_from_cart
[ [
'template' => 'page/checkout/basket.tpl', 'template' => 'page/checkout/basket.tpl',
'block' => 'checkout_basket_main', 'block' => 'checkout_basket_main',
'file' => '/Application/views/blocks/remove_from_cart.tpl', 'file' => '/Application/views/blocks/remove_from_cart.tpl',
'position' => 150 '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' => [ 'events' => [
'onActivate' => '\D3\GoogleAnalytics4\Setup\Events::onActivate', 'onActivate' => '\D3\GoogleAnalytics4\Setup\Events::onActivate',
'onDeactivate' => '\D3\GoogleAnalytics4\Setup\Events::onDeactivate', 'onDeactivate' => '\D3\GoogleAnalytics4\Setup\Events::onDeactivate',
], ],
]; ];