Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2019
    Posts
    1
    Plugin Contributions
    0

    Default Need helping finding variable for order total when used with Facebook Pixel

    Hello, I'm attempting to setup the Purchase event with our Facebook Pixel on our Zen Cart site and I'm having trouble getting it to push the value through.

    I've tried a variety of different variables for order total, even the one supplied by Zen Cart on this page, specially "<?php echo $order_summary['order_total']; ?>" and it hasn't worked, regardless of what I try.

    The example for the code is below. This would only be on our checkout page to indicate a successful transaction has taken place and it would send the value of the order to the Facebook Ad Manager.

    Code:
    <script>
      fbq('track', 'Purchase', {
        value: '<?php echo $order_summary['order_total']; ?>',
        currency: 'USD',
      });
    </script>
    I have tried every variation of the "value" variable possible and none of them seem to successfully pass that order total through to Facebook.

    Does anyone know what variable I would enter in for "value" to get that order total to successfully pass through?

  2. #2
    Join Date
    Jul 2012
    Posts
    14,576
    Plugin Contributions
    17

    Default Re: Need helping finding variable for order total when used with Facebook Pixel

    Assuming that by "checkout" page you mean checkout_success, the variable is available the first time the page is loaded and only after the includes/modules/pages/checkout_success/header_php.php file has loaded.

    From the writeup it appears that the testing performed is from a live transaction and not from attempts to "see" the code. One thing to consider is whether the page pass html validation as a script is used if the page does not validate, then it is possible that the script does not/can not execute.

    If attempting to review the source code, then recommend preventing deletion of the associated session data so that upon "second" viewing that the data remains present for display.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...
    Upgraded to Zen Cart V1.5.3 from V1.5.1 from V1.5.0 from V1.3.9h

 

 

Similar Threads

  1. facebook javascript for remarketing pixel
    By juneloweelyn in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 24 Mar 2014, 02:27 AM
  2. Server Side Variable Name for Order Total?
    By MikeMurphyINC in forum Code Collaboration
    Replies: 4
    Last Post: 5 Mar 2014, 09:46 PM
  3. Salemaker total when used with Specials
    By GTHENRY in forum General Questions
    Replies: 0
    Last Post: 13 Jan 2011, 11:54 PM
  4. Replies: 1
    Last Post: 12 Jul 2009, 03:28 AM
  5. Need Order Total Variable For iDevAffiliate
    By etrader in forum General Questions
    Replies: 5
    Last Post: 19 Jun 2006, 07:57 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR