espacious Posted December 11, 2018 Share Posted December 11, 2018 Pozdravljeni, nikakor mi ne uspe vstaviti GTM (google Tag Manager) kode v order-confirmation.tpl, v header in body sem vstavil potrebno kodo za povezavo GTM in to deluje. Prilagam screenshoot-e. Zatakne se mi pri delu kode "dataLayer" katerega naj bi vstavil v order-confirmation.tpl, nikakor mi ne usepe zaobjeti kode v {literal} koda... {/literal} Pripenjam 3 primere katere sem preizkusil, vsaka pomoč dobrodošla. Hvala <!-- Google Tag Manager – dataLayer --> {if isset($page_name) && $page_name|escape:'html':'UTF-8' == "order-confirmation"} <script type="text/javascript"> window.dataLayer = window.dataLayer || [] dataLayer.push({ldelim} 'transactionId': '{$id_order}', 'transactionTotal': {$total_paid_tax_incl}, 'transactionProducts': [ {foreach from=$products item=product} {ldelim} // List of productFieldObjects. 'sku': '{$product.id}', 'name': '{$product.name}', // Name or ID is required. //'category': '{$product.X}', 'price': {$product.price}, 'quantity': 1 // Optional fields may be omitted or set to empty string. {rdelim} {if !$smarty.foreach.product.last},{/if} {/foreach} ] {rdelim}); </script> {/if} <!-- End Google Tag Manager – dataLayer --> <!-- Google Tag Manager – dataLayer --> {literal} <script type="text/javascript"> window.dataLayer = window.dataLayer || []; dataLayer.push({ 'transactionId': {$id_order}, 'transactionTotal': {$transaction_total}, 'transactionTax': {$tax}, 'transactionShipping': {$shipping_total}, 'transactionProducts': {foreach from=$products item=product name=products} { 'sku': {$product.id_product}, 'name': {$product.name}, 'price': {$product.price_wt}, 'quantity': {$product.quantity} } {if $smarty.foreach.products.iteration != $products|@count}, {/if} {/foreach}, 'event': 'transactionComplete' }) </script> {/literal} <!-- End Google Tag Manager – dataLayer --> <!-- Google Tag Manager – dataLayer --> {literal} <script type="text/javascript"> window.dataLayer = window.dataLayer || []; dataLayer.push({ 'ecommerce': { 'purchase': { 'actionField': { 'id': '{$id_order}', 'affiliation': '', 'revenue': '{$transaction_total}', 'tax': '{$tax}', 'shipping': '{$shipping_total}', 'coupon': '' }, 'products': {foreach from=$products item=product name=products} { 'name': '{$product.name}', 'id': '{$product.id_product}', 'price': '{$product.price_wt}', 'brand': '{$products.manufacturer_name}', 'category': '{$product.category}', 'variant': '', 'quantity': '{$product.quantity}', 'coupon': '' } {if $smarty.foreach.products.iteration != $products|@count}, {/if} {/foreach} } } }); </script> {/literal} <!-- End Google Tag Manager – dataLayer --> Prilagam še povezave s katerih sem črpal: https://www.initcoms.com/blog/como-utilizar-google-tag-manager-en-prestashop/ https://canonicalized.com/enhanced-ecommerce-tag-manager/?section=start-off-right Link to comment Share on other sites More sharing options...
malcek Posted December 11, 2018 Share Posted December 11, 2018 kupiš tale modul in imaš urejeno vse kar potrebuješ https://addons.prestashop.com/en/analytics-statistics/27146-premium-google-tag-manager.html Link to comment Share on other sites More sharing options...
malcek Posted December 11, 2018 Share Posted December 11, 2018 meni delajo vse kode brez problemov Link to comment Share on other sites More sharing options...
espacious Posted December 11, 2018 Author Share Posted December 11, 2018 Ok to mi je blo jasno ja. No vsekakor bi mi koristil tudi ročni način, glede modula pa ali imaš/imate idejo kateri bi bil najboljši oz. z nejveč uporabnimi funkcijami? (Recimo ročno dodajanje ali brisanje transakcij itd ...) Link to comment Share on other sites More sharing options...
espacious Posted December 11, 2018 Author Share Posted December 11, 2018 (edited) Kako imaš pa spisan del kode ki je v order-confirmation.tpl? Vse kode misliš z pluginom ali si probal moje kode ki sem jih prilepil? Ker namreč tudi meni povezava deluje za vse le dataLayer-ja nikakor ne uspem zrihtat. Edited December 11, 2018 by espacious (see edit history) Link to comment Share on other sites More sharing options...
malcek Posted December 11, 2018 Share Posted December 11, 2018 jaz uporabljam tega prilepljenega in dela OK, tudi preklicane naročila zabeleži. Problem je edino odkar je gdpr v veljavi, ker imamo seveda tehnično tudi urejen GDPR in če se ne strinja z namestitvijo piškotkov, potem tega naročila/preklica ne zabeleži. Link to comment Share on other sites More sharing options...
espacious Posted December 11, 2018 Author Share Posted December 11, 2018 Aha ok bom malo pogledal oz nabavil kar tega ki priporočste, ampak še vedno bi rad vedel kako ročno vstaviti kodo. Glede GDPR in piškotkov pa je logično ja, lahko pa bi se tiste piškotke smatralo kot obvezne, tako da jih stranka pač nemore izklopit, ter se to zapiše v TOS. Link to comment Share on other sites More sharing options...
malcek Posted December 11, 2018 Share Posted December 11, 2018 ja, to že vem, samo potem moraš vse ločevat, in FB pixel in druge stvari, tako pa imaš na enem mestu vse kode in če se strinja potem se beleži, če se ne strinja se ne beleži. sam sem se nehal obremenjevati z to statistiko, ker sem potem cele dneve gledal samo v to, namesto, da bi se ukvarjal z pomembnejšimi stvarmi Link to comment Share on other sites More sharing options...
espacious Posted December 11, 2018 Author Share Posted December 11, 2018 Ja res je se strinjam, toda v marketingu zelo radi gledajo v te grafe po drugi strani pa ja je potrebno ločit cooki-je ja. Za sedaj imam tudi jaz tako rešeno ali sprejme ali ne. Link to comment Share on other sites More sharing options...
gregor5 Posted December 17, 2018 Share Posted December 17, 2018 Jaz sem namestil tega (sicer na v1.6 PS, vendar dela tudi n 1.7): https://addons.prestashop.com/en/analytics-statistics/23806-google-tag-manager-enhanced-ecommerce-ua-pro.html Dela super... nobenih problemov. Link to comment Share on other sites More sharing options...
espacious Posted December 18, 2018 Author Share Posted December 18, 2018 Sem nabavil dela odlično ni vredno peš delat dataLayer-ja ker ima modul še dodatne funkcije ter je res lepo urejen (predvsem mi je všeč da imajo komplet datoteko tudi za uvoz variable, triggers... v GTM) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now