Compare commits
21 Commits
Author | SHA1 | Date | |
---|---|---|---|
e2bcb34051 | |||
4ea0c19d7b | |||
56740f1f10 | |||
daed30a585 | |||
48d411ac3f | |||
b530366cb8 | |||
975d07056a | |||
24bf113d30 | |||
ca6a810fa3 | |||
62b382eadf | |||
45d8e45137 | |||
70f2308575 | |||
6eb15ec080 | |||
d722c46a74 | |||
d847a34e99 | |||
7b55d1d57c | |||
a25be1069c | |||
5200232a32 | |||
bcd785774b | |||
5ba613df30 | |||
a1dc0a6a58 |
@ -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',
|
||||||
];
|
];
|
||||||
|
@ -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 -->
|
||||||
|
@ -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()}]
|
||||||
|
@ -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}]
|
18
CHANGELOG.md
18
CHANGELOG.md
@ -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
|
@ -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();
|
||||||
|
@ -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.
|
||||||
|
@ -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": {
|
||||||
|
@ -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/',
|
||||||
|
Reference in New Issue
Block a user