I've followed tutorials by David, forum posts, but I can't get any conversion data. I've installed Google Analytics and Kissmetrics but I'm having no luck. I can verify that the code is installed correctly on my thanks.php page but no conversions get tracked. Any ideas?
I use 1shoppingcart and paypal. Not sure what you mean about what I have in thanks.php. The code? I didn't edit my thanks.php but I have this in the head of my layout.html: <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-25954165-1']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> <script type="text/javascript"> var _kmq = _kmq || []; function _kms(u){ setTimeout(function(){ var s = document.createElement('script'); var f = document.getElementsByTagName('script')[0]; s.type = 'text/javascript'; s.async = true; s.src = u; f.parentNode.insertBefore(s, f); }, 1); } _kms('//i.kissmetrics.com/i.js');_kms('//doug1izaerwt3.cloudfront.net/bda8cd218b62e3cff1b6ba2d468fc4337e517899.1.js'); </script> </head> But I added this to my thanks.html {if $total > "0.0"} {literal} <script type="text/javascript"> {/literal} _gaq.push(['_setAccount', 'UA-25954165-1']); _gaq.push(['_addTrans', '{$payment.payment_id}', // order ID - required '', // affiliation or store name '{$total|string_format:'%.2f'}', // total - required '0', // tax '0', // shipping '{$member.city}', // City '{$member.state}', // State '{$member.country}', // Country ]); {foreach from=$products item=p} _gaq.push(['_addItem', '{$payment.payment_id}', // order ID - required '{$p.product_id}', // SKU/code '{$p.title}', // product name '', // category or variation '{$p.price}', // unit price - required '1' // quantity - required ]); {/foreach} _gaq.push(['_trackTrans']); </script> <script type="text/javascript"> _kmq.push(['record', 'Signed Up', {'Plan':'6-Month Membership', 'Amount':27.00}]); </script> {/if}
Ok. now try to purchase as regular user and when you will be redirected back to /amember/thanks.php open page source code and check: 1. Was code added to thanks page? 2. Was code correct and have all necessary variables included?