Affiliate sales tracking using third party pixel tracking

Hi there
We have installed MarketPress. We use a 3rd party affiliate program from JROX called JAM http://jam.jrox.com/

The team at JROX need to integrate their pixel tracking and want to know where they should put it. They say:
--
Do you know if Marketpress supports third party pixel tracking? If not, we will have to look at the code directly and run some test transactions first to see how to integrate into it.
--
Thanks for your time - I look forward to your response.
All the best
Kevin

  • aecnu

    Greetings Kevin,

    Welcome to WPMU Dev!

    It can be pretty challenging to support other peoples work, but we do our best here to help you with any WordPress issues at all.

    Do you know if Marketpress supports third party pixel tracking? If not, we will have to look at the code directly and run some test transactions first to see how to integrate into it.

    The answer to this will be directly related to the gateway(s) chosen and that is where they would want to stick the pixel coding.

    The gateways are located in the /wp-content/plugins/membership/membershipincludes/gateways/ folder.

    It is my opinion that is what they are looking for and only relevant to those gateways that you have chosen to use.

    Thank you for being a WPMU Dev Community Member!

    Cheers, Joe

  • promofinity

    Hi Joe - And thanks for your response.

    You refer to plugins/membership etc - In my instance I don't have a directory called memberships. Am I safe telling my 3rd party to use this location? :

    /wp-content/plugins/marketpress/marketpress-includes/plugins-gateway

    We use PayPal Express so I figure that they would then add their pixel tracking code to: paypal-express.php

    Does that sound right Joe?

    Many Thanks
    Kevin

  • aecnu

    Greetings Kevin,

    My sincere apology sir, great catch, and yes I made a mistake with the path in which I am embarrassed about as well.

    This is indeed the correct path:
    /wp-content/plugins/marketpress/marketpress-includes/plugins-gateway/

    And yes since you are using PayPal Express the paypal-express.php file is correct.

    Once again I am sorry for my path mistake and happy that you caught it as well.

    Sincerely, Joe

  • promofinity

    Hello

    Our developer modified 'paypal-express.php' in the location suggested.
    Afterwards, when going to any page and even when trying to login to wp-admin, we receive error:
    Fatal error: Cannot redeclare class MP_Gateway_Paypal_Express in /websites/123reg/LinuxPackage22/am/br/og/ambrogiorobots.com/public_html/store/wp-content/plugins/marketpress/marketpress-includes/plugins-gateway/paypal-express.php on line 1152

    The developer then re-instated the original paypal-express.php file - but the error remained. They then changed the original file name to paypal-express.ORIG.php and the site is now, no longer throws up the error.

    Two questions please...

    1. Why is the site still failing if they simply re-instate the old file. Why do they need to rename it to make it work.

    2. Where should they put their tracking code so that it works?

    This is the code - They modified this:

    --ORIG START LINE 375--
    ` case 'Completed':
    $status = __('The payment has been completed, and the funds have been added successfully to your account balance.', 'mp');
    $paid = true;
    break;`
    --ORIG END--

    to this:
    --NEW START--
    ` case 'Completed':
    $status = __('The payment has been completed, and the funds have been added successfully to your account balance.', 'mp');
    $paid = true;

    //START JAM INTEGRATION CODE
    if (!empty($_COOKIE['jrox']))
    {
    $jam_integrate = file_get_contents('http://www.ambrogiorobots.com/resellers/sale.php?amount=' . $_SESSION['final_amt'] . '&trans_id=' . $payment_info['transaction_id'] . '&custom_mid=' . $_COOKIE['jrox']);
    }
    //END JAM INTEGRATION CODE

    break;`

    --NEW END--

    Many Thanks
    Kevin

  • aecnu

    Greetings Kevin,

    Thank you for your additional input, it is greatly appreciated.

    I would think that they kept getting the same error even after returning the file to it's original state due to either browser caching or web site caching if employed, but there is no way for me to know for sure without reinstating the file in its original state and testing from here.

    However, your question regarding the custom coding I do not have an answer for.

    Therefore 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

  • Aaron

    It sounds to me like they made a copy of that gateway with there customizations. Which is fine, but to avoid errors each gateway has to have a different class name, so you'd need to change MP_Gateway_Paypal_Express to something like MP_Gateway_Paypal_Express_jrox, then change the register function at the bottom to:
    mp_register_gateway_plugin( 'MP_Gateway_Paypal_Express_jrox', 'paypal-express', __('PayPal Express Checkout JROX', 'mp'), true );

  • promofinity

    Hello Aaron

    Thans for your response.

    The affiliate Tracking developer has responded with this:

    "we did not make any copies of any file. we edited the same file with our code and tried it. it didn't work, so we reuploaded the SAME EXACT file from before with no changes, and it still won't come up."

    Is it possible for you to liaise directly with the programmer Aaron? I am travellin over the next few days and the programmer is just waiting to figure this problem out. His name is Ryan - info@jrox.com

    If you are able to discuss directly I am sure you will arrive at a solution.

    Thank you.
    Kevin

  • promofinity

    Hi Joe

    aecnu said:
    I have indeed tried to help in every way that I can and though I am not sure if our lead developer is going to make an appearance in here again considering that custom coding is not within our support platform.

    I am not disputing that fact.

    This does seem like a standard requirement of a shopping cart though - Surely I am not the first person who would want to add 'third party pixel tracking'.

    If we cannot resolve this then it will make the entire process, thus far, pointless, I will have to find another solution and will be the best part of $160 out of pocket and would obviously not be inclined to look at WPMUDEV products in the future. So let's hope it doesn't come to that.

    Thanks for your assistance Joe.

    All the best
    Kevin

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.