Compare commits
14 Commits
Author | SHA1 | Date | |
---|---|---|---|
3ff03ee0df | |||
09c1e31efe | |||
6d057971a7 | |||
0b134321ef | |||
b5d056fd83 | |||
410be2fb40 | |||
bd17c3370d | |||
d028f418ad | |||
cecbc0dec8 | |||
6a0fb759e1 | |||
120c765d0c | |||
4f73f18080 | |||
00f76d9908 | |||
306af0f7bd |
@ -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'
|
||||
|
||||
];
|
@ -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'
|
||||
];
|
@ -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',
|
||||
];
|
||||
|
@ -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" }]
|
||||
|
@ -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()}]
|
||||
|
@ -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()}]'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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}]
|
||||
|
||||
|
25
CHANGELOG.md
25
CHANGELOG.md
@ -4,27 +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).
|
||||
|
||||
## [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
|
||||
## [1.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.0...1.1) - 2023-01-27
|
||||
### Added
|
||||
- another feature
|
||||
- block section for add_to_basket js
|
||||
- template block order positions
|
||||
|
||||
### Changed
|
||||
- changed old code
|
||||
- switched price formatting
|
||||
|
||||
### Deprecated
|
||||
- ...
|
||||
|
||||
### Removed
|
||||
- ...
|
||||
|
||||
### Fixed
|
||||
- ...
|
||||
|
||||
### Security
|
||||
- ...
|
||||
|
||||
## [1.0.0.0](https://git.d3data.de/D3Public/MyModule/releases/tag/1.0.0.0) - 2022-07-25
|
||||
## [1.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.0...1.0) - 2023-01-20
|
||||
### Added
|
||||
- implemented features
|
||||
- publication of app features
|
51
Docs/README.md
Normal file
51
Docs/README.md
Normal 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.
|
@ -1,24 +1,20 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* vanilla-thunder/oxid-module-gtm
|
||||
* Google Tag Manager Integration for OXID eShop v6.2+
|
||||
*
|
||||
* 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/>
|
||||
/**
|
||||
* 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
|
||||
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
|
||||
* @author D3 Data Development - Daniel Seifert <support@shopmodule.com>
|
||||
* @link http://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
|
||||
{
|
||||
@ -30,7 +26,8 @@ class ViewConfig extends ViewConfig_parent
|
||||
{
|
||||
if ($this->sContainerId === null)
|
||||
{
|
||||
$this->sContainerId = $this->getConfig()->getConfigParam('vt_gtm_sContainerID');
|
||||
|
||||
$this->sContainerId = $this->getConfig()->getConfigParam('d3_gtm_sContainerID');
|
||||
}
|
||||
return $this->sContainerId;
|
||||
}
|
||||
@ -41,7 +38,7 @@ class ViewConfig extends ViewConfig_parent
|
||||
{
|
||||
if ($this->blGA4enabled === null)
|
||||
{
|
||||
$this->sContainerId = $this->getConfig()->getConfigParam('vt_gtm_blEnableGA4');
|
||||
$this->sContainerId = $this->getConfig()->getConfigParam('d3_gtm_blEnableGA4');
|
||||
}
|
||||
|
||||
return $this->blGA4enabled;
|
||||
@ -54,7 +51,7 @@ 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();
|
||||
@ -81,38 +78,7 @@ class ViewConfig extends ViewConfig_parent
|
||||
//'httpref' => $_SERVER["HTTP_REFERER"] ?? "unknown"
|
||||
];
|
||||
|
||||
#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)
|
||||
|
35
README.md
35
README.md
@ -20,25 +20,8 @@ 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
|
||||
```
|
||||
@ -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.
|
67
__README.md
67
__README.md
@ -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/>
|
45
metadata.php
45
metadata.php
@ -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' => '1.0.0.0',
|
||||
'version' => '1.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
|
||||
|
Loading…
Reference in New Issue
Block a user