WordPress Affiliate Manager

Affiliates Management Plugin for WordPress

  • Home
  • Features
    • Screen Shots
  • Download
  • Documentation
  • Addons
  • Support
    • Support Forum
    • Forum Login
    • Forum Registration
    • Contact
    • Premium Addon/Plugin Support
You are here: Home

metius

  • Profile
  • Topics Started
  • Replies Created
  • Engagements
  • Favorites

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • June 11, 2020 at 5:43 pm in reply to: Pixel Facebook – Thank you Page woocommerce #6783
    metius
    Participant

    Hi, it works but if someone for any reasons update thank you page or pay with paypal and close page before redirect on thank you page it distorts data sent to the pixel.

    So I’d like trying something like adding action for new order that should check if meta key (“_wpam_id”) for new order exist.

    but i don’t know how to get it…

    June 1, 2020 at 11:26 am in reply to: Pixel Facebook – Thank you Page woocommerce #6767
    metius
    Participant

    i changed it so:

    if (isset($_COOKIE[‘wpam_id’])) {

    $aff_id = $_COOKIE[‘wpam_id’];

    if($aff_id == ’67’)

    add_action( ‘woocommerce_thankyou’, ‘my_custom_tracking’ );

    function my_custom_tracking( $order_id ) {

    // Lets grab the order
    $order = wc_get_order( $order_id );

    /**
    * Put your tracking code here
    */

    ?>

    <!– Facebook Pixel Code –>

    <script>
    !function(f,b,e,v,n,t,s)
    {if(f.fbq)return;n=f.fbq=function(){n.callMethod?
    n.callMethod.apply(n,arguments):n.queue.push(arguments)};
    if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version=’2.0′;
    n.queue=[];t=b.createElement(e);t.async=!0;
    t.src=v;s=b.getElementsByTagName(e)[0];
    s.parentNode.insertBefore(t,s)}(window, document,’script’,
    ‘https://connect.facebook.net/en_US/fbevents.js’);
    fbq(‘init’, ‘myfacebookpixel’);
    fbq(‘trackSingle’, ‘myfacebookpixel’, ‘Purchase’, {value: <?php echo ($order->get_subtotal() – $order->get_total_discount()) * 0.15; ?>,
    currency: ‘EUR’,
    });
    </script>

    <!– End Facebook Pixel Code –>

    <?php

    // This is the order total
    $order->get_total();
    $order->get_subtotal();
    $order->get_total_discount();

    }
    }

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)

Featured Addons

  • WooCommerce Coupon Tracking
  • WooCommerce Product Specific Commission

Copyright © 2026 | WordPress Affiliate Manager | Privacy Policy