affiliate plugin + marketpress integration

Has anyone successfully integrated the affiliate plugin with marketpress yet? What I would like to do is when a store is created this will be a store that displays the global products of the main store and when a product is clicked on and purchased the affiliate ( subdomain ) will get credit for the clicks & subsequent purchase. Any ideas?

  • DavidM
    • DEV MAN’s Mascot

    Hi bford and welcome to WPMU DEV!

    It is possible to do and integration is being looked into for inclusion in MarketPress, though until that’s integrated, you may want to consider seeking a developer’s assistance for that.

    If you’re comfortable with coding something yourself, you could take a look at the following article from the blog regarding Affiliate integration with other plugins.



  • Mason
    • DEV MAN’s Sidekick

    Hiya bford,

    Welcome to WPMU DEV!

    I don’t know of anyone running this exact scenario (yet) but you should be able to get pretty darn close with the default MarketPress and Affiliate plugins running together.

    MarketPress does have support for google’s ecommerce tracking:

    And the affiliate plugin can monitor traffic and provide credits. The two aren’t ‘integrated’ per se so you’d have to manually verify the information and award credits.

    Anyone else looking for this? We do have add-ons for the affiliate plugin for our Membership and Supporter plugins. Maybe MarketPress should be next? Any +1s on this?


  • bford
    • Flash Drive

    I saw that it is being included in a future marketpress release, I just need it now :slight_smile: So with that said, I pretty much have an idea of how to make it work:

    1. Find the function that handles the link generation for subdomains and concat the affiliate ID onto the end so when the product is clicked it now is

    2. What I don’t know yet is how is that affiliate link tracked throughout the payment process and reported back to that affiliate ( I assume the nature of the affiliate plugin will handle this ) but I’m not sure if my changes ( Once I know what to change ) will adversely affect the functionality of this plugin.

    Sound about right?

  • bford
    • Flash Drive

    ok so I have made some changes to the marketpress php code, here is a snippet I have changed in the template-functions.php file

    lines 1625-1627:

    function mp_products_link($echo = true, $url = false, $link_text = '') {
    $settings = get_option('mp_settings');
    $link = home_url( $settings['slugs']['store'] . '/' . $settings['slugs']['products'] . '?ref=billbobagins-64' );

    Now this problem I see with this ( since it doesn’t seem to be recording clicks ) is the productname/?ref=affiliateID, how do I remove the ” / ” so it reads productname?ref=affiliateID? I have made similar changes to the marketpress.php file as well to handle the links so I would imagine whatever i need to do to fix this would apply to that code as well?

    Again I’m also assuming these changes will allow the affiliate plugin to recognize the affiliate link to the product and record it, what i’m still not sure of is if this is also going to be recorded when the product is purchased and so on…? Anyone with some insight want to weigh in here? :slight_smile: THANKS in advance!!

  • bford
    • Flash Drive

    Ok update, I have confirmed it works, had to use a completely different computer to test since clearing my cookies didn’t seem to make a difference. So the productname/?ref=affiliateID works for click tracking, now I have to get marketpress to stop failing on “confirm checkout” to see if it keeps track of the sales.

  • Aaron
    • CTO

    It will take alot more than that to integrate the two. You will also need to hook into the order creation process, as well as the order paid hooks. And that would be for a single site install.

    What you describe I don’t even think is possible, as in multisite affiliate becomes a network plugin I think. And tracking cookies too wont work across the subdomains.

    Suffice to say it will take a good developer to make this for you.

  • bford
    • Flash Drive

    So if I understand correctly keeping track of the URL from which the order came from and reposting that back to the affiliate plugin at time of order confirmation and displaying that in the dashboard along with all other current data won’t work?

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.