Tracking Paid Signups for Affiliates Plugin

Hi,
I have the Affilaites Plugin installed on a Multisite Wordpress setup. I tested and it it works in that if User A refers User B, in User A's Affiliates Panel it says 1 sign-up.

However, I have a few custom paid plans for Users. I don't plan on using Memberships or Pro Sites and say I have 3 Paid plans + Free Plan, Paid 1 ($1/month), Paid 2 ($2/month)and Paid 3 ($3/month). I want to pay affiliates referrals the entire month fee, so if a certain user refers me a user who signs up for Paid 2, I will pay the user $2/month

I don't think the Affiliates plugin gives me this insight in the MU Network Admin Dashboard about which user referred which user (username specifically). If I get the username that was referred to I can then track the custom paid plan they signed-up for, because I don't want to pay any affiliate fees if the referral signedup for the free plan.

Is this data available in the tables or the UI and if not how can I tweak the code to actually give me this data so I pay User A the exact amount if UserB signed up for a specific paid plan. What is the easiest way to customize this plugin to enable this kind of tracking.

  • Adam Czajczyk

    Hello Abi,

    I hope you're well today and thank you for your question!

    Currently such a reporting feature isn't built-in into the Affiliates plugin but it would take some relatively simple custom development to create a basic plugin that would provide you with it.

    The affiliate data are stored in "_affiliatedata" and "_affiliaterecords" tables but as both affiliates and referred users are regular WP users, the "_users" and "_usermeta" tables in DB also contain some information.

    Therefore you could query "_usermeta" table against "meta_key = affiliate_referred_by" where "user_id = X" (X would be WP user ID of referred affiliate). This would return "meta_value" with an ID of a user that referred this one. You'd then know who referred selected affiliate.

    Another query could be querying "_usermeta" table against "meta_key = affiliate_referred_by" where "meta_value = X" (X would be WP user ID of referring affiliate) and this would return "user_id" that would be an ID of a users referred by that selected affiliate.

    This way you could find both who was referred by whom, and who referred whom. You would then know that "User A was referred by User B" and/or that "User B referred User A". As a result you, knowing that "User A" signed up for a "$100 Plan" you'd also know what amount "User B" should be credited with.

    I hope that helps! If you have any further questions on this, let me know please!
    Best regards,
    Adam