add cookieManager switch
Cette révision appartient à :
Parent
633c1336a8
révision
a74b6d9f15
@ -32,4 +32,17 @@ $aLang = [
|
||||
'SHOP_MODULE_vt_gtm_sMpapisecret' => 'Map ist Geheim??',
|
||||
'SHOP_MODULE_vt_gtm_aPromotionlistIDs' => 'Promotion Produktlisten IDs <div>Weitere Infos zu dieser Einstellung: <b><u><a href="https://github.com/vanilla-thunder/oxid-module-gtm/wiki/Promotion-Produktlisten" target="_blank">Modui-Wiki</a></u></b></div>',
|
||||
'SHOP_MODULE_vt_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?
|
||||
<strong style="color: red">Hinweis (Fragezeichen) lesen!</strong>',
|
||||
'HELP_SHOP_MODULE_vt_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>
|
||||
|
||||
Diese Möglichkeit zu aktivieren, <u>ohne dem nötigen technischen Wissen</u> kann den Shop-Ablauf (Frontend) stören.<hr>
|
||||
Diese Möglichkeit kann vernachlässigt werden, sofern die Cookies beispielsweise direkt via Google handhabt werden.
|
||||
Bei Fragen <u>kontaktieren Sie bitte</u> auch hier einen entsprechenden technischen Ansprechpartner.',
|
||||
'SHOP_MODULE_vt_gtm_settings_cookieName' => 'Cookie-Name',
|
||||
];
|
||||
|
@ -1,25 +1,57 @@
|
||||
[{if $oViewConf->getGtmContainerId()}][{strip}]
|
||||
<!-- Google Tag Manager -->
|
||||
<script>
|
||||
var dataLayer = [{$oViewConf->getGtmDataLayer()}] || [];
|
||||
(function (w, d, s, l, i) {
|
||||
[{assign var="d3VtConfigObject" value=$oViewConf->getConfig()}]
|
||||
[{if $d3VtConfigObject->getConfigParam('vt_gtm_settings_hasOwnCookieManager')}]
|
||||
[{if $oViewConf->blAcceptedCookie($d3VtConfigObject->getConfigParam('vt_gtm_settings_cookieName'))}]
|
||||
|
||||
[{if $oViewConf->getGtmContainerId()}][{strip}]
|
||||
<!-- Google Tag Manager -->
|
||||
<script>
|
||||
var dataLayer = [{$oViewConf->getGtmDataLayer()}] || [];
|
||||
(function (w, d, s, l, i) {
|
||||
w[l] = w[l] || [];
|
||||
w[l].push({'gtm.start': new Date().getTime(), event: 'gtm.js'});
|
||||
var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : '';
|
||||
j.async = true;
|
||||
j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
|
||||
f.parentNode.insertBefore(j, f);
|
||||
})(window, document, 'script', 'dataLayer', '[{$oViewConf->getGtmContainerId()}]');
|
||||
})(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" }]
|
||||
[{* include file="ga4_view_item.tpl" gtmProduct=$oView->getProduct() *}]
|
||||
[{elseif $oViewConf->getTopActionClassName() === "search" }]
|
||||
[{elseif $oViewConf->getTopActionClassName() === "basket" }]
|
||||
|
||||
[{/if}]
|
||||
[{/strip}][{/if}]
|
||||
[{/if}]
|
||||
[{else}]
|
||||
[{if $oViewConf->getGtmContainerId()}][{strip}]
|
||||
<!-- Google Tag Manager -->
|
||||
<script>
|
||||
var dataLayer = [{$oViewConf->getGtmDataLayer()}] || [];
|
||||
(function (w, d, s, l, i) {
|
||||
w[l] = w[l] || [];
|
||||
w[l].push({'gtm.start': new Date().getTime(), event: 'gtm.js'});
|
||||
var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : '';
|
||||
j.async = true;
|
||||
j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
|
||||
f.parentNode.insertBefore(j, f);
|
||||
})(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() *}]
|
||||
[{* include file="ga4_view_item_list.tpl" gtmCategory=$oView->getActiveCategory() gtmProducts=$oView->getArticleList() listtype=$oView->getListType() *}]
|
||||
[{elseif $oViewConf->getTopActionClassName() === "details" }]
|
||||
[{* include file="ga4_view_item.tpl" gtmProduct=$oView->getProduct() *}]
|
||||
[{* include file="ga4_view_item.tpl" gtmProduct=$oView->getProduct() *}]
|
||||
[{elseif $oViewConf->getTopActionClassName() === "search" }]
|
||||
[{elseif $oViewConf->getTopActionClassName() === "basket" }]
|
||||
|
||||
[{/if}]
|
||||
[{/strip}][{/if}]
|
||||
[{/strip}][{/if}]
|
||||
[{/if}]
|
||||
|
||||
[{$smarty.block.parent}]
|
||||
|
17
metadata.php
17
metadata.php
@ -182,7 +182,20 @@ $aModule = [
|
||||
'type' => 'bool',
|
||||
'value' => false,
|
||||
'position' => 999
|
||||
]
|
||||
|
||||
],
|
||||
[
|
||||
'group' => 'vt_gtm_settings_cookiemanager',
|
||||
'name' => 'vt_gtm_settings_hasOwnCookieManager',
|
||||
'type' => 'bool',
|
||||
'value' => false,
|
||||
'position' => 999
|
||||
],
|
||||
[
|
||||
'group' => 'vt_gtm_settings_cookiemanager',
|
||||
'name' => 'vt_gtm_settings_cookieName',
|
||||
'type' => 'str',
|
||||
'value' => 'example',
|
||||
'position' => 999
|
||||
],
|
||||
]
|
||||
];
|
Chargement…
Référencer dans un nouveau ticket
Block a user