Compare commits

..

21 Commits
1.2.1 ... 2.1

Author SHA1 Message Date
e2bcb34051 bump version 2023-01-27 11:11:09 +01:00
4ea0c19d7b Merge remote-tracking branch 'remotes/origin/rel_1.x' into rel_2.x 2023-01-27 11:04:23 +01:00
56740f1f10 rm unnecessary method call in gtm_js.tpl 2023-01-27 09:19:05 +01:00
daed30a585 rm unnecessary entries in metadata 2023-01-27 09:07:22 +01:00
48d411ac3f switch head-meta-infos 2023-01-27 09:07:09 +01:00
b530366cb8 rm unnecessary lang file 2023-01-27 09:06:49 +01:00
975d07056a cleaning off branding 2023-01-27 08:59:06 +01:00
24bf113d30 switch comment in changelog of 2.0 2023-01-26 09:20:56 +01:00
ca6a810fa3 add 1.0 section to changelog 2023-01-26 09:16:51 +01:00
62b382eadf adding tech-docs; rm unnecessary sections in readme; fixing wrong links 2023-01-26 09:15:10 +01:00
45d8e45137 fix missing entries in changelog 2023-01-25 10:58:24 +01:00
70f2308575 extend changelog and readme 2023-01-25 10:48:02 +01:00
6eb15ec080 add block description 2023-01-20 14:31:39 +01:00
d722c46a74 bump metadata-version 2023-01-20 11:26:09 +01:00
d847a34e99 set compatibility to oxid 6.5 and above 2023-01-20 11:24:30 +01:00
7b55d1d57c adjust requirements 2023-01-20 11:18:48 +01:00
a25be1069c rework code to actually fit 6.0.x && 6.1x 2023-01-20 11:18:17 +01:00
5200232a32 Merge remote-tracking branch 'remotes/origin/rel_1.x' into dev_1.x_OXID_6.3 2023-01-20 11:11:17 +01:00
bcd785774b adjusting composer.json to fit corresponding shop-version 2022-12-22 08:56:45 +01:00
5ba613df30 add currency to the params 2022-12-21 11:12:35 +01:00
a1dc0a6a58 fix bug that'd fail in wave and fail iIndex 2022-12-09 14:51:45 +01:00
9 changed files with 63 additions and 70 deletions

View File

@ -33,6 +33,14 @@ $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->D3blAcceptedCookie($d3VtConfigObject->getConfigParam('d3_gtm_settings_cookieName'))}] [{if $oViewConf->blAcceptedCookie($d3VtConfigObject->getConfigParam('d3_gtm_settings_cookieName'))}]
[{if $oViewConf->getGtmContainerId()}][{strip}] [{if $oViewConf->getGtmContainerId()}][{strip}]
<!-- Google Tag Manager --> <!-- Google Tag Manager -->

View File

@ -4,8 +4,6 @@
[{assign var='gtmCartArticles' value=$oView->getBasketArticles()}] [{assign var='gtmCartArticles' value=$oView->getBasketArticles()}]
[{strip}][{capture assign=d3_ga4_view_cart}] [{strip}][{capture assign=d3_ga4_view_cart}]
let iPrice = "[{oxprice price=$oxcmp_basket->getPrice()}]";
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */ dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
dataLayer.push({ dataLayer.push({
'event': 'view_cart', 'event': 'view_cart',
@ -13,7 +11,7 @@
'ecommerce': { 'ecommerce': {
'actionField': "step: 1", 'actionField': "step: 1",
'currency': "[{$currency->name}]", 'currency': "[{$currency->name}]",
'value': iPrice.replace("€", ""), 'value': [{oxprice price=$oxcmp_basket->getPrice()}],
'items': [ 'items': [
[{foreach from=$oxcmp_basket->getContents() item=basketitem name=gtmCartContents key=basketindex}] [{foreach from=$oxcmp_basket->getContents() item=basketitem name=gtmCartContents key=basketindex}]
[{assign var='_price' value=$basketitem->getUnitPrice()}] [{assign var='_price' value=$basketitem->getUnitPrice()}]

View File

@ -1,35 +1,37 @@
[{$smarty.block.parent}] [{$smarty.block.parent}]
[{assign var="gtmProduct" value=$oView->getProduct()}] [{assign var="gtmProduct" value=$oView->getProduct()}]
[{assign var="gtmCategory" value=$gtmProduct->getCategory()}] [{if $gtmProduct}]
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}] [{assign var="gtmCategory" value=$gtmProduct->getCategory()}]
<script> [{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */ <script>
dataLayer.push({ dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
dataLayer.push({
'event': 'ee.impression', 'event': 'ee.impression',
'eventLabel':'Impression', 'eventLabel':'Impression',
'ecommerce': { 'ecommerce': {
'currencyCode': '[{$currency->name}]', 'currencyCode': '[{$currency->name}]',
'impressions': [ 'impressions': [
{ {
'name': '[{$gtmProduct->oxarticles__oxtitle->value}]', 'name': '[{$gtmProduct->getFieldData('oxtitle')}]',
'id': '[{$gtmProduct->oxarticles__oxartnum->value}]', 'id': '[{$gtmProduct->getFieldData('oxartnum')}]',
'price': [{$gtmProduct->oxarticles__oxprice->value}], 'price': [{$gtmProduct->getFieldData('oxprice')}],
'brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]', 'brand': '[{if $gtmManufacturer}][{$gtmManufacturer->getFieldData('oxtitle')}][{/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->oxarticles__oxvarselect->value}][{$gtmProduct->oxarticles__oxvarselect->value}][{/if}]' 'variant': '[{if $gtmProduct->getFieldData('oxvarselect')}][{$gtmProduct->getFieldData('oxvarselect')}][{/if}]'
[{if $list && $position}], [{if $list && $position}],
'list': '[{$list}]', 'list': '[{$list}]',
'position': [{"_"|str_replace:"":$position}] 'position': [{"_"|str_replace:"":$position}]
[{/if}] [{/if}]
} }
] ]
} }
}); });
</script> </script>
<!-- <!--
sWidgetType [{$sWidgetType}] | [{$oView->getViewParameter('sWidgetType')}] sWidgetType [{$sWidgetType}] | [{$oView->getViewParameter('sWidgetType')}]
sListType [{$sListType}] | [{$oView->getViewParameter('sListType')}] sListType [{$sListType}] | [{$oView->getViewParameter('sListType')}]
iIndex [{$iIndex}] | [{$oView->getIndex()}] iIndex [{$iIndex}] | [{$oView->getViewParameter('iIndex')}]
listId [{$listId}] | [{$oView->getViewParameter('listId')}] listId [{$listId}] | [{$oView->getViewParameter('listId')}]
testid [{$testid}] | [{$oView->getViewParameter('testid')}] testid [{$testid}] | [{$oView->getViewParameter('testid')}]
--> -->
[{/if}]

View File

@ -4,22 +4,20 @@ 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).
## [1.2.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.2...1.2.1) - 2023-02-22 ## [2.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.0...2.1) - 2023-01-27
### Fixed
- price formatting in view_cart
## [1.2](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.1...1.2) - 2023-02-01
### Added ### Added
- own cookie-check-handler - 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
## [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
### Changed ## [1.0](https://git.d3data.de/D3Public/GoogleAnalytics4/releases/tag/1.0) - 2023-01-20
- 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,14 +1,13 @@
<?php <?php
/** /**
* This Software is the property of Data Development and is protected * For the full copyright and license information, please view the LICENSE
* by copyright law - it is NOT Freeware. * file that was distributed with this source code.
* Any unauthorized use of this software without a valid license *
* is a violation of the license agreement and will be prosecuted by * https://www.d3data.de
* 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 <support@shopmodule.com> * @author D3 Data Development - Daniel Seifert <info@shopmodule.com>
* @link http://www.oxidmodule.com * @link https://www.oxidmodule.com
*/ */
namespace D3\GoogleAnalytics4\Modules\Core; namespace D3\GoogleAnalytics4\Modules\Core;
@ -26,35 +25,24 @@ class ViewConfig extends ViewConfig_parent
{ {
if ($this->sContainerId === null) if ($this->sContainerId === null)
{ {
$this->sContainerId = ContainerFactory::getInstance()
$this->sContainerId = $this->getConfig()->getConfigParam('d3_gtm_sContainerID'); ->getContainer()
->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 = $this->getConfig()->getConfigParam('d3_gtm_blEnableGA4'); $this->sContainerId = ContainerFactory::getInstance()
->getContainer()
->get(ModuleSettingBridgeInterface::class)
->get('d3_gtm_blEnableGA4', 'd3googleanalytics4');
} }
return $this->blGA4enabled; return $this->blGA4enabled;
@ -67,7 +55,6 @@ 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:^1 php composer require d3/google-analytics4:^2
``` ```
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": "v6.0 - 6.3", "oxid-esales/oxideshop-ce": "^6.5",
"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' => '1.2.1', 'version' => '2.1.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/',