VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: leunam4 on March 20, 2015, 22:20:25 PM

Title: How to find a "dynamic code for sale values" in Virtuemart 3.0.3?
Post by: leunam4 on March 20, 2015, 22:20:25 PM
Hi Guys,

I need place this pixel on the order confirmation page to follow-up on the conversion rate.

<!-- Facebook Conversion Code for __FBMail -->
<script>(function() {
  var _fbq = window._fbq || (window._fbq = []);
  if (!_fbq.loaded) {
    var fbds = document.createElement('script');
    fbds.async = true;
    fbds.src = '//connect.facebook.net/en_US/fbds.js';
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(fbds, s);
    _fbq.loaded = true;
  }
})();
window._fbq = window._fbq || [];
window._fbq.push(['track', '6023963948685', {'value':'0.01','currency':'USD'}]);
</script>
<noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/tr?ev=6023963948685&amp;cd[value]=0.01&amp;cd[currency]=USD&amp;noscript=1" /></noscript>


QuoteIMPORTANT NOTE: This pixel will allow you to see exactly how much revenue each ad campaign has generated for you. In order to do this have the developers replace the 0.01 with the dynamic code for sale values  (If you left it as 0.01 each sale would register as one cent. With the dynamic code it will know Sale A was $X and Sale B was $Y.)

So my question is: how or where can I find that "dynamic code for sale values" in Virtuemart 3.0.3?


Thank you for your help!

M.

Title: Re: How to find a "dynamic code for sale values" in Virtuemart 3.0.3?
Post by: GJC Web Design on March 21, 2015, 17:27:20 PM
it would be replaced with a php echo of I assume the cart vale/order value?

something like

<!-- Facebook Conversion Code for __FBMail -->
<script>(function() {
  var _fbq = window._fbq || (window._fbq = []);
  if (!_fbq.loaded) {
    var fbds = document.createElement('script');
    fbds.async = true;
    fbds.src = '//connect.facebook.net/en_US/fbds.js';
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(fbds, s);
    _fbq.loaded = true;
  }
})();
window._fbq = window._fbq || [];
window._fbq.push(['track', '6023963948685', {'value':'<?php echo $order_total?>','currency':'USD'}]);
</script>
<noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/tr?ev=6023963948685&amp;cd[value]=0.01&amp;cd[currency]=USD&amp;noscript=1" /></noscript>


but you need to find the var on what ever page your talking about