Compare commits

..

3 Commits
2.1.1 ... 1.2

Author SHA1 Message Date
25234abfd8 bump version 2023-02-01 15:42:59 +01:00
667b48ac4b rm unnecessary hint 2023-02-01 15:33:52 +01:00
5e358fc684 add own cookie-check method; rm unnecessary help-text 2023-02-01 15:32:28 +01:00
8 changed files with 63 additions and 68 deletions

View File

@ -33,14 +33,6 @@ $aLang = [
// for cookie manager settings // for cookie manager settings
'SHOP_MODULE_GROUP_d3_gtm_settings_cookiemanager' => 'Cookie Manager Einstellungen', 'SHOP_MODULE_GROUP_d3_gtm_settings_cookiemanager' => 'Cookie Manager Einstellungen',
'SHOP_MODULE_d3_gtm_settings_hasOwnCookieManager' => 'Eigenen Cookie Manager nutzen? 'SHOP_MODULE_d3_gtm_settings_hasOwnCookieManager' => 'Eigenen Cookie Manager nutzen?',
<strong style="color: red">Hinweis (Fragezeichen) lesen!</strong>',
'HELP_SHOP_MODULE_d3_gtm_settings_hasOwnCookieManager' => 'Stellen Sie sicher, dass Sie ein Modul installiert haben,
dass die Methode "blAcceptedCookie" implementiert.<br> Sollten Sie sich nicht sicher sein kontaktieren Sie Ihren
technischen Ansprechpartner.<br><br>
<strong>Wichtig!</strong> Das Aktivieren dieser Checkbox kann <u>ohne dem nötigen technischen Wissen</u> den Shop-Ablauf im Frontend stören!<hr>
Die Checkbox muss nicht aktiviert werden, sofern die Cookies beispielsweise direkt via Google Cookie-Banner integriert werden.
Bei Fragen <u>kontaktieren Sie bitte</u> auch hier einen entsprechenden technischen Ansprechpartner.',
'SHOP_MODULE_d3_gtm_settings_cookieName' => 'Cookie-Name', 'SHOP_MODULE_d3_gtm_settings_cookieName' => 'Cookie-Name',
]; ];

View File

@ -1,6 +1,6 @@
[{assign var="d3VtConfigObject" value=$oViewConf->getConfig()}] [{assign var="d3VtConfigObject" value=$oViewConf->getConfig()}]
[{if $d3VtConfigObject->getConfigParam('d3_gtm_settings_hasOwnCookieManager')}] [{if $d3VtConfigObject->getConfigParam('d3_gtm_settings_hasOwnCookieManager')}]
[{if $oViewConf->blAcceptedCookie($d3VtConfigObject->getConfigParam('d3_gtm_settings_cookieName'))}] [{if $oViewConf->D3blAcceptedCookie($d3VtConfigObject->getConfigParam('d3_gtm_settings_cookieName'))}]
[{if $oViewConf->getGtmContainerId()}][{strip}] [{if $oViewConf->getGtmContainerId()}][{strip}]
<!-- Google Tag Manager --> <!-- Google Tag Manager -->

View File

@ -1,6 +1,5 @@
[{$smarty.block.parent}] [{$smarty.block.parent}]
[{assign var="gtmProduct" value=$oView->getProduct()}] [{assign var="gtmProduct" value=$oView->getProduct()}]
[{if $gtmProduct}]
[{assign var="gtmCategory" value=$gtmProduct->getCategory()}] [{assign var="gtmCategory" value=$gtmProduct->getCategory()}]
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}] [{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
<script> <script>
@ -12,12 +11,12 @@
'currencyCode': '[{$currency->name}]', 'currencyCode': '[{$currency->name}]',
'impressions': [ 'impressions': [
{ {
'name': '[{$gtmProduct->getFieldData('oxtitle')}]', 'name': '[{$gtmProduct->oxarticles__oxtitle->value}]',
'id': '[{$gtmProduct->getFieldData('oxartnum')}]', 'id': '[{$gtmProduct->oxarticles__oxartnum->value}]',
'price': [{$gtmProduct->getFieldData('oxprice')}], 'price': [{$gtmProduct->oxarticles__oxprice->value}],
'brand': '[{if $gtmManufacturer}][{$gtmManufacturer->getFieldData('oxtitle')}][{/if}]', 'brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
'category': '[{if $gtmCategory}][{$gtmCategory->getLink()|parse_url:5|ltrim:"/"|rtrim:"/"}][{else}]-[{/if}]', 'category': '[{if $gtmCategory}][{$gtmCategory->getLink()|parse_url:5|ltrim:"/"|rtrim:"/"}][{else}]-[{/if}]',
'variant': '[{if $gtmProduct->getFieldData('oxvarselect')}][{$gtmProduct->getFieldData('oxvarselect')}][{/if}]' 'variant': '[{if $gtmProduct->oxarticles__oxvarselect->value}][{$gtmProduct->oxarticles__oxvarselect->value}][{/if}]'
[{if $list && $position}], [{if $list && $position}],
'list': '[{$list}]', 'list': '[{$list}]',
'position': [{"_"|str_replace:"":$position}] 'position': [{"_"|str_replace:"":$position}]
@ -30,8 +29,7 @@
<!-- <!--
sWidgetType [{$sWidgetType}] | [{$oView->getViewParameter('sWidgetType')}] sWidgetType [{$sWidgetType}] | [{$oView->getViewParameter('sWidgetType')}]
sListType [{$sListType}] | [{$oView->getViewParameter('sListType')}] sListType [{$sListType}] | [{$oView->getViewParameter('sListType')}]
iIndex [{$iIndex}] | [{$oView->getViewParameter('iIndex')}] iIndex [{$iIndex}] | [{$oView->getIndex()}]
listId [{$listId}] | [{$oView->getViewParameter('listId')}] listId [{$listId}] | [{$oView->getViewParameter('listId')}]
testid [{$testid}] | [{$oView->getViewParameter('testid')}] testid [{$testid}] | [{$oView->getViewParameter('testid')}]
--> -->
[{/if}]

View File

@ -4,24 +4,18 @@ 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/), 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). and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [2.1.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.1...2.1.1) - 2023-01-27 ## [1.2](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.1...1.2) - 2023-02-01
### Fixed
- add missing class import
## [2.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.0...2.1) - 2023-01-27
### Added ### Added
- block section for add_to_basket js - own cookie-check-handler
- 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
## [1.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.0...1.1) - 2023-01-27 ## [1.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.0...1.1) - 2023-01-27
### Added ### Added
- block section for add_to_basket js - block section for add_to_basket js
- template block order positions - template block order positions
## [1.0](https://git.d3data.de/D3Public/GoogleAnalytics4/releases/tag/1.0) - 2023-01-20 ### Changed
- switched price formatting
## [1.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.0...1.0) - 2023-01-20
### Added ### Added
- publication of app features - publication of app features

View File

@ -1,21 +1,20 @@
<?php <?php
/** /**
* For the full copyright and license information, please view the LICENSE * This Software is the property of Data Development and is protected
* file that was distributed with this source code. * by copyright law - it is NOT Freeware.
* * Any unauthorized use of this software without a valid license
* https://www.d3data.de * is a violation of the license agreement and will be prosecuted by
* * civil and criminal law.
* http://www.shopmodule.com
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch) * @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Daniel Seifert <info@shopmodule.com> * @author D3 Data Development - Daniel Seifert <support@shopmodule.com>
* @link https://www.oxidmodule.com * @link http://www.oxidmodule.com
*/ */
namespace D3\GoogleAnalytics4\Modules\Core; namespace D3\GoogleAnalytics4\Modules\Core;
use OxidEsales\Eshop\Application\Controller\FrontendController; use OxidEsales\Eshop\Application\Controller\FrontendController;
use OxidEsales\Eshop\Core\Registry; use OxidEsales\Eshop\Core\Registry;
use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory;
use OxidEsales\EshopCommunity\Internal\Framework\Module\Configuration\Bridge\ModuleSettingBridgeInterface;
class ViewConfig extends ViewConfig_parent class ViewConfig extends ViewConfig_parent
{ {
@ -27,24 +26,35 @@ class ViewConfig extends ViewConfig_parent
{ {
if ($this->sContainerId === null) if ($this->sContainerId === null)
{ {
$this->sContainerId = ContainerFactory::getInstance()
->getContainer() $this->sContainerId = $this->getConfig()->getConfigParam('d3_gtm_sContainerID');
->get(ModuleSettingBridgeInterface::class)
->get('d3_gtm_sContainerID', 'd3googleanalytics4');
} }
return $this->sContainerId; return $this->sContainerId;
} }
/**
* @param $sCookieID
* @return bool
*/
public function D3blAcceptedCookie($sCookieID)
{
$oSession = Registry::getSession();
$aCookies = $oSession->getVariable("aCookieSel");
if (!is_null($aCookies) && is_array($aCookies) && array_key_exists($sCookieID, $aCookies) && $aCookies[$sCookieID] == "1") {
return true;
}
return false;
}
private $blGA4enabled = null; private $blGA4enabled = null;
public function isGA4enabled() public function isGA4enabled()
{ {
if ($this->blGA4enabled === null) if ($this->blGA4enabled === null)
{ {
$this->sContainerId = ContainerFactory::getInstance() $this->sContainerId = $this->getConfig()->getConfigParam('d3_gtm_blEnableGA4');
->getContainer()
->get(ModuleSettingBridgeInterface::class)
->get('d3_gtm_blEnableGA4', 'd3googleanalytics4');
} }
return $this->blGA4enabled; return $this->blGA4enabled;
@ -57,6 +67,7 @@ class ViewConfig extends ViewConfig_parent
$oConfig = Registry::getConfig(); $oConfig = Registry::getConfig();
$oView = $oConfig->getTopActiveView(); $oView = $oConfig->getTopActiveView();
/** @var FrontendController $oShop */ /** @var FrontendController $oShop */
$oUser = $oConfig->getUser(); $oUser = $oConfig->getUser();
$cl = $this->getTopActionClassName(); $cl = $this->getTopActionClassName();

View File

@ -23,7 +23,7 @@ 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. Ö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 ```bash
php composer require d3/google-analytics4:^2 php composer require d3/google-analytics4:^1
``` ```
Sofern nötig, bestätigen Sie bitte, dass Sie `package-name` erlauben, Code auszuführen. Sofern nötig, bestätigen Sie bitte, dass Sie `package-name` erlauben, Code auszuführen.

View File

@ -45,7 +45,7 @@
}, },
"require": { "require": {
"php": ">=7.1", "php": ">=7.1",
"oxid-esales/oxideshop-ce": "^6.5", "oxid-esales/oxideshop-ce": "v6.0 - 6.3",
"google/apiclient":" ^2.0" "google/apiclient":" ^2.0"
}, },
"autoload": { "autoload": {

View File

@ -17,7 +17,7 @@ $aModule = [
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.1.1', 'version' => '1.2.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/',