Compare commits
10 Commits
Author | SHA1 | Date |
---|---|---|
MaxBUhe | db680b893f | |
MaxBUhe | 4458fc55ee | |
MaxBUhe | 6053219687 | |
MaxBUhe | dbaf871c9e | |
MaxBUhe | 2a8c939afd | |
MaxBUhe | 02db7be9d8 | |
MaxBUhe | aa616db0f2 | |
MaxBUhe | 60a3c797fb | |
MaxBUhe | 55306e0495 | |
MaxBUhe | d856a994ab |
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace D3\GoogleAnalytics4\Application\Model;
|
||||
|
||||
|
||||
class Constants
|
||||
{
|
||||
public const OXID_MODULE_ID = 'd3googleanalytics4';
|
||||
}
|
|
@ -95,5 +95,10 @@ src="{Domain}?id={Container-ID}"
|
|||
<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) {
|
||||
|
@ -15,7 +34,7 @@
|
|||
j.async = true;
|
||||
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}]
|
||||
|
|
|
@ -4,6 +4,14 @@ 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).
|
||||
|
||||
## [1.17.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.16.0...1.17.0) - 2024-04-11
|
||||
### Added
|
||||
- multilang translations
|
||||
- GA4 consent-mode default values
|
||||
|
||||
### Changed
|
||||
- metadataID centralized
|
||||
|
||||
## [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
|
||||
|
|
|
@ -144,7 +144,10 @@ class ViewConfig extends ViewConfig_parent
|
|||
|
||||
private $blGA4enabled = null;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @return null
|
||||
*/
|
||||
public function isGA4enabled()
|
||||
{
|
||||
if ($this->blGA4enabled === null)
|
||||
|
@ -155,6 +158,17 @@ class ViewConfig extends ViewConfig_parent
|
|||
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 "[]";
|
||||
|
@ -193,11 +207,18 @@ 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();
|
||||
|
@ -206,8 +227,6 @@ class ViewConfig extends ViewConfig_parent
|
|||
|
||||
/**
|
||||
* @return string
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function getServerSidetaggingJsDomain() :string
|
||||
{
|
||||
|
@ -216,8 +235,6 @@ class ViewConfig extends ViewConfig_parent
|
|||
|
||||
/**
|
||||
* @return string
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function getServerSidetaggingNoJsDomain() :string
|
||||
{
|
||||
|
|
12
metadata.php
12
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' => '1.16.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',
|
||||
|
|
Loading…
Reference in New Issue