Compare commits

...

27 Commits
2.0 ... 2.1

Author SHA1 Message Date
MaxBUhe e2bcb34051 bump version 2023-01-27 11:11:09 +01:00
MaxBUhe 4ea0c19d7b Merge remote-tracking branch 'remotes/origin/rel_1.x' into rel_2.x 2023-01-27 11:04:23 +01:00
MaxBUhe 3ff03ee0df bump version 2023-01-27 10:50:00 +01:00
MaxBUhe 09c1e31efe rm unnecessary import 2023-01-27 09:37:28 +01:00
MaxBUhe 6d057971a7 rm unnecessary method call in gtm_js.tpl 2023-01-27 09:36:05 +01:00
MaxBUhe 0b134321ef rm unnecessary entries in metadata 2023-01-27 09:35:55 +01:00
MaxBUhe b5d056fd83 switch head-meta-infos 2023-01-27 09:35:44 +01:00
MaxBUhe 410be2fb40 rm unnecessary lang file 2023-01-27 09:27:38 +01:00
MaxBUhe bd17c3370d cleaning off branding 2023-01-27 09:27:27 +01:00
MaxBUhe 56740f1f10 rm unnecessary method call in gtm_js.tpl 2023-01-27 09:19:05 +01:00
MaxBUhe daed30a585 rm unnecessary entries in metadata 2023-01-27 09:07:22 +01:00
MaxBUhe 48d411ac3f switch head-meta-infos 2023-01-27 09:07:09 +01:00
MaxBUhe b530366cb8 rm unnecessary lang file 2023-01-27 09:06:49 +01:00
MaxBUhe 975d07056a cleaning off branding 2023-01-27 08:59:06 +01:00
MaxBUhe d028f418ad add block positions to metadata 2023-01-26 15:31:45 +01:00
MaxBUhe 24bf113d30 switch comment in changelog of 2.0 2023-01-26 09:20:56 +01:00
MaxBUhe ca6a810fa3 add 1.0 section to changelog 2023-01-26 09:16:51 +01:00
MaxBUhe 62b382eadf adding tech-docs; rm unnecessary sections in readme; fixing wrong links 2023-01-26 09:15:10 +01:00
MaxBUhe cecbc0dec8 adding tech-docs; rm unnecessary sections in readme; fixing wrong links 2023-01-26 09:09:09 +01:00
MaxBUhe 6a0fb759e1 add block to add_to_basket for indiv handling 2023-01-25 14:32:22 +01:00
MaxBUhe 120c765d0c rather using basket_component to get formatted price 2023-01-25 14:30:59 +01:00
MaxBUhe 4f73f18080 fix wrong changelog comparisons 2023-01-25 11:01:02 +01:00
MaxBUhe 45d8e45137 fix missing entries in changelog 2023-01-25 10:58:24 +01:00
MaxBUhe 70f2308575 extend changelog and readme 2023-01-25 10:48:02 +01:00
MaxBUhe 00f76d9908 extend changelog and readme 2023-01-25 10:39:23 +01:00
MaxBUhe 306af0f7bd add shop-block description to readme 2023-01-20 14:32:00 +01:00
MaxBUhe 6eb15ec080 add block description 2023-01-20 14:31:39 +01:00
13 changed files with 127 additions and 290 deletions

View File

@ -1,39 +0,0 @@
<?php
/**
* [bla] tag-manager
* Copyright (C) 2018 bestlife AG
* info: oxid@bestlife.ag
*
* This program is free software;
* you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation;
* either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
* You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>
**/
$aLang = [
'charset' => 'UTF-8',
// das hier wird nicht mehr benötigt, aber ich lasse es drin, falls doch
// leserliche Namen fĂĽr product list performance (GA)
'VT_GTM_EE_productList' => 'Kategorie',
'VT_GTM_EE_categoryList' => 'Kategorie',
'VT_GTM_EE_searchList' => 'Suchergebnisse',
'VT_GTM_EE_cross' => 'Crossselling',
'VT_GTM_EE_accessories' => 'Zubehör',
'VT_GTM_EE_alsoBought' => 'Kunden kaufen auch',
'VT_GTM_EE_last' => 'Zuletzt angesehen',
'VT_GTM_EE_bargainItems' => 'Angebot der Woche',
'VT_GTM_EE_newItems' => 'Frisch eingetroffen',
'VT_GTM_EE_topBox' => 'Topseller',
// ab hier wird wieder benötigt
// Dimensionen im checkout
'VT_GTM_EE_LOGINOPTION' => 'Bestandskunde',
'VT_GTM_EE_LOGINOPTION1' => 'Gastbestellung',
'VT_GTM_EE_LOGINOPTION2' => 'Bestandskunde',
'VT_GTM_EE_LOGINOPTION3' => 'Neukunde'
];

View File

@ -1,37 +0,0 @@
<?php
/**
* [bla] tag-manager
* Copyright (C) 2018 bestlife AG
* info: oxid@bestlife.ag
*
* This program is free software;
* you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation;
* either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
* You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>
**/
$aLang = [
'charset' => 'UTF-8',
// das hier wird nicht mehr benötigt, aber ich lasse es drin, falls doch
// leserliche Namen fĂĽr product list performance (GA)
'VT_GTM_EE_productList' => 'Category',
'VT_GTM_EE_searchList' => 'Search',
'VT_GTM_EE_cross' => 'Crossselling',
'VT_GTM_EE_accessories' => 'Accessories',
'VT_GTM_EE_last' => 'Last Seen',
'VT_GTM_EE_bargainItems' => 'Offer of the Week',
'VT_GTM_EE_newItems' => 'Just Arrived',
'VT_GTM_EE_topBox' => 'Topseller',
// ab hier wird wieder benötigt
// Dimensionen im checkout
'VT_GTM_EE_LOGINOPTION' => 'Existing Customer',
'VT_GTM_EE_LOGINOPTION1' => 'Guest',
'VT_GTM_EE_LOGINOPTION2' => 'Existing Customer',
'VT_GTM_EE_LOGINOPTION3' => 'New Customer'
];

View File

@ -1,16 +1,16 @@
<?php
/*
* vanilla-thunder/oxid-module-gtm
* Google Tag Manager Integration for OXID eShop v6.2+
/**
* This Software is the property of Data Development and is protected
* by copyright law - it is NOT Freeware.
* Any unauthorized use of this software without a valid license
* is a violation of the license agreement and will be prosecuted by
* civil and criminal law.
* http://www.shopmodule.com
*
* This program is free software;
* you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation;
* either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
* You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Daniel Seifert <support@shopmodule.com>
* @link http://www.oxidmodule.com
*/
$style = '<style type="text/css">
@ -25,22 +25,22 @@ input.confinput:hover {outline:3px solid #ff3600;}
</style>';
$aLang = [
'charset' => 'UTF-8',
'SHOP_MODULE_vt_gtm_sContainerID' => 'Container ID',
'SHOP_MODULE_GROUP_vt_gtm_settings' => 'Einstellungen',
'SHOP_MODULE_vt_gtm_blGA4enab' => 'GA4 Aktivieren',
'SHOP_MODULE_vt_gtm_blUAenabled' => 'UA Aktivieren',
'SHOP_MODULE_vt_gtm_blEnableDebug' => 'Debug-Modus aktivieren',
'SHOP_MODULE_d3_gtm_sContainerID' => 'Container ID',
'SHOP_MODULE_GROUP_d3_gtm_settings' => 'Einstellungen',
'SHOP_MODULE_d3_gtm_blGA4enab' => 'GA4 Aktivieren',
'SHOP_MODULE_d3_gtm_blUAenabled' => 'UA Aktivieren',
'SHOP_MODULE_d3_gtm_blEnableDebug' => 'Debug-Modus aktivieren',
// for cookie manager settings
'SHOP_MODULE_GROUP_vt_gtm_settings_cookiemanager' => 'Cookie Manager Einstellungen',
'SHOP_MODULE_vt_gtm_settings_hasOwnCookieManager' => 'Eigenen Cookie Manager nutzen?
'SHOP_MODULE_GROUP_d3_gtm_settings_cookiemanager' => 'Cookie Manager Einstellungen',
'SHOP_MODULE_d3_gtm_settings_hasOwnCookieManager' => 'Eigenen Cookie Manager nutzen?
<strong style="color: red">Hinweis (Fragezeichen) lesen!</strong>',
'HELP_SHOP_MODULE_vt_gtm_settings_hasOwnCookieManager' => 'Stellen Sie sicher, dass Sie ein Modul installiert haben,
'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_vt_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()}]
[{if $d3VtConfigObject->getConfigParam('vt_gtm_settings_hasOwnCookieManager')}]
[{if $oViewConf->blAcceptedCookie($d3VtConfigObject->getConfigParam('vt_gtm_settings_cookieName'))}]
[{if $d3VtConfigObject->getConfigParam('d3_gtm_settings_hasOwnCookieManager')}]
[{if $oViewConf->blAcceptedCookie($d3VtConfigObject->getConfigParam('d3_gtm_settings_cookieName'))}]
[{if $oViewConf->getGtmContainerId()}][{strip}]
<!-- Google Tag Manager -->
@ -16,7 +16,6 @@
})(window, document, 'script', 'dataLayer', '[{$oViewConf->getGtmContainerId()}]');
</script>
<!-- End Google Tag Manager -->
[{$oViewConf->triggerGA4events()}]
[{if $oViewConf->getTopActionClassName() === "alist" }]
[{* include file="ga4_view_item_list.tpl" gtmCategory=$oView->getActiveCategory() gtmProducts=$oView->getArticleList() listtype=$oView->getListType() *}]
[{elseif $oViewConf->getTopActionClassName() === "details" }]
@ -46,7 +45,6 @@
})(window, document, 'script', 'dataLayer', '[{$oViewConf->getGtmContainerId()}]');
</script>
<!-- End Google Tag Manager -->
[{$oViewConf->triggerGA4events()}]
[{if $oViewConf->getTopActionClassName() === "alist" }]
[{* include file="ga4_view_item_list.tpl" gtmCategory=$oView->getActiveCategory() gtmProducts=$oView->getArticleList() listtype=$oView->getListType() *}]
[{elseif $oViewConf->getTopActionClassName() === "details" }]

View File

@ -11,7 +11,7 @@
'ecommerce': {
'actionField': "step: 1",
'currency': "[{$currency->name}]",
'value': [{$oxcmp_basket->getBruttoSum()}],
'value': [{oxprice price=$oxcmp_basket->getPrice()}],
'items': [
[{foreach from=$oxcmp_basket->getContents() item=basketitem name=gtmCartContents key=basketindex}]
[{assign var='_price' value=$basketitem->getUnitPrice()}]

View File

@ -8,7 +8,7 @@
'checkout': {
'actionField': {
'step': 2,
'option':'[{oxmultilang ident="VT_GTM_EE_LOGINOPTION"|cat:$oView->getLoginOption()}]'
'option':'[{oxmultilang ident="vt_GTM_EE_LOGINOPTION"|cat:$oView->getLoginOption()}]'
}
}
}

View File

@ -3,6 +3,7 @@
[{*$gtmProduct|get_class_methods|dumpvar*}]
[{capture assign=d3_ga4_add_to_cart}]
[{block name="d3_ga4_add_to_basket"}]
$("#toBasket").click(function(event) {
[{*event.preventDefault();*}]
@ -38,7 +39,7 @@
}
});
});
[{/block}]
[{/capture}]
[{oxscript add=$d3_ga4_add_to_cart}]

View File

@ -4,27 +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/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased](https://git.d3data.de/D3Public/MyModule/compare/1.1.0.0...rel_1.x)
## [1.1.0.0](https://git.d3data.de/D3Public/MyModule/compare/1.0.0.0...1.1.0.0) - 2022-07-26
## [2.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.0...2.1) - 2023-01-27
### Added
- another feature
- block section for add_to_basket js
- template block order positions
### Changed
- changed old code
### Deprecated
- ...
### Removed
- ...
### Fixed
- ...
### Security
- ...
## [1.0.0.0](https://git.d3data.de/D3Public/MyModule/releases/tag/1.0.0.0) - 2022-07-25
## [2.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.1...2.0) - 2023-01-20
### Added
- implemented features
- using of ContainerFactory in ViewConfig
## [1.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.0...1.1) - 2023-01-27
### Added
- block section for add_to_basket js
- template block order positions
## [1.0](https://git.d3data.de/D3Public/GoogleAnalytics4/releases/tag/1.0) - 2023-01-20
### Added
- publication of app features

51
Docs/README.md Normal file
View File

@ -0,0 +1,51 @@
## Technische Doku
### GA4 Events / Customizing
FĂĽr alle implementierten GA4 Events existieren Templates unter `source/modules/d3/googleanalytics4/Application/views/ga4/`, dabei entspricht der Dateiname dem Eventnamen in GA4.
Die Einbindung dieser Event-Templates erfolgt über TPL-Blöcke unter `source/modules/d3/googleanalytics4/Application/views/blocks/`.
*Hinweis: nicht alle templates sind bereits gefĂĽllt. WĂĽnschen Sie die Implementierung eines unausgefĂĽllten templates?
Kommen Sie auf uns zu unter https://www.d3data.de/
### Blöcke
Für den geregelten Ablauf sind folgende Blöcke nötig:
- Suchergebnisse
- Blockname: search_results
- Datei: page/search/search.tpl
- GA4 Event: view_search_results
- Artikelliste
- Blockname: d3Ga4_view_item_list (muss hinzugefĂĽgt werden)
- Datei: widget/product/list.tpl
- GA4 Event: view_item_list
- Detailseite
- Blockname: details_productmain_title
- Datei: page/details/inc/productmain.tpl
- GA4 Event: view_item
- dem WK hinzufĂĽgen (button)
- Blockname: details_productmain_tobasket
- Datei: page/details/inc/productmain.tpl
- GA4 Event: add_to_cart
- Warenkorb
- Blockname: checkout_basket_main
- Datei: page/checkout/basket.tpl
- GA4 Event: view_cart
- abgeschlossener Kauf
- Blockname: checkout_thankyou_main
- Datei: page/checkout/thankyou.tpl
- GA4 Event: purchase
### VerfĂĽgbare Datalayer Variablen
FĂĽr die einfachste Ăśbersicht der enthaltenen Daten empfehle ich den Vorschau-Modus vom Google Tag Manager.
Bei jedem Seitenaufruf wird die Datenschicht mit einigen wenigen Infos erstellt, die man zum reinen Erfassen der Seitenaufrufe benötigt:
+ **page.type** - Seitentyp: default / cms / product / listing / checkout (an google analytics angelehnt)
+ **page.title** - Seitentitel (auĂźer Startseite, sie hat keinen Titel)
+ **page.cl** - OXID Controller Klasse (start, search, etc)
+ **userid** - oxId vom Benutzer bzw `false` falls nicht eingeloggt
+ **sessionid** - session iD
Alle fĂĽr Ecommerce Tracking relevanten Daten werden mit speziellen Ecommerce Events in die Datenschicht eingefĂĽgt.
### Cookie-Handling
Sie nutzen einen eigenen, als Modul im Shop installierten, Cookie-manager?
Dann tragen Sie in den Folgeeinstellungen unter "Cookie Manager Einstellungen",
die Cookie-ID des zugehörigen Cookies ein. Und aktivieren Sie diese Weiche,
indem Sie den Haken bei "Eigenen Cookie Manager nutzen?" setzen.

View File

@ -1,24 +1,19 @@
<?php
/*
* vanilla-thunder/oxid-module-gtm
* Google Tag Manager Integration for OXID eShop v6.2+
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* This program is free software;
* you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation;
* either version 3 of the License, or (at your option) any later version.
* https://www.d3data.de
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
* You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
namespace D3\GoogleAnalytics4\Modules\Core;
use OxidEsales\Eshop\Application\Controller\FrontendController;
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
{
@ -33,7 +28,7 @@ class ViewConfig extends ViewConfig_parent
$this->sContainerId = ContainerFactory::getInstance()
->getContainer()
->get(ModuleSettingBridgeInterface::class)
->get('vt_gtm_sContainerID', 'vt-gtm');
->get('d3_gtm_sContainerID', 'd3googleanalytics4');
}
return $this->sContainerId;
}
@ -47,7 +42,7 @@ class ViewConfig extends ViewConfig_parent
$this->sContainerId = ContainerFactory::getInstance()
->getContainer()
->get(ModuleSettingBridgeInterface::class)
->get('vt_gtm_blEnableGA4', 'vt-gtm');
->get('d3_gtm_blEnableGA4', 'd3googleanalytics4');
}
return $this->blGA4enabled;
@ -60,7 +55,6 @@ class ViewConfig extends ViewConfig_parent
$oConfig = Registry::getConfig();
$oView = $oConfig->getTopActiveView();
/** @var FrontendController $oShop */
//$oShop = oxRegistry::getConfig()->getActiveShop(); /** @var oxShop $oShop */
$oUser = $oConfig->getUser();
$cl = $this->getTopActionClassName();
@ -88,37 +82,6 @@ class ViewConfig extends ViewConfig_parent
];
return json_encode([$dataLayer], JSON_PRETTY_PRINT);
unset($dataLayer["user"]["http"]); // das brauchen wir hier nicht
return json_encode([$dataLayer], JSON_PRETTY_PRINT);
/*
// --- Produktdaten ---
$transactionProducts = [];
foreach($oOrder->getOrderArticles() as $_prod ) $transactionProducts[] = [
'name' => '', // (erforderlich) Produktname String
'sku' => '', // (erforderlich) Produkt-SKU String
'category' => '', // (optional) Produktkategorie String
'price' => '', // (erforderlich) Preis pro Einheit Numerischer Wert
'quantity' => '' // (erforderlich) Anzahl der Artikel Numerischer Wert
];
// --- Transaktionsdaten ---
$dataLayer['transactionId'] = $oOrder->oxorder__oxordernr->value; // (erforderlich) Eindeutige Transaktionskennung String
$dataLayer['transactionAffiliation'] = $oShop->oxshops__oxname->value; // (optional) Partner oder Geschäft String
$dataLayer['transactionTotal'] = $oOrder->oxorder__oxtotalordersum->value; // (erforderlich) Gesamtwert der Transaktion Numerischer Wert
$dataLayer['transactionShipping'] = $oOrder->oxorder__oxdelcost->value; // (optional) Versandkosten fĂĽr die Transaktion Numerischer Wert
$dataLayer['transactionTax'] = ''; // (optional) Steuerbetrag fĂĽr die Transaktion Numerischer Wert
$dataLayer['transactionProducts'] = $transactionProducts; // (optional) Liste der bei der Transaktion erworbenen Artikel Array von Produktobjekten
*/
}
public function triggerGA4events()
{
// general events
}
public function isPromotionList($listId)

View File

@ -20,27 +20,10 @@ WeiterfĂĽhrende Informationen: https://developers.google.com/analytics/devguides
Dieses Paket erfordert einen mit Composer installierten OXID eShop in einer in der [composer.json](composer.json) definierten Version.
Bitte tragen Sie den folgenden Abschnitt in die `composer.json` Ihres Projektes ein:
```
"extra": {
"oxideshop": {
"blacklist-filter": [
"*.md",
"composer.json",
".php-cs-fixer.php",
"*.xml",
"*.neon"
],
"target-directory": "d3/googleanalytics"
}
```
Ă–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
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.
@ -48,7 +31,7 @@ Sofern nötig, bestätigen Sie bitte, dass Sie `package-name` erlauben, Code aus
Aktivieren Sie das Modul im Shopadmin unter "Erweiterungen -> Module".
## Verwendung
### Grundfunktionalität
Nach erfolgreicher Installation finden Sie in Ihrem Shop-Admin unter "Erweiterungen > Module"
den Eintrag 'Google Analytics 4'.
Aktivieren Sie dieses Modul, um die Funktionalitäten nutzen zu können.
@ -58,11 +41,10 @@ Tragen Sie die nötige sog. 'Container ID' ein. Diese sieht in etwa so aus: 'GTM
Aktivieren Sie GA4 selbst, indem Sie dieses direkt darunter anhaken.
---
### Technische Infos
- Navigieren Sie bitte zur [technischen Doku](./Docs/README.md)
Sie nutzen einen eigenen, als Modul im Shop installierten, Cookie-manager? Dann tragen Sie in den Folgeeinstellungen
unter "Cookie Manager Einstellungen", die Cookie-ID des zugehörigen Cookies ein. Und aktivieren Sie diese Weiche,
indem Sie den Haken bei "Eigenen Cookie Manager nutzen?" setzen.
---
## Changelog
@ -89,8 +71,11 @@ Copyright (c) D3 Data Development (Inh. Thomas Dartsch)
Diese Software wird unter der GNU GENERAL PUBLIC LICENSE Version 3 vertrieben.
```
Die vollständigen Copyright- und Lizenzinformationen entnehmen Sie bitte der [LICENSE](LICENSE.md)-Datei, die mit diesem Quellcode verteilt wurde.
Die vollständigen Copyright- und Lizenzinformationen entnehmen Sie bitte der [LICENSE](LICENSE)-Datei, die mit diesem Quellcode verteilt wurde.
## weitere Lizenzen und Nutzungsbedingungen
## Credits
Zu diesem Modul haben beigetragen:
...
- [Marat Bedoev](https://github.com/vanilla-thunder)
Vielen Dank.

View File

@ -1,67 +0,0 @@
# [D3] Google Tag Manager
Google Tag Manager integration for OXID eShop v6.x
## Installation
* ``composer require vanilla-thunder/oxid-module-gtm --no-update``
* Modul aktivieren und Moduleinstellungen konfigurieren
## Tag Manager konfigurieren:
+ https://support.google.com/tagmanager/answer/9442095
## Google Analytics 4 Einrichtung
## GA4 Events / Customizing
fĂĽr alle implementierten GA4 Events existieren Templates unter `source/modules/GoogleTagManager/Application/views/ga4/`, dabei entspricht der Dateiname dem Eventnamen in GA4.
Die Einbindung dieser Event-Templates erfolgt über TPL-Blöcke unter `source/modules/GoogleTagManager/Application/views/blocks/`.
### aktuell zu beachtende Blöcke
- Suchergebnisse: search_results
- (muss hinzugefĂĽgt werden) aList: d3Ga4_view_item_list
- Detailseite: details_productmain_title
- add_to_basket-button: details_productmain_tobasket
- Warenkorb: checkout_basket_main
- Purchase | abgeschlossener Kauf: checkout_thankyou_main
## Universal Analytics Events
**"EE-Trigger" fĂĽr Ecomemrce-Tags (Beispiel fĂĽr Google Tag Manager):**
+ Triggertyp: Benutzerdefiniertes Ereignis
+ Ereignisname: ``ee\..*``
+ Übereinstimmung mit regulärem Ausdruck verwenden
+ Diesen Trigger auslösen bei: Alle benutzerdefinierten Ereignisse
**"EE-Tag" fĂĽr Google Analytics Enhanced Ecommerce:**
+ Tag-Typ: Google Analytics - Universal Analytics
+ Tracking-Typ: Ereignis
+ Aktion: {{Event}}
+ Label: {{Event Label}}
+ Trigger : EE-Trigger
## VerfĂĽgbare Datalayer Variablen
FĂĽr die einfachste Ăśbersicht der enthaltenen Daten empfehle ich den Vorschau-Modus vom Google Tag Manager.
Bei jedem Seitenaufruf wird die Datenschicht mit einigen wenigen Infos erstellt, die man zum reinen Erfassen der Seitenaufrufe benötigt:
+ **page.type** - Seitentyp: default / cms / product / listing / checkout (an google analytics angelehnt)
+ **page.title** - Seitentitel (auĂźer Startseite, sie hat keinen Titel. Danke OXID...)
+ **page.cl** - OXID Controller Klasse (start, search, etc)
+ **userid** - oxID vom Benutzer bzw `false` falls nicht eingeloggt
+ **sessionid** - session iD
Alle fĂĽr Ecommerce Tracking releavanten Daten werden mit speziellen Ecommerce Events in die Datenschicht eingefĂĽgt.
Hier ist ein Beispiel fĂĽr die Einrichtung von Enhanced Ecomemrce Tracking ĂĽber Google Tag Manager:
### LICENSE AGREEMENT
[vt] google-tag-manager
Copyright (C) 2021 Marat Bedoev
info: info@mb-dev.pro oder so /** @todo: ĂĽberarbeiten, wenn ich wieder nĂĽchtern bin */
This program is free software;
you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation;
either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, see <http://www.gnu.org/licenses/>

View File

@ -1,6 +1,4 @@
<?php
use D3\GoogleAnalytics4\Modules\Core\ViewConfig;
use OxidEsales\Eshop\Core\ViewConfig as OEViewConfig;
@ -19,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>
",
'thumbnail' => 'thumbnail.png',
'version' => '2.0.0.0',
'version' => '2.1.0',
'author' => 'Data Development (Inh.: Thomas Dartsch)',
'email' => 'support@shopmodule.com',
'url' => 'https://www.oxidmodule.com/',
@ -45,12 +43,6 @@ $aModule = [
'ga4_view_item.tpl' => 'd3/googleanalytics4/Application/views/ga4/view_item.tpl',
'ga4_view_item_list.tpl' => 'd3/googleanalytics4/Application/views/ga4/view_item_list.tpl',
'ga4_view_promotion.tpl' => 'd3/googleanalytics4/Application/views/ga4/view_promotion.tpl',
/*
'gtm_ua_impression' => 'vt/GoogleTagManager/Application/views/ua/impression.tpl'
'gtm_view_promotion.tpl' => 'vt/GoogleTagManager/Application/views/view_promotion.tpl',
'gtm_select_promotion.tpl' => 'vt/GoogleTagManager/Application/views/select_promotion.tpl',
'gtm_begin_checkout.tpl' => 'vt/GoogleTagManager/Application/views/begin_checkout.tpl',
*/
],
'blocks' => [
// tag manager js
@ -65,12 +57,6 @@ $aModule = [
'block' => 'theme_svg_icons',
'file' => '/Application/views/blocks/_gtm_nojs.tpl'
],
// add to cart
[
'template' => 'layout/header.tpl',
'block' => 'header_main',
'file' => '/Application/views/blocks/add_to_cart.tpl'
],
// widget_product_list
[
'template' => 'widget/product/list.tpl',
@ -125,53 +111,56 @@ $aModule = [
[
'template' => 'widget/product/list.tpl',
'block' => 'd3Ga4_view_item_list',
'file' => '/Application/views/ga4/view_item_list.tpl'
'file' => '/Application/views/ga4/view_item_list.tpl',
'position' => 150
],
// view_search_result
[
'template' => 'page/search/search.tpl',
'block' => 'search_results',
'file' => '/Application/views/ga4/search.tpl'
'file' => '/Application/views/ga4/search.tpl',
'position' => 150
],
// add_to_cart
[
'template' => 'page/details/inc/productmain.tpl',
'block' => 'details_productmain_tobasket',
'file' => '/Application/views/ga4/add_to_cart.tpl'
'file' => '/Application/views/ga4/add_to_cart.tpl',
'position' => 150
]
],
'settings' => [
[
'group' => 'vt_gtm_settings',
'name' => 'vt_gtm_sContainerID',
'group' => 'd3_gtm_settings',
'name' => 'd3_gtm_sContainerID',
'type' => 'str',
'value' => 'GTM-',
'position' => 0
],
[
'group' => 'vt_gtm_settings',
'name' => 'vt_gtm_blGA4enab',
'group' => 'd3_gtm_settings',
'name' => 'd3_gtm_blGA4enab',
'type' => 'bool',
'value' => true,
'position' => 1
],
[
'group' => 'vt_gtm_settings',
'name' => 'vt_gtm_blEnableDebug',
'group' => 'd3_gtm_settings',
'name' => 'd3_gtm_blEnableDebug',
'type' => 'bool',
'value' => false,
'position' => 999
],
[
'group' => 'vt_gtm_settings_cookiemanager',
'name' => 'vt_gtm_settings_hasOwnCookieManager',
'group' => 'd3_gtm_settings_cookiemanager',
'name' => 'd3_gtm_settings_hasOwnCookieManager',
'type' => 'bool',
'value' => false,
'position' => 999
],
[
'group' => 'vt_gtm_settings_cookiemanager',
'name' => 'vt_gtm_settings_cookieName',
'group' => 'd3_gtm_settings_cookiemanager',
'name' => 'd3_gtm_settings_cookieName',
'type' => 'str',
'value' => 'example',
'position' => 999