Compare commits
16 Commits
Author | SHA1 | Date |
---|---|---|
MaxBUhe | db680b893f | |
MaxBUhe | 4458fc55ee | |
MaxBUhe | 6053219687 | |
MaxBUhe | dbaf871c9e | |
MaxBUhe | 2a8c939afd | |
MaxBUhe | 02db7be9d8 | |
MaxBUhe | aa616db0f2 | |
MaxBUhe | 60a3c797fb | |
MaxBUhe | 55306e0495 | |
MaxBUhe | d856a994ab | |
MaxBUhe | 550c9dbdf9 | |
MaxBUhe | 44e54b7329 | |
MaxBUhe | 5f72d0837e | |
MaxBUhe | 201bcb6e37 | |
MaxBUhe | 97c3927998 | |
MaxBUhe | cbe3293ff1 |
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace D3\GoogleAnalytics4\Application\Model;
|
||||
|
||||
|
||||
class Constants
|
||||
{
|
||||
public const OXID_MODULE_ID = 'd3googleanalytics4';
|
||||
}
|
|
@ -27,6 +27,52 @@ $aLang = [
|
|||
'SHOP_MODULE_d3_gtm_blGA4enab' => 'GA4 Aktivieren',
|
||||
'SHOP_MODULE_d3_gtm_blUAenabled' => 'UA Aktivieren',
|
||||
'SHOP_MODULE_d3_gtm_blEnableDebug' => 'Debug-Modus aktivieren',
|
||||
'SHOP_MODULE_GROUP_d3_gtm_settings_serversidetagging' => 'Server-Side tagging',
|
||||
'SHOP_MODULE_d3_gtm_settings_serversidetagging_js' => 'Servercontainer Ausführender-Code',
|
||||
'HELP_SHOP_MODULE_d3_gtm_settings_serversidetagging_js' => 'Diese Domain wird im <strong>aktiven</strong>-code ausgefüht. Das heißt,
|
||||
dass es sich hierbei um das HTML-Tag <code>script</code> handelt.
|
||||
Dieses kümmert sich darum, dass die, im data_layer
|
||||
zusammengefassten Daten an den GTM weitergeleitet werden.<br>
|
||||
<br>
|
||||
<h4>Folgend eine Darstellung, was genau ausgetauscht wird</h4>
|
||||
<pre>
|
||||
<code>
|
||||
Vorher:
|
||||
https://www.googletagmanager.com/gtm.js?id=
|
||||
|
||||
Nachher:
|
||||
{Domain}?id=
|
||||
</code>
|
||||
</pre>
|
||||
Die Conatiner-ID wird weiterhin im Punkt "Einstellung" eingetragen!
|
||||
',
|
||||
'SHOP_MODULE_d3_gtm_settings_serversidetagging_nojs' => 'Servercontainer NICHT Ausführender-Code<br><br>
|
||||
"Serverseitiges Tagging ist eine neue Möglichkeit, mit Google Tag Manager Ihre Anwendung geräteübergreifend zu verwalten.<br>
|
||||
Servercontainer verwenden dasselbe Tag-, Trigger- und Variablenmodell, das Sie gewohnt sind.<br>
|
||||
Außerdem bieten sie neue Tools, mit denen Sie Nutzeraktivitäten überall messen können." <br>
|
||||
<br>
|
||||
- Quelle <a href="https://developers.google.com/tag-platform/tag-manager/server-side/intro">Developers-Google Server-Side tagging</a><br>
|
||||
<br>
|
||||
<strong>Verändern Sie die Werte nur, wenn Sie Server-Side tagging verwenden wollen!</strong>
|
||||
',
|
||||
'HELP_SHOP_MODULE_d3_gtm_settings_serversidetagging_nojs' => 'Diese Domain wird im <strong>passiven</strong>-code ausgefüht. Das heißt,
|
||||
dass es sich hierbei um das HTML-Tag <code>noscript</code> handelt.
|
||||
Dieses wird ausgeführt, wenn aus einem bestimmten Grund
|
||||
das Javascript nicht ausgeführt wird.<br>
|
||||
( keine Cookies erlaubt, JavaScript-Unterbindung, ... )
|
||||
<br>
|
||||
<h4>Folgend eine Darstellung, was genau ausgetauscht wird</h4>
|
||||
<pre>
|
||||
<code>
|
||||
Vorher:
|
||||
src="https://www.googletagmanager.com/ns.html?id={Container-ID}"
|
||||
|
||||
Nachher:
|
||||
src="{Domain}?id={Container-ID}"
|
||||
</code>
|
||||
</pre>
|
||||
Die Conatiner-ID wird weiterhin im Punkt "Einstellung" eingetragen!
|
||||
',
|
||||
|
||||
// for cookie manager settings
|
||||
'SHOP_MODULE_GROUP_d3_gtm_settings_cookiemanager' => 'Cookie Manager Einstellungen',
|
||||
|
@ -49,5 +95,10 @@ $aLang = [
|
|||
<strong>Beachte:</strong><br>
|
||||
Sofern Sie die <a target="_blank" href="https://consentmanager.net" style="color: blue">consentmanager</a> CMP verwenden,
|
||||
bitte ich Sie, gründlichst, die Hinweise der <a target="_blank" href="https://git.d3data.de/D3Public/GoogleAnalytics4/src/branch/master/Docs/CMP/consentmanager.md">Moduldokumentation/Consentmanager</a> zu lesen.
|
||||
'
|
||||
',
|
||||
'SHOP_MODULE_d3_gtm_blActivateConsentMode' => "Google Consent Mode 'Default Values' aktivieren",
|
||||
'HELP_SHOP_MODULE_d3_gtm_blActivateConsentMode' => 'Diese Einstellung ist zu aktivieren, wenn Sie den Google-Consent-Mode ( Einwilligungsmodus ) verwenden wollen.
|
||||
<hr>
|
||||
"Im Einwilligungsmodus können Sie Google über den Cookie- oder App-ID-Einwilligungsstatus Ihrer Nutzer informieren.
|
||||
Mit Tags wird das Verhalten angepasst. Dabei werden die Einstellungen der Nutzer berücksichtigt." ~ <a href="https://support.google.com/google-ads/answer/10000067">Google Einwilligungsmodus</a>',
|
||||
];
|
||||
|
|
|
@ -3,9 +3,28 @@
|
|||
var dataLayer = [{$oViewConf->getGtmDataLayer()}] || [];
|
||||
</script>
|
||||
|
||||
[{assign var="d3GtmContainerIdString" value=$oViewConf->getGtmContainerId()}]
|
||||
|
||||
[{if $oViewConf->D3blShowGtmScript()}]
|
||||
[{if $oViewConf->getGtmContainerId()}]
|
||||
[{if $d3GtmContainerIdString}]
|
||||
[{strip}]
|
||||
|
||||
[{if $oViewConf->isGtmConsentModeSetActivated()}]
|
||||
<script type="text/javascript">
|
||||
function gtag() {
|
||||
dataLayer.push(arguments);
|
||||
}
|
||||
|
||||
gtag("consent", "default", {
|
||||
ad_user_data: "denied",
|
||||
ad_personalization: "denied",
|
||||
ad_storage: "denied",
|
||||
analytics_storage: "denied",
|
||||
wait_for_update: 2000
|
||||
});
|
||||
</script>
|
||||
[{/if}]
|
||||
|
||||
<!-- Google Tag Manager -->
|
||||
<script [{$oViewConf->getGtmScriptAttributes()}]>
|
||||
(function (w, d, s, l, i) {
|
||||
|
@ -13,9 +32,9 @@
|
|||
w[l].push({'gtm.start': new Date().getTime(), event: 'gtm.js'});
|
||||
var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : '';
|
||||
j.async = true;
|
||||
j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
|
||||
j.src = '[{$oViewConf->getServerSidetaggingJsDomain()}]?id=' + i + dl;
|
||||
f.parentNode.insertBefore(j, f);
|
||||
})(window, document, 'script', 'dataLayer', '[{$oViewConf->getGtmContainerId()}]');
|
||||
})(window, document, 'script', 'dataLayer', '[{$d3GtmContainerIdString}]');
|
||||
</script>
|
||||
<!-- End Google Tag Manager -->
|
||||
[{/strip}]
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
[{if $oViewConf->getGtmContainerId()}][{strip}]
|
||||
<!-- Google Tag Manager (noscript) -->
|
||||
<noscript>
|
||||
<iframe src="https://www.googletagmanager.com/ns.html?id=[{$oViewConf->getGtmContainerId()}]"
|
||||
<iframe src="[{$oViewConf->getServerSidetaggingNoJsDomain()}]?id=[{$oViewConf->getGtmContainerId()}]"
|
||||
height="0" width="0" style="display:none;visibility:hidden"></iframe>
|
||||
</noscript>
|
||||
<!-- End Google Tag Manager (noscript) -->
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="event/view_cart.tpl"}]
|
||||
[{include file="event/view_cart.tpl"}]
|
|
@ -1,3 +1,3 @@
|
|||
[{$smarty.block.parent}]
|
||||
|
||||
[{include file="event/view_item.tpl"}]
|
||||
[{include file="event/view_item.tpl"}]
|
|
@ -1,5 +1,5 @@
|
|||
|
||||
[{if $d3CmpBasket->getAddToBasketDecision() && $d3CmpBasket->d3GtmRequestedArticleLoadedByAnid() !== null}]
|
||||
[{if $d3CmpBasket && $d3CmpBasket->getAddToBasketDecision() && $d3CmpBasket->d3GtmRequestedArticleLoadedByAnid() !== null}]
|
||||
[{assign var="oGtmProduct" value=$d3CmpBasket->d3GtmRequestedArticleLoadedByAnid()}]
|
||||
[{assign var="oGtmAmountArticlesAdded" value=$d3CmpBasket->getD3GtmAddToCartAmountArticles()}]
|
||||
[{*$smarty.block.parent*}]
|
||||
|
|
144
CHANGELOG.md
144
CHANGELOG.md
|
@ -4,143 +4,21 @@ 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).
|
||||
|
||||
## [2.15.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.14.0...2.15.0) - 2024-02-05
|
||||
### Fixed
|
||||
- missing Component-ArticleDetails extension, missing ManufacturerListController extension
|
||||
|
||||
## [2.14.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.13.1...2.14.0) - 2023-01-22
|
||||
## [1.17.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.16.0...1.17.0) - 2024-04-11
|
||||
### Added
|
||||
- add_to_cart Event to several new shop-pages (landing-page, Account, category article-list, start)
|
||||
- PHPStan code-cleanup
|
||||
- multilang translations
|
||||
- GA4 consent-mode default values
|
||||
|
||||
### Changed
|
||||
- template structure
|
||||
- code cleanup
|
||||
- metadataID centralized
|
||||
|
||||
## [2.13.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.13.0...2.13.1) - 2023-01-03
|
||||
## [1.16.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.15.1...1.16.0) - 2024-04-11
|
||||
### Added
|
||||
- ( Google ) Server-Side tagging usability
|
||||
|
||||
## [1.15.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.15.0...1.15.1) - 2024-04-11
|
||||
### Fixed
|
||||
- error on array-count at zero entries
|
||||
|
||||
## [2.13.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.12.0...2.13.0) - 2023-09-13
|
||||
### Added
|
||||
- extended Docs
|
||||
### Changed
|
||||
- control-param name
|
||||
- control-param function
|
||||
- adjusted check for set control-param
|
||||
- consentmanager-script-adjustments
|
||||
|
||||
## [2.12.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.11.1...2.12.0) - 2023-09-07
|
||||
### Added
|
||||
- cookiebot functionality
|
||||
|
||||
## [2.11.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.10.1...2.11.0) - 2023-08-23
|
||||
### Added
|
||||
- manufacturer extension
|
||||
- working debug_mode
|
||||
### Changed
|
||||
- check for 'article has been removed'
|
||||
- general template cleanup
|
||||
|
||||
## [2.10.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.10.0...2.10.1) - 2023-08-03
|
||||
### Added
|
||||
- missing param to identify the event
|
||||
|
||||
## [2.10.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.9.2...2.10.0) - 2023-08-02
|
||||
### Added
|
||||
- new Event "remove_from_cart"
|
||||
|
||||
## [2.9.2](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.9.1...2.9.2) - 2023-06-29
|
||||
### Fixed
|
||||
- wrong variable for category-object check
|
||||
|
||||
## [2.9.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.9.0...2.9.1) - 2023-06-27
|
||||
### Fixed
|
||||
- deny method call on no category
|
||||
|
||||
## [2.9.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.8.0...2.9.0) - 2023-06-27
|
||||
### Added
|
||||
- Cookiefirst usability
|
||||
|
||||
## [2.8.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.7.0...2.8.0) - 2023-06-23
|
||||
### Added
|
||||
- Method to get the in order used Payment-Name
|
||||
- Method to get the current Article Category
|
||||
- Following Entries to dedicated event-templates
|
||||
- coupon
|
||||
- paymentType
|
||||
- item_list_name
|
||||
- item_category
|
||||
### Changed
|
||||
- all used template-files have a more dedicated name
|
||||
- general code cleanup
|
||||
|
||||
## [2.7.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.6.0...2.7.0) - 2023-06-19
|
||||
### Changed
|
||||
- add_to_cart event template-structure
|
||||
|
||||
## [2.6.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.5.0...2.6.0) - 2023-05-31
|
||||
### Added
|
||||
- add settings to explicit choose an external service (usercentrics/ consentmanager)
|
||||
- position to block-extension
|
||||
- extended instructions to check for in readme
|
||||
### Fixed
|
||||
- usercentrics script
|
||||
- missing right articleList-getter
|
||||
### Changed
|
||||
- view_item_list-template block extension
|
||||
- cookieManager handling
|
||||
### Removed
|
||||
- additional check for cookieManagerType
|
||||
|
||||
## [2.5.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.4.0...2.5.0) - 2023-05-23
|
||||
### Added
|
||||
- additional settings to explicitly indicate that consentmanager is used
|
||||
### Fixed
|
||||
- unnecessary converting of int to str
|
||||
- missing PriceObject-bug
|
||||
### Changed
|
||||
- genuine code cleanup
|
||||
|
||||
## [2.4.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.3.3...2.4.0) - 2023-05-02
|
||||
### Added
|
||||
- "OXID Cookie Management powered by usercentrics" compatibility
|
||||
- usercentrics defined script attributes
|
||||
- cookie-manager evaluation
|
||||
### Changed
|
||||
- genuine clean up of base-js-files
|
||||
|
||||
## [2.3.3](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.3.2...2.3.3) - 2023-03-20
|
||||
### Fixed
|
||||
- metadata file path for view_item
|
||||
|
||||
## [2.3.2](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.2.2...2.3.2) - 2023-03-17
|
||||
### Added
|
||||
- Aggrosoft-Cookie-Consent compatibility
|
||||
### Fixed
|
||||
- wrong function for pageview on thankyou page
|
||||
### Deleted
|
||||
- unused files
|
||||
|
||||
## [2.2.2](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.2.1...2.2.2) - 2023-02-22
|
||||
### Fixed
|
||||
- price formatting in view_cart
|
||||
|
||||
## [2.2.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.1.1...2.2.1) - 2023-02-21
|
||||
### Added
|
||||
- cookie handling
|
||||
|
||||
## [2.1.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.1...2.1.1) - 2023-01-27
|
||||
### Fixed
|
||||
- add missing class import
|
||||
|
||||
## [2.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.0...2.1) - 2023-01-27
|
||||
### Added
|
||||
- block section for add_to_basket js
|
||||
- template block order positions
|
||||
|
||||
## [2.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.1...2.0) - 2023-01-20
|
||||
### Added
|
||||
- using of ContainerFactory in ViewConfig
|
||||
- false processing of template during missing necessary-component
|
||||
|
||||
## [1.15.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.14.0...1.15.0) - 2024-01-25
|
||||
### Fixed
|
||||
|
|
|
@ -10,7 +10,38 @@ Tragen Sie hier im Normalfall die ID des zu prüfenden Cookies ein.
|
|||
In bestimmten Fällen, müssen Sie hier alternative Werte eintragen. Diese Fälle sind bedingt
|
||||
nach der gewählten CMP (Consent Manager Platform).
|
||||
|
||||
> nähere Infos unter [CMP](#consent-manager-platform-cmp)
|
||||
> nähere Infos unter [CMP](#consent-manager-platform-cmp)
|
||||
|
||||
## Blöcke
|
||||
Für den geregelten Ablauf sind folgende Blöcke nötig:
|
||||
- Suchergebnisse
|
||||
- Blockname: search_results
|
||||
- Datei: page/search/search.tpl
|
||||
- GA4 Event: view_search_results
|
||||
- Artikelliste
|
||||
- Blockname: page_list_productlist
|
||||
- Datei: page/list/list.tpl
|
||||
- GA4 Event: view_item_list
|
||||
- Detailseite
|
||||
- Blockname: details_productmain_title
|
||||
- Datei: page/details/inc/productmain.tpl
|
||||
- GA4 Event: view_item
|
||||
- dem WK hinzufügen (button)
|
||||
- Blockname: details_productmain_tobasket
|
||||
- Datei: page/details/inc/productmain.tpl
|
||||
- GA4 Event: add_to_cart
|
||||
- aus dem WK entfernen
|
||||
- Blockname: checkout_basket_main
|
||||
- Datei: page/checkout/basket.tpl
|
||||
- GA4 Event: remove_from_cart
|
||||
- Warenkorb
|
||||
- Blockname: checkout_basket_main
|
||||
- Datei: page/checkout/basket.tpl
|
||||
- GA4 Event: view_cart
|
||||
- abgeschlossener Kauf
|
||||
- Blockname: checkout_thankyou_main
|
||||
- Datei: page/checkout/thankyou.tpl
|
||||
- GA4 Event: purchase
|
||||
|
||||
## Verfügbare Datalayer Variablen
|
||||
Für die einfachste Übersicht der enthaltenen Daten empfehle ich den Vorschau-Modus vom Google Tag Manager.
|
||||
|
@ -49,7 +80,7 @@ Aktivieren Sie anschließend diese Weiche. Setzen Sie den Haken bei "Eigenen Coo
|
|||
- In der Usercentrics-Verwaltung die Services "Google Analytics" und "Google Tag Manager" anlegen
|
||||
- Den Service ```Google Tag Manager``` in den Moduleinstellungen des 'Google Analytics 4' unter
|
||||
Google Tag Manager eintragen
|
||||
|
||||
-
|
||||
- [Consent Management Provider](https://www.consentmanager.net/)
|
||||
- In der Consentmanager-Oberfläche den Anbieter "Google Tag Manager" mit der ID s905 hinzufügen
|
||||
- Im Frontend, im consentmanager-Pop-up nach dem 'Google Tag Manager' suchen
|
||||
|
@ -57,9 +88,6 @@ Aktivieren Sie anschließend diese Weiche. Setzen Sie den Haken bei "Eigenen Coo
|
|||
- prüfen, ob ein Cookie vorgegeben ist
|
||||
- sonst, in der Consentmanager-Oberfläche Cookie-Liste entsprechendes Cookie suchen und im Admin unter
|
||||
```Einstell. > Cookie Manager Einstellungen > Cookie-ID``` eintragen
|
||||
|
||||
- [Cookiefirst](https://cookiefirst.com)
|
||||
- im Cookiefirst-Hub das jeweilige Cookie finden underen zugeordnete Kategorie kopieren
|
||||
- die kopierte Kategory wird nun in den Einstellungen des Moduls hinterlegt:
|
||||
```Erweiterungen > Module > Google Analytics 4 > Einstell. > Cookie Manager Einstellungen > Steuerungsparameter (vormals CookieID)```
|
||||
- **Wichtig!** bei Nutzung des Consent-Managers von Google, muss zwangsläufig die Einstellung "Cookie manager Nutzen?" __ausgeschalten!__ werden
|
||||
|
||||
- [Cookiebot](https://www.cookiebot.com)
|
||||
- Nähere Informationen folgen bald! Bis dato, besuchen Sie bitte die offizielle Webseite.
|
|
@ -120,4 +120,4 @@ class BasketController extends BasketController_parent
|
|||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -18,11 +18,6 @@ use OxidEsales\Eshop\Application\Controller\FrontendController;
|
|||
use OxidEsales\Eshop\Application\Model\User;
|
||||
use OxidEsales\Eshop\Core\Config;
|
||||
use OxidEsales\Eshop\Core\Registry;
|
||||
use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory;
|
||||
use OxidEsales\EshopCommunity\Internal\Framework\Module\Configuration\Bridge\ModuleSettingBridgeInterface;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
class ViewConfig extends ViewConfig_parent
|
||||
{
|
||||
|
||||
|
@ -34,10 +29,7 @@ class ViewConfig extends ViewConfig_parent
|
|||
{
|
||||
if ($this->sContainerId === null)
|
||||
{
|
||||
$this->sContainerId = ContainerFactory::getInstance()
|
||||
->getContainer()
|
||||
->get(ModuleSettingBridgeInterface::class)
|
||||
->get('d3_gtm_sContainerID', 'd3googleanalytics4');
|
||||
$this->sContainerId = Registry::getConfig()->getConfigParam('d3_gtm_sContainerID');
|
||||
}
|
||||
return $this->sContainerId;
|
||||
}
|
||||
|
@ -54,6 +46,7 @@ class ViewConfig extends ViewConfig_parent
|
|||
$this->sCookieManagerType = $oManagerHandler->getCurrManager();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
|
@ -108,6 +101,7 @@ class ViewConfig extends ViewConfig_parent
|
|||
return true;
|
||||
}
|
||||
|
||||
// Cookie Manager not (yet) supported
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -150,29 +144,38 @@ class ViewConfig extends ViewConfig_parent
|
|||
|
||||
private $blGA4enabled = null;
|
||||
|
||||
|
||||
/**
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
* @return null
|
||||
*/
|
||||
public function isGA4enabled()
|
||||
{
|
||||
if ($this->blGA4enabled === null)
|
||||
{
|
||||
$this->sContainerId = ContainerFactory::getInstance()
|
||||
->getContainer()
|
||||
->get(ModuleSettingBridgeInterface::class)
|
||||
->get('d3_gtm_blEnableGA4', 'd3googleanalytics4');
|
||||
$this->sContainerId = Registry::getConfig()->getConfigParam('d3_gtm_blEnableGA4');
|
||||
}
|
||||
|
||||
return $this->blGA4enabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isGtmConsentModeSetActivated() :bool
|
||||
{
|
||||
return Registry::getConfig()->getConfigParam('d3_gtm_blActivateConsentMode');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return false|string
|
||||
*/
|
||||
public function getGtmDataLayer()
|
||||
{
|
||||
if (!$this->getGtmContainerId()) return "[]";
|
||||
|
||||
$oConfig = Registry::getConfig();
|
||||
$oView = $oConfig->getTopActiveView();
|
||||
|
||||
/** @var User|false|null $oUser */
|
||||
$oUser = $oConfig->getUser();
|
||||
|
||||
|
@ -204,14 +207,37 @@ class ViewConfig extends ViewConfig_parent
|
|||
return json_encode([$dataLayer], JSON_PRETTY_PRINT);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isDebugModeOn() :bool
|
||||
{
|
||||
return Registry::getConfig()->getConfigParam('d3_gtm_blEnableDebug');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $listId
|
||||
* @return void
|
||||
*/
|
||||
public function isPromotionList($listId)
|
||||
{
|
||||
$oConfig = Registry::getConfig();
|
||||
$aPromotionListIds = $oConfig->getConfigParam("") ?? ['bargainItems', 'newItems', 'topBox', 'alsoBought', 'accessories', 'cross'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getServerSidetaggingJsDomain() :string
|
||||
{
|
||||
return Registry::getConfig()->getConfigParam('d3_gtm_settings_serversidetagging_js');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getServerSidetaggingNoJsDomain() :string
|
||||
{
|
||||
return Registry::getConfig()->getConfigParam('d3_gtm_settings_serversidetagging_nojs');
|
||||
}
|
||||
}
|
112
composer.json
112
composer.json
|
@ -1,57 +1,57 @@
|
|||
{
|
||||
"name": "d3/google-analytics4",
|
||||
"description": "Google Tag Manager with new Google Analytics 4 for OXID eShop v6",
|
||||
"type": "oxideshop-module",
|
||||
"keywords": [
|
||||
"oxid",
|
||||
"modules",
|
||||
"eShop",
|
||||
"d3",
|
||||
"google",
|
||||
"ga4",
|
||||
"googleanalytics",
|
||||
"gtm",
|
||||
"configuration"
|
||||
],
|
||||
"homepage": "https://www.d3data.de",
|
||||
"license": [
|
||||
"GPL-3.0"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Marat Bedoev",
|
||||
"email": "hello@mb-dev.pro"
|
||||
},
|
||||
{
|
||||
"name": "D3 Data Development (Inh. Thomas Dartsch)",
|
||||
"email": "info@shopmodule.com",
|
||||
"homepage": "https://www.d3data.de"
|
||||
}
|
||||
],
|
||||
"support": {
|
||||
"email": "support@shopmodule.com"
|
||||
},
|
||||
"extra": {
|
||||
"oxideshop": {
|
||||
"blacklist-filter": [
|
||||
"*.md",
|
||||
"composer.json",
|
||||
".php-cs-fixer.php",
|
||||
"*.xml",
|
||||
"*.neon"
|
||||
],
|
||||
"target-directory": "d3/googleanalytics4"
|
||||
}
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1",
|
||||
"oxid-esales/oxideshop-ce": "^6.5",
|
||||
"google/apiclient":" ^2.0",
|
||||
"phpstan/phpstan": "^1.10"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"D3\\GoogleAnalytics4\\": "../../../source/modules/d3/googleanalytics4"
|
||||
}
|
||||
}
|
||||
{
|
||||
"name": "d3/google-analytics4",
|
||||
"description": "Google Tag Manager with new Google Analytics 4 for OXID eShop v6",
|
||||
"type": "oxideshop-module",
|
||||
"keywords": [
|
||||
"oxid",
|
||||
"modules",
|
||||
"eShop",
|
||||
"d3",
|
||||
"google",
|
||||
"ga4",
|
||||
"googleanalytics",
|
||||
"gtm",
|
||||
"configuration"
|
||||
],
|
||||
"homepage": "https://www.d3data.de",
|
||||
"license": [
|
||||
"GPL-3.0"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Marat Bedoev",
|
||||
"email": "hello@mb-dev.pro"
|
||||
},
|
||||
{
|
||||
"name": "D3 Data Development (Inh. Thomas Dartsch)",
|
||||
"email": "info@shopmodule.com",
|
||||
"homepage": "https://www.d3data.de"
|
||||
}
|
||||
],
|
||||
"support": {
|
||||
"email": "support@shopmodule.com"
|
||||
},
|
||||
"extra": {
|
||||
"oxideshop": {
|
||||
"blacklist-filter": [
|
||||
"*.md",
|
||||
"composer.json",
|
||||
".php-cs-fixer.php",
|
||||
"*.xml",
|
||||
"*.neon"
|
||||
],
|
||||
"target-directory": "d3/googleanalytics4"
|
||||
}
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1",
|
||||
"oxid-esales/oxideshop-ce": "v6.0 - v6.3",
|
||||
"google/apiclient":"^2.0",
|
||||
"phpstan/phpstan": "^1.8"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"D3\\GoogleAnalytics4\\": "../../../source/modules/d3/googleanalytics4"
|
||||
}
|
||||
}
|
||||
}
|
25
metadata.php
25
metadata.php
|
@ -1,5 +1,6 @@
|
|||
<?php
|
||||
|
||||
use D3\GoogleAnalytics4\Application\Model\Constants as Constants;
|
||||
use D3\GoogleAnalytics4\Modules\Application\Component\d3GtmBasketComponentExtension;
|
||||
use D3\GoogleAnalytics4\Modules\Application\Component\Widget\d3GtmWidgetArticleDetails as d3GtmWidgetArticleDetails;
|
||||
use D3\GoogleAnalytics4\Modules\Application\Controller\ArticleDetailsController;
|
||||
|
@ -35,7 +36,7 @@ use OxidEsales\Eshop\Core\ViewConfig as OEViewConfig;
|
|||
|
||||
$sMetadataVersion = '2.1';
|
||||
$aModule = [
|
||||
'id' => 'd3googleanalytics4',
|
||||
'id' => Constants::OXID_MODULE_ID,
|
||||
'title' => 'Google Analytics 4',
|
||||
'description' => "Dieses Modul bietet die Möglichkeit in Ihrem OXID eShop (6.x) die neue 'Property'
|
||||
Google Analytics 4 (GA4) von Google zu integrieren.<br>
|
||||
|
@ -48,7 +49,7 @@ $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' => '2.15.0',
|
||||
'version' => '1.17.0',
|
||||
'author' => 'Data Development (Inh.: Thomas Dartsch)',
|
||||
'email' => 'support@shopmodule.com',
|
||||
'url' => 'https://www.oxidmodule.com/',
|
||||
|
@ -189,6 +190,13 @@ $aModule = [
|
|||
'value' => false,
|
||||
'position' => 999
|
||||
],
|
||||
[
|
||||
'group' => 'd3_gtm_settings',
|
||||
'name' => 'd3_gtm_blActivateConsentMode',
|
||||
'type' => 'bool',
|
||||
'value' => false,
|
||||
'position' => 999
|
||||
],
|
||||
[
|
||||
'group' => 'd3_gtm_settings_cookiemanager',
|
||||
'name' => 'd3_gtm_settings_hasOwnCookieManager',
|
||||
|
@ -210,5 +218,18 @@ $aModule = [
|
|||
'value' => 'none',
|
||||
'constraints' => 'NONE|CONSENTMANAGER|USERCENTRICS|COOKIEFIRST|COOKIEBOT',
|
||||
],
|
||||
// OST929760 - Erweiterung für Serverside Tagging
|
||||
[
|
||||
'group' => 'd3_gtm_settings_serversidetagging',
|
||||
'name' => 'd3_gtm_settings_serversidetagging_js',
|
||||
'type' => 'str',
|
||||
'value' => 'https://www.googletagmanager.com/gtm.js',
|
||||
],
|
||||
[
|
||||
'group' => 'd3_gtm_settings_serversidetagging',
|
||||
'name' => 'd3_gtm_settings_serversidetagging_nojs',
|
||||
'type' => 'str',
|
||||
'value' => 'https://www.googletagmanager.com/ns.html',
|
||||
],
|
||||
]
|
||||
];
|
11
phpstan.neon
11
phpstan.neon
|
@ -1,15 +1,16 @@
|
|||
parameters:
|
||||
scanFiles:
|
||||
- IntelliSenseHelper.php
|
||||
- ../../oxid-esales/oxideshop-ce/source/bootstrap.php
|
||||
- ../../oxid-esales/oxideshop-ce/source/oxfunctions.php
|
||||
- ../../oxid-esales/oxideshop-ce/source/overridablefunctions.php
|
||||
- ../../../../Shops/CE/6.1.x/616_/vendor/oxid-esales/oxideshop-ce/source/bootstrap.php
|
||||
- ../../../../Shops/CE/6.1.x/616_/vendor/oxid-esales/oxideshop-ce/source/oxfunctions.php
|
||||
- ../../../../Shops/CE/6.1.x/616_/vendor/oxid-esales/oxideshop-ce/source/overridablefunctions.php
|
||||
scanDirectories:
|
||||
- ../../oxid-esales
|
||||
- ../../../../Shops/CE/6.1.x/616_/vendor/oxid-esales
|
||||
ignoreErrors:
|
||||
- '#.*is not subtype of Throwable.*#'
|
||||
- '#\$sValue of method OxidEsales\\EshopCommunity\\Core\\Controller\\BaseController::addTplParam\(\) expects string,[ a-zA-Z\.]+#'
|
||||
paths:
|
||||
- ./
|
||||
level: 5
|
||||
phpVersion: 80100
|
||||
phpVersion: 70200
|
||||
checkMissingIterableValueType: false
|
||||
|
|
Loading…
Reference in New Issue