Affiliate plugin not tracking signups

My affiliate plugin tracks all clicks and free member signups, but not paid members.

I've got my tables in db-config. Only thing I did realize is that the tables are in both my main database and the global one.

Can that be causing the problem?

  • Barry
    • DEV MAN’s Mascot

    Can you check a few of the records in that table, just to make sure that every count column (click, etc.) doesn't contain a 1.

    To clarify a bit, maybe, there should be a single row for each user for each day - so the period 20100422, user_id 1 there should be a single record, with the counts incrementing. If there is more than one record for the same period and user_id, then there is an issue with your table, and we'll need to run a fix.

  • Barry
    • DEV MAN’s Mascot

    Yep, that looks ok - The clicks and the signups are, or seem to be, recording as there are figures in both those columns. The point a person receives their credit is when a complete is recorded, I can't see any in that screenshot - but can you check if there is a none 0 figure in the completes column (assuming you've had someone complete as a result of an affiliate signup).

  • georgef
    • The Incredible Code Injector

    The last time a 1 record was recorded was 2010-02-03 10:38:50.

    is that what you mean? I do know for a fact that quite a few people signed up through an affiliate link and that was definitely there first visit to the site.

  • Barry
    • DEV MAN’s Mascot

    signup and/or complete? Those are two different things.

    In order to check further, can you go over how you are recording the signups and completes? Are you using supporter plugin or some other method? The signup and complete code is held outside of the affiliate plugin so it can be changed easily.

    The image you posted above, certainly shows clicks being recorded and signups being created (when a user registers - using the supporter plugin), but doesn't show any completes (when the payment comes through - using the supporter plugin) - so if there aren't any recorded, and you definitely think there should have been, then there may be a problem / change since the last recorded complete that stopped the complete action being fired.

  • georgef
    • The Incredible Code Injector

    I meant complete. Signups are being tracked and yes its through supporter.

    Initially this could have caused the problem - https://premium.wpmudev.org/forums/topic/supporter-paypal-ipn-warning

    I was using a different template and supporters were not being tracked at all.

    I have removed that since and now only use the supporter straight up as is.

    When my Paypal IPN went down, I went and reactivated it again which fixed that problem, but is there something there that can be causing the affiliate plugin not to work?

  • Barry
    • DEV MAN’s Mascot

    The IPN on the supporter plugin is the thing that fires the action for the affiliate plugin to record a complete.

    Line 123 of the most recent version of supporter-paypal.php is the important line. If that isn't being hit by the PayPal IPN, then the compete won't be indentified.

    Can you check that the line:
    do_action('supporter_payment_processed', $bid, $amount, $period);
    exists in your supporter IPN?

  • jozwikjp
    • The Incredible Code Injector

    I found a problem in the supporter-amazon.php file.
    On the payment success.

    After this function is called.
    supporter_extend($bid, $period, 'Amazon');

    No more code is executing

    The hook for the affiliate code is just after that

    // Added for affiliate system link
    do_action('supporter_payment_processed', $bid, $amount, $period);

    I rearranged it so the last action is the extend action.
    That seems to have the desired effect
    // case: successful payment
    list($bid, $period, $amount, $type, $stamp) = explode('_', $_POST['referenceId']);

    //if single payment update stats
    if ($type=='single'){
    supporter_signup_stats($bid, 'single', 'signup', time());}

    // Added for affiliate system link
    do_action('supporter_payment_processed', $bid, $amount, $period);

    $note = date('Y-m-d: ').'Amazon '.$type.' payment by '.$_POST['paymentMethod'].' received and applied.';
    supporter_update_note($bid, $note);
    supporter_extend($bid, $period, 'Amazon');

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.