Tracciamento transazione _trackTrans
-
Ciao a tutti, vorrei tracciare la conversione in fase di checkout tramite la funzione _trackTrans.
Nelal paittaforma che sto utilizzando ho un problema nella modifica dell'header in singole sezioni, in pratica nella documentazione di google si cita questo codice:
[COLOR=#000000][FONT=inherit]_gaq[/FONT][/COLOR][COLOR=#666600][FONT=inherit].[/FONT][/COLOR][COLOR=#000000][FONT=inherit]push[/FONT][/COLOR][COLOR=#666600][FONT=inherit]([[/FONT][/COLOR][COLOR=#008800][FONT=inherit]'_setAccount'[/FONT][/COLOR][COLOR=#666600][FONT=inherit],[/FONT][/COLOR][COLOR=#008800][FONT=inherit]'UA-XXXXX-X'[/FONT][/COLOR][COLOR=#666600][FONT=inherit]]);[/FONT][/COLOR] [COLOR=#000000][FONT=inherit]_gaq[/FONT][/COLOR][COLOR=#666600][FONT=inherit].[/FONT][/COLOR][COLOR=#000000][FONT=inherit]push[/FONT][/COLOR][COLOR=#666600][FONT=inherit]([[/FONT][/COLOR][COLOR=#008800][FONT=inherit]'_trackPageview'[/FONT][/COLOR][COLOR=#666600][FONT=inherit]]);[/FONT][/COLOR][COLOR=#000000][FONT=inherit] _gaq[/FONT][/COLOR][COLOR=#666600][FONT=inherit].[/FONT][/COLOR][COLOR=#000000][FONT=inherit]push[/FONT][/COLOR][COLOR=#666600][FONT=inherit]([[/FONT][/COLOR][COLOR=#008800][FONT=inherit]'_addTrans'[/FONT][/COLOR][COLOR=#666600][FONT=inherit],[/FONT][/COLOR][COLOR=#000000][FONT=inherit] [/FONT][/COLOR][COLOR=#008800][FONT=inherit]'1234'[/FONT][/COLOR][COLOR=#666600][FONT=inherit],[/FONT][/COLOR][COLOR=#880000][FONT=inherit]// transaction ID - required[/FONT][/COLOR][COLOR=#000000][FONT=inherit] [/FONT][/COLOR][COLOR=#008800][FONT=inherit]'Womens Apparel'[/FONT][/COLOR][COLOR=#666600][FONT=inherit],[/FONT][/COLOR][COLOR=#880000][FONT=inherit]// affiliation or store name[/FONT][/COLOR][COLOR=#000000][FONT=inherit] [/FONT][/COLOR][COLOR=#008800][FONT=inherit]'28.28'[/FONT][/COLOR][COLOR=#666600][FONT=inherit],[/FONT][/COLOR][COLOR=#880000][FONT=inherit]// total - required[/FONT][/COLOR][COLOR=#000000][FONT=inherit] [/FONT][/COLOR][COLOR=#008800][FONT=inherit]'1.29'[/FONT][/COLOR][COLOR=#666600][FONT=inherit],[/FONT][/COLOR][COLOR=#880000][FONT=inherit]// tax[/FONT][/COLOR][COLOR=#000000][FONT=inherit] [/FONT][/COLOR][COLOR=#008800][FONT=inherit]'15.00'[/FONT][/COLOR][COLOR=#666600][FONT=inherit],[/FONT][/COLOR][COLOR=#880000][FONT=inherit]// shipping[/FONT][/COLOR][COLOR=#000000][FONT=inherit] [/FONT][/COLOR][COLOR=#008800][FONT=inherit]'San Jose'[/FONT][/COLOR][COLOR=#666600][FONT=inherit],[/FONT][/COLOR][COLOR=#880000][FONT=inherit]// city[/FONT][/COLOR][COLOR=#000000][FONT=inherit] [/FONT][/COLOR][COLOR=#008800][FONT=inherit]'California'[/FONT][/COLOR][COLOR=#666600][FONT=inherit],[/FONT][/COLOR][COLOR=#880000][FONT=inherit]// state or province[/FONT][/COLOR][COLOR=#000000][FONT=inherit] [/FONT][/COLOR][COLOR=#008800][FONT=inherit]'USA'[/FONT][/COLOR][COLOR=#880000][FONT=inherit]// country[/FONT][/COLOR][COLOR=#000000][FONT=inherit] [/FONT][/COLOR][COLOR=#666600][FONT=inherit]]);[/FONT][/COLOR][COLOR=#000000][FONT=inherit] _gaq[/FONT][/COLOR][COLOR=#666600][FONT=inherit].[/FONT][/COLOR][COLOR=#000000][FONT=inherit]push[/FONT][/COLOR][COLOR=#666600][FONT=inherit]([[/FONT][/COLOR][COLOR=#008800][FONT=inherit]'_addItem'[/FONT][/COLOR][COLOR=#666600][FONT=inherit],[/FONT][/COLOR][COLOR=#000000][FONT=inherit] [/FONT][/COLOR][COLOR=#008800][FONT=inherit]'1234'[/FONT][/COLOR][COLOR=#666600][FONT=inherit],[/FONT][/COLOR][COLOR=#880000][FONT=inherit]// transaction ID - necessary to associate item with transaction[/FONT][/COLOR][COLOR=#000000][FONT=inherit] [/FONT][/COLOR][COLOR=#008800][FONT=inherit]'DD44'[/FONT][/COLOR][COLOR=#666600][FONT=inherit],[/FONT][/COLOR][COLOR=#880000][FONT=inherit]// SKU/code - required[/FONT][/COLOR][COLOR=#000000][FONT=inherit] [/FONT][/COLOR][COLOR=#008800][FONT=inherit]'T-Shirt'[/FONT][/COLOR][COLOR=#666600][FONT=inherit],[/FONT][/COLOR][COLOR=#880000][FONT=inherit]// product name[/FONT][/COLOR][COLOR=#000000][FONT=inherit] [/FONT][/COLOR][COLOR=#008800][FONT=inherit]'Olive Medium'[/FONT][/COLOR][COLOR=#666600][FONT=inherit],[/FONT][/COLOR][COLOR=#880000][FONT=inherit]// category or variation[/FONT][/COLOR][COLOR=#000000][FONT=inherit] [/FONT][/COLOR][COLOR=#008800][FONT=inherit]'11.99'[/FONT][/COLOR][COLOR=#666600][FONT=inherit],[/FONT][/COLOR][COLOR=#880000][FONT=inherit]// unit price - required[/FONT][/COLOR][COLOR=#000000][FONT=inherit] [/FONT][/COLOR][COLOR=#008800][FONT=inherit]'1'[/FONT][/COLOR][COLOR=#880000][FONT=inherit]// quantity - required[/FONT][/COLOR][COLOR=#000000][FONT=inherit] [/FONT][/COLOR][COLOR=#666600][FONT=inherit]]);[/FONT][/COLOR][COLOR=#000000][FONT=inherit] [/FONT][/COLOR][COLOR=#000000][FONT=inherit]_gaq[/FONT][/COLOR][COLOR=#666600][FONT=inherit].[/FONT][/COLOR][COLOR=#000000][FONT=inherit]push[/FONT][/COLOR][COLOR=#666600][FONT=inherit]([[/FONT][/COLOR][COLOR=#008800][FONT=inherit]'_trackTrans'[/FONT][/COLOR][COLOR=#666600][FONT=inherit]]);[/FONT][/COLOR]Tralasciando al momento la parte _addItem vorrei inserire il tracciamento all'interno di body perchè posso solo modificare la template in body per la sezione checkout.
MI troverei quindi due codici di tracciamento:- in header il classico e completo codice di GA
- in body questo codice sopra dove chiaramente avviene un DOPPIO tracciamento.
Come posso risolvere?
Se nel <body> metto solo<script type="text/javascript"> _gaq.push(['_addTrans', '1234', // transaction ID - required 'Womens Apparel', // affiliation or store name ex Brand '28.28', // total - required; Shown as "Revenue" in the // Transactions report. Does not include Tax and Shipping. '1.29', // tax '15.00', // shipping 'San Jose', // city 'California', // state or province 'USA' // country ]); _gaq.push(['_trackTrans']); //submits transaction to the Analytics servers </script>Rischio (e ne sono quasi sicuro) che non tracci nulla perchè la funzione che esegue il tracking è in <head> o mi sbaglio io? ovvero:
[TABLE] [TR] [TD="class: webkit-line-content"] (function() {[/TD] [/TR] [TR] [TD="class: webkit-line-number"][/TD] [TD="class: webkit-line-content"] var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;[/TD] [/TR] [TR] [TD="class: webkit-line-number"][/TD] [TD="class: webkit-line-content"]... blablabla[/TD] [/TR] [TR] [TD="class: webkit-line-number"][/TD] [TD="class: webkit-line-content"];[/TD] [/TR] [/TABLE]Sapete aiutarmi?
Grazie dell'aiuto
Ciao! Sembra che tu sia interessato a questa conversazione, ma non hai ancora un account.
Stanco di dover scorrere gli stessi post a ogni visita? Quando registri un account, tornerai sempre esattamente dove eri rimasto e potrai scegliere di essere avvisato delle nuove risposte (tramite email o notifica push). Potrai anche salvare segnalibri e votare i post per mostrare il tuo apprezzamento agli altri membri della comunità.
Con il tuo contributo, questo post potrebbe essere ancora migliore 💗
Registrati Accedi