diff --git a/Application/Controller/Admin/GA4AdminUserInterface_main.php b/Application/Controller/Admin/GA4AdminUserInterface_main.php index 019f46a..d8ae94f 100644 --- a/Application/Controller/Admin/GA4AdminUserInterface_main.php +++ b/Application/Controller/Admin/GA4AdminUserInterface_main.php @@ -18,6 +18,7 @@ class GA4AdminUserInterface_main extends \OxidEsales\Eshop\Application\Controlle $return = parent::render(); $this->addTplParam('d3ViewObject', $this); + $this->addTplParam('d3ViewConfObject', Registry::get(ViewConfig::class)); $this->addTplParam('d3ManagerTypeArray', oxNew(ManagerTypes::class)->getManagerList()); return $return; @@ -34,6 +35,8 @@ class GA4AdminUserInterface_main extends \OxidEsales\Eshop\Application\Controlle '_blEnableDebug', '_blEnableConsentMode', '_blEnableOwnCookieManager', + '_blEnableMeasurementCapabilities', + '_blEnableUsercentricsConsentModeApi', ]; foreach ($aCheckBoxParams as $checkBoxName){ diff --git a/Application/views/admin/de/d3googleanalytics4_lang.php b/Application/views/admin/de/d3googleanalytics4_lang.php index fcdcaea..a28a04b 100644 --- a/Application/views/admin/de/d3googleanalytics4_lang.php +++ b/Application/views/admin/de/d3googleanalytics4_lang.php @@ -16,6 +16,9 @@ $aLang = array( 'D3CONTAINERID' => 'Container-ID', 'D3ACTIVATEMOD' => 'Modul aktivieren', 'D3CNTRLPARAM' => 'Steuerungsparameter', + 'D3INACTIVATEMOD' => 'Modul ist nicht aktiv! Es werde keine Funktionen ausgespielt!', + // Usercentrics Dynamische Optionen + 'D3USRCNTRCSDYNOPT' => 'Usercentrics Dynamische Optionen', // Use debug mode? 'D3USEDEBUGMODE' => "Debug-Modus aktivieren", @@ -28,6 +31,20 @@ $aLang = array( 'D3CMPUSEQ' => 'Cookie Manager nutzen?', 'D3CMP' => 'Consent Management Platform ( CMP )', + // Usercentrics Config + // activate Individual Default Values + 'D3USRCNTRCSCFG_ACT_INDIVDEFVAL' => "usercentrics individual 'Default Values' aktiveren", + // standard Consent + 'D3USRCNTRCSCFG_STD_CNST' => "GTM Standard Consent", + // activate consent mode API + 'D3USRCNTRCSCFG_ACT_CNSTMDE_API' => "Usercentrics Consent Mode API aktivieren", + // consent mode api + 'D3USRCNTRCSCFG_CNSTMDE_API' => "Consent Mode API", + 'D3USRCNTRCSCFG_DOCS' => 'Nähere Infos zu den hier konfigurierbaren Einstellungen entnehmen Sie bitte der offiziellen + Dokumentation von Usercentrics selbst: Dokumentation', + 'D3USRCNTRCSCFG_WARNING' => "Bevor Sie hier Anpassungen machen, konsultieren Sie bitte einen technischen Support!
+ Anpassungen können zu Beeinträchtigungen und Ausfall von Funktionen im Frontend führen!", + // Additional Config // Server-Side tagging 'D3SERVERSIDETAGGING' => 'Server-Side tagging', diff --git a/Application/views/admin/tpl/d3googleanalytics4_main.tpl b/Application/views/admin/tpl/d3googleanalytics4_main.tpl index 869d44f..a2731ce 100644 --- a/Application/views/admin/tpl/d3googleanalytics4_main.tpl +++ b/Application/views/admin/tpl/d3googleanalytics4_main.tpl @@ -7,6 +7,7 @@ + [{if $readonly}] [{assign var="readonly" value="readonly disabled"}] @@ -135,6 +136,49 @@ + [{if $d3ViewConfObject->d3IsUsercentricsCMPChosen()}] +
+

+ +

+
+
+
+
+
+ [{oxmultilang ident="D3USRCNTRCSCFG_WARNING"}] +
+ [{oxmultilang ident="D3USRCNTRCSCFG_DOCS"}] +
+
+ +
+ d3GetModuleConfigParam('_blEnableMeasurementCapabilities')}]checked[{/if}]> + +
+
+ [{oxmultilang ident="D3USRCNTRCSCFG_STD_CNST"}] + +
+ +
+ d3GetModuleConfigParam('_blEnableUsercentricsConsentModeApi')}]checked[{/if}]> + +
+
+ [{oxmultilang ident="D3USRCNTRCSCFG_CNSTMDE_API"}] + +
+
+
+
+ [{/if}] diff --git a/Application/views/blocks/_gtm_js.tpl b/Application/views/blocks/_gtm_js.tpl index 5c4751c..9b97924 100755 --- a/Application/views/blocks/_gtm_js.tpl +++ b/Application/views/blocks/_gtm_js.tpl @@ -10,7 +10,10 @@ [{strip}] [{if $oViewConf->isGtmConsentModeSetActivated()}] - + [{/if}] + + [{if $oViewConf->d3IsUsercentricsCMPChosen() and $oViewConf->d3GetModuleConfigParam('_blEnableUsercentricsConsentModeApi')}] + [{/if}] diff --git a/Modules/Core/ViewConfig.php b/Modules/Core/ViewConfig.php index 6e80c00..d5f294c 100644 --- a/Modules/Core/ViewConfig.php +++ b/Modules/Core/ViewConfig.php @@ -12,6 +12,7 @@ namespace D3\GoogleAnalytics4\Modules\Core; +use D3\GoogleAnalytics4\Application\Model\CMP\Usercentrics; use D3\GoogleAnalytics4\Application\Model\Constants; use D3\GoogleAnalytics4\Application\Model\ManagerHandler; use D3\GoogleAnalytics4\Application\Model\ManagerTypes; @@ -245,4 +246,13 @@ class ViewConfig extends ViewConfig_parent { return Registry::getConfig()->getShopConfVar(Constants::OXID_MODULE_ID.$configParamName, null, Constants::OXID_MODULE_ID); } + + /** + * @return bool + */ + public function d3IsUsercentricsCMPChosen() :bool + { + return (bool) ($this->d3GetModuleConfigParam('_HAS_STD_MANAGER') === Usercentrics::sCMPName + or $this->d3GetModuleConfigParam('_HAS_STD_MANAGER') === Usercentrics::sAlternatename); + } } \ No newline at end of file