Hello,
It is only tracking one line item. Not cart total
Works fine with one product orders, but not when they order two or more, only one item value is passed.
thanks
/J
Ok found it.
In the Plugin PHP change:
'<?php echo $total; ?>', 'revenue_value': '<?php echo $total; ?>',
to:
this
'<?php echo $order->get_total(); ?>', 'revenue_value': '<?php echo $order->get_total(); ?>',
Code is a little wrong. i think you tried to loop through the Order Items and trigger event but u didn’t do it right.
This should send total cart value value to MS ADS.
/J
-
This reply was modified 5 years ago by
kattouf.
Hey @kattouf , sorry to bother you but I have the same question: what conversion goal should I set within microsoft that you found out?
also, the code snippet you showed in your last comment, is this fixed allready in the newest update or do I need to add that manually 🙂 ?
Thanks 🙂
Oh I found it, it still has the old code so I changed it to the nwe on :). Also found the conversion goal in your comment in the other tread!
thanks!
Glad i could be of help!
Instead of my above code. i use this now, it’s simpler:
First this:
// This is the order total
$order->get_total();
$revenue = $order->get_total();
Still basically the same and replaces the value for $revenue.
Then replace with this:
<script>
(function(w,d,t,r,u){var f,n,i;w[u]=w[u]||[],f=function(){var o={ti:"<?php echo (get_option('bing_uet_tracking_code')); ?>"};o.q=w[u],w[u]=new UET(o),w[u].push("pageLoad")},n=d.createElement(t),n.src=r,n.async=1,n.onload=n.onreadystatechange=function(){var s=this.readyState;s&&s!=="loaded"&&s!=="complete"||(f(),n.onload=n.onreadystatechange=null)},i=d.getElementsByTagName(t)[0],i.parentNode.insertBefore(n,i)})(window,document,"script","//bat.bing.com/bat.js","uetq");
window.uetq = window.uetq || [];
window.uetq.push('event', 'purchase', {'event_category': 'sale', 'event_value': '<?php echo $revenue; ?>', 'revenue_value': '<?php echo $revenue; ?>', 'currency': '<?php echo (get_option('bing_tracking_currency')); ?>'});
</script>
-
This reply was modified 4 years, 10 months ago by
kattouf.