Pro Sites thank you page query string

I am using Pro Sites and need to understand a bit more about the thank you page query string after a successful transaction has gone through.

For completed transactions the 'my-account' page displays a url ending with something like (numbers have been randomized they aren't from real transactions!):

/my-account/?bid=33&action=complete&token=EC-5VS123456A123456A&PayerID=1ABCD1ABCFRT7

What is the significance of the 'token' and 'PayerID' query string variables? Are these BOTH unique for every successful checkout transaction?

Any help would be appreciated as I need to use one or both of these query variables to add to an affialiate tracking pixel.

  • aecnu
    • WP Unicorn

    Greetings cdunn,

    Welcome to WPMU Dev!

    What is the significance of the 'token' and 'PayerID' query string variables? Are these BOTH unique for every successful checkout transaction?

    I believe they are but will seek clarification so I am not stepping on it from one who will know for sure, I will see if I can get the lead developer in here with his invaluable insight into this plugin for his advice/advise for us.

    Though this may take a bit longer then a normal ticket, I will try to get him in here asap.

    Cheers, Joe

  • Timothy
    • Chief Pigeon

    Hey there.

    They should be unique I believe.

    Any help would be appreciated as I need to use one or both of these query variables to add to an affialiate tracking pixel.

    What are the instructions your affiliate tracking gives for this sort of thing?

    Which one is it?

    Perhaps that will enable me to better advise what needs doing if I can see it.

    Cheers.
    Tim.

  • cdunn
    • New Recruit

    Thanks for the quick response guys. Here is a little more infor if it helps.

    I am using iDevAffiliate and the tracking pixel code that needs to be inserted on checkout pages is as follows (raw embed code):

    <img border="0" src="http://mysite.com/affiliates/sale.php?profile=12345&idev_saleamt=XXX&idev_ordernum=XXX" width="1" height="1">

    I need to replace the XXX's with real data. The order amount is added as a fixed amount as there is nothing in the Pro Sites successful transaction query string to indicate the order amount (any way of obtaining this?).

    As for the order number field, at the moment I am just adding in a string made up from the blog ID, the token, and payer ID; all of which are grabbed from the transaction success page query string.

    So, currently my tracking pixel code renders something like the following:

    <img border="0" src="http://mysite.com/affiliates/sale.php?profile=12345&idev_saleamt=14.00&idev_ordernum=33__1ABCD1ABCFRT7__EC-5VS123456A123456A" width="1" height="1">

  • Aaron
    • CTO

    The query string has to do with the paypal API, not anything usefull to you. Here is what you could do:

    add_filter( 'mp_checkout_payment_confirmation_paypal-express', 'custom_tracking_code', 10, 2 );
    function custom_tracking_code($content, $order) {
       return '<img border="0" src="http://mysite.com/affiliates/sale.php?profile=12345&idev_saleamt='.$order->mp_payment_info['total'].'&idev_ordernum="'.$order->post_name.'" width="1" height="1">';
    }

    You could put that in the current theme's functions.php, or a custom plugin of yours on that site.

  • Aaron
    • CTO

    Whoops, ya that is with MarketPress. I think this would do it:

    add_filter( 'supporter_payment_processed', 'custom_tracking_code', 10, 2 );
    function custom_tracking_code($blog_id, $amt) {
    global $psts_active_gateways;
    $psts_active_gateways[0]->complete_message .= '<img border="0" src="http://mysite.com/affiliates/sale.php?profile=12345&idev_saleamt='.$amt.'&idev_ordernum="'.$blog_id.'" width="1" height="1">';
    }
  • cdunn
    • New Recruit

    I can't see a filter with that name in the Pro Sites code but there is an action hook with that name.

    However, trying to use 'supporter_payment_processed' as an action or filter hook doesn't quite work.

    I get my tracking pixel code outputted correctly (great!) but the checkout message is blank. i.e. the tracking pixel image tag appends to an empty message string.

  • cdunn
    • New Recruit

    That's a pity. Would you consider adding a similar action/filter hook to Pro Sites so the checkout page transaction details can be accessed?

    Ideally the whole result array could be passed in, rather than just amount and blog id?

    Is the checkout message on Pro Sites fixed by the way? If so, I guess I could tack it onto the tracking pixel code.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.