Hey there,
this a never ending story for me. Since 4 weeks I try to get the conversion to work. I tried several different approaches with no success. Even with default Woo thank you page. Right now I use Woo GA integration for general analytics which work. Actually I gave up on this but today I tried this custom Thank you plugin and found the you solution.
The thank you page does have the conversion code in the source code. So everything is set up as described but I still get not conversion data. Any idea what could be wrong? I’m stunned that this is so buggy. This is how the TY source code looks like in the head tag:
<!– WooCommerce Google Analytics Integration –>
<script type=’text/javascript’>
var gaProperty = ‘UA-19XXXXXXX-1’;
var disableStr = ‘ga-disable-‘ + gaProperty;
if ( document.cookie.indexOf( disableStr + ‘=true’ ) > -1 ) {
window[disableStr] = true;
}
function gaOptout() {
document.cookie = disableStr + ‘=true; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/’;
window[disableStr] = true;
}
</script>
<script type=’text/javascript’>(function(i,s,o,g,r,a,m){i[‘GoogleAnalyticsObject’]=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,’script’, ‘//www.google-analytics.com/analytics.js’,’ga’);ga( ‘create’, ‘UA-196XXXXX-1’, ‘auto’ );(window.gaDevIds=window.gaDevIds||[]).push(‘dOGY3NW’);ga( ‘require’, ‘displayfeatures’ );ga( ‘require’, ‘linkid’ );ga( ‘set’, ‘anonymizeIp’, true );
ga( ‘set’, ‘dimension1’, ‘no’ );
ga( ‘require’, ‘ec’ );</script>
<script type=’text/javascript’>
var ga_orders = [];
try {
ga_orders = localStorage.getItem( ‘ga_orders’ );
ga_orders = ga_orders ? JSON.parse( ga_orders ) : [];
} catch {}
if ( -1 === ga_orders.indexOf( ‘3104’ ) ) {
ga( ‘set’, ‘&cu’, ‘EUR’ );ga( ‘ec:addProduct’, {‘id’: ‘002340’,’name’: ‘Product’,’category’: ‘Shoes’,’price’: ’10’,’quantity’: ‘1’});ga( ‘ec:setAction’, ‘purchase’, {
‘id’: ‘3104’,
‘affiliation’: ‘Brand’,
‘revenue’: ‘14.50’,
‘tax’: ‘0’,
‘shipping’: ‘4.5’
} );
try {
ga_orders.push( ‘3104’ );
localStorage.setItem( ‘ga_orders’, JSON.stringify( ga_orders ) );
} catch {}
}</script>
<!– /WooCommerce Google Analytics Integration –>
-
This reply was modified 3 years, 5 months ago by mike8040.
-
This reply was modified 3 years, 5 months ago by mike8040.