Page 1 of 1

HELP! S2Member not passing Affiliate ID for Authorize.net?

PostPosted: September 16th, 2011, 8:30 am
by jlamarferren
Hello,

I purchased a plugin called WP Affiliate Platform and it is supposed to be integrated with S2 Member. As we started promoting our program, we noticed that we were getting sales, but that our affiliates were not. They were showing many clicks, but 0 sales. I contacted the developer for the WP Affiliate Platform plugin and when he looked at our set up here is what he would like me to ask the S2 Member developers:

When using the authorize.net gateway, does the S2Member plugin send the Affiliate ID when sending the IPN notification like it does for PayPal transactions?

Also, they wanted me to mention the following documentation so the S2 Member developers can easily catch up and will know what we are talking about:
http://www.tipsandtricks-hq.com/wordpre ... ftware-368

Please help with this. This is the last piece we need and we want to be able to compensate our affiliates for their hard work.

Re: S2 Member not passing Affiliate ID for Authorize.net?

PostPosted: September 19th, 2011, 6:47 pm
by jlamarferren
Can one of the developers please take a look at this?

Re: HELP! S2Member not passing Affiliate ID for Authorize.ne

PostPosted: September 19th, 2011, 7:47 pm
by sgtcory
Do you have a link to your site you can share?

Also, you need to be sure you are pipe delimiting your shortcode :

%%cv1%% = If you need to track additional custom variables, you can pipe delimit them into the `custom` attribute; inside your Shortcode, like this: custom="www.yoursitehere.com|cv1|cv2|cv3". You can have an unlimited number of custom variables. Obviously, this is for advanced webmasters; but the functionality has been made available for those who need it.


The way I understand this is that you would pass the affiliateID like so in your shortcode :

custom="www.yourdomainhere.com|ap_id"

You would replace ap_id with the variable for ap_id so it will populate the CV1 field.

Tx

Re: HELP! S2Member not passing Affiliate ID for Authorize.ne

PostPosted: September 19th, 2011, 11:04 pm
by jlamarferren
I'll have the developer give this a try on WP Affiliate's end. Thanks

Re: HELP! S2Member not passing Affiliate ID for Authorize.ne

PostPosted: September 20th, 2011, 9:05 am
by jlamarferren
Oh and here is the link to my site. http://www.leasepurchaselocators.com

Re: HELP! S2Member not passing Affiliate ID for Authorize.ne

PostPosted: September 20th, 2011, 9:15 pm
by tipsandtricks_hq
Hi, We use the following action hook to add the "Affiliate ID" in the custom field for PayPal checkout (this was suggested by Jason):

ws_plugin__s2member_pro_before_sc_paypal_form_after_shortcode_atts

Is there a similar hook present for the Authorize.net checkout of the S2Member that we can utilize to add the affiilate ID to the "custom" field programmatically?

Re: HELP! S2Member not passing Affiliate ID for Authorize.ne

PostPosted: September 23rd, 2011, 12:38 pm
by scripteralex
Is there a workaround for this? We recently switched off the free version to Pro to get authorize.net (and lower our payment processing cost) and now our affiliates are getting furious that their aren't getting credit.

Re: HELP! S2Member not passing Affiliate ID for Authorize.ne

PostPosted: September 24th, 2011, 10:51 pm
by Cristián Lávaque
tipsandtricks_hq wrote:Hi, We use the following action hook to add the "Affiliate ID" in the custom field for PayPal checkout (this was suggested by Jason):

ws_plugin__s2member_pro_before_sc_paypal_form_after_shortcode_atts

Is there a similar hook present for the Authorize.net checkout of the S2Member that we can utilize to add the affiilate ID to the "custom" field programmatically?


Did you try the same hook with authnet instead of paypal? ws_plugin__s2member_pro_before_sc_authnet_form_after_shortcode_atts

viewtopic.php?f=40&t=12475&p=30895&hilit=ws_plugin__s2member_pro_before_sc_authnet_form_after_shortcode_atts#src_doc_ws_plugin__s2member_pro_before_sc_authnet_form_after_shortcode_atts

Re: HELP! S2Member not passing Affiliate ID for Authorize.ne

PostPosted: September 25th, 2011, 3:09 am
by tipsandtricks_hq
Thank you... I will try this hook.

Re: HELP! S2Member not passing Affiliate ID for Authorize.ne

PostPosted: September 27th, 2011, 1:50 pm
by Jason Caldwell
Hi there. Thanks for the heads up on this thread. It looks like we need to provide you with a solution that works across all Payment Gateways integrated with s2Member and s2Member Pro. Here is a code sample that should do just that. Please let me know if you have any trouble with this.

Code: Select all
<?php
function s2_wp_affiliate_tracking_codes 
() /* Works for ALL Payment Gateways in one go. */
    {
        $existing_site_owner_config = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["signup_tracking_codes"];
        $s2_wp_affiliate_tracking_codes = '<img src="/track.php?aid=%%cv1%%" />'; /* Add tracking code(s) here dynamically; the SAME way a site owner
        would do it manually through `s2Member -> API Tracking` in the Dashboard. Replacement Codes are listed in the Dashboard with s2Member. */
        $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["signup_tracking_codes"] = $existing_config . $s2_wp_affiliate_tracking_codes;
    }
if(!
is_admin()) add_action ("plugins_loaded", "s2_wp_affiliate_tracking_codes");
?>

Re: HELP! S2Member not passing Affiliate ID for Authorize.ne

PostPosted: September 27th, 2011, 10:40 pm
by tipsandtricks_hq
This option looks even better. Just to be clear... so the content of the following variable will get executed after a signup or a member payment?

$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["signup_tracking_codes"]

And we can use the following variables (values dynamically replaced from the actual transaction)?

%%cv1%%
%%amount%%
%%payer_email%%

Re: HELP! S2Member not passing Affiliate ID for Authorize.ne

PostPosted: October 1st, 2011, 4:16 pm
by Jason Caldwell
Thanks for the follow-up.

This code sample that I posted works ONLY for Signups.
i.e. The initial purchase, which might be for $0.00 if a 100% free trial was offered.
It does NOT get called upon for future recurring payments, only for the initial Signup.
( this works for all Payment Gateways, in one go )
Jason Caldwell wrote:
Code: Select all
<?php
function s2_wp_affiliate_signup_tracking_codes 
() /* Works for ALL Payment Gateways in one go. */
    {
        $existing_site_owner_config = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["signup_tracking_codes"];
        $s2_wp_affiliate_signup_tracking_codes = '<img src="/track.php?aid=%%cv1%%" />'; /* Add tracking code(s) here dynamically; the SAME way a site owner
        would do it manually through `s2Member -> API Tracking` in the Dashboard. Replacement Codes are listed in the Dashboard with s2Member. */
        $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["signup_tracking_codes"] = $existing_config . $s2_wp_affiliate_signup_tracking_codes;
    }
if (!is_admin ()) add_action ("plugins_loaded", "s2_wp_affiliate_signup_tracking_codes");
?>


Available Replacement Codes inside a Signup Tracking Code pixel:
See: s2Member -> API Tracking -> Tracking Codes
SNAG-0009.png



In addition, s2Member supports a feature called Specific Post/Page Access, where specific Posts/Pages can be sold apart from any Membership to the site, and separate Tracking Codes can/should be integrated for that type of sale. ( this works for all Payment Gateways, in one go )
Jason Caldwell wrote:
Code: Select all
<?php
function s2_wp_affiliate_sp_tracking_codes 
() /* Works for ALL Payment Gateways in one go. */
    {
        $existing_site_owner_config = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sp_tracking_codes"];
        $s2_wp_affiliate_sp_tracking_codes = '<img src="/track.php?aid=%%cv1%%" />'; /* Add tracking code(s) here dynamically; the SAME way a site owner
        would do it manually through `s2Member -> API Tracking` in the Dashboard. Replacement Codes are listed in the Dashboard with s2Member. */
        $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sp_tracking_codes"] = $existing_config . $s2_wp_affiliate_sp_tracking_codes;
    }
if (!is_admin ()) add_action ("plugins_loaded", "s2_wp_affiliate_sp_tracking_codes");
?>


Available Replacement Codes inside a Specific Post/Page Tracking Code pixel:
See: s2Member -> API Tracking -> Tracking Codes
SNAG-0010.png





Now, in addition to s2Member's "Tracking Code" integration, there is another way of integrating your affiliate software, and that is through s2Member's event driven API Notifications. This type of integration might be more desirable if you plan to track recurring payments as well. For instance, instead of integrating Tracking Codes, your application may prefer to integrate with s2Member's Payment Notification, processed silently behind-the-scene, anytime an actual payment is received; and this DOES include future recurring payments too. ( this also works for all Payment Gateways, in one go )

Here are code samples for this type of integration, covering both Membership and Specific Post/Page functionality. For further details, see: Dashboard -> s2Member -> API Notifications.
Code: Select all
<?php
function s2_wp_affiliate_membership_payment_tracking_urls 
() /* Works for ALL Payment Gateways in one go. */
    {
        $existing_site_owner_config = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["payment_notification_urls"];
        $s2_wp_affiliate_membership_payment_tracking_urls = 'http://example.com/track.php?user_ip=%%user_ip%%&payer_email=%%payer_email%%&amount=%%amount%%&aid=%%cv1%%';
        /* Add tracking URL(s) here dynamically; the SAME way a site owner would do it manually through `s2Member -> API Notifications -> Payment Notifications` in the Dashboard. Replacement Codes are listed in the Dashboard with s2Member. */
        $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["payment_notification_urls"] = trim ($existing_config . "\n" . $s2_wp_affiliate_membership_payment_tracking_urls);
    }
if (!is_admin ()) add_action ("plugins_loaded", "s2_wp_affiliate_membership_payment_tracking_urls");

function s2_wp_affiliate_sp_sale_tracking_urls () /* Works for ALL Payment Gateways in one go. */
    {
        $existing_site_owner_config = (string)$GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sp_sale_notification_urls"];
        $s2_wp_affiliate_sp_sale_tracking_urls = 'http://example.com/track.php?user_ip=%%user_ip%%&payer_email=%%payer_email%%&amount=%%amount%%&aid=%%cv1%%';
        /* Add tracking URL(s) here dynamically; the SAME way a site owner would do it manually through `s2Member -> API Notifications -> Specific Post/Page Sale Notifications` in the Dashboard. Replacement Codes are listed in the Dashboard with s2Member. */
        $GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["sp_sale_notification_urls"] = trim ($existing_config . "\n" . $s2_wp_affiliate_sp_sale_tracking_urls);
    }
if (!is_admin ()) add_action ("plugins_loaded", "s2_wp_affiliate_sp_sale_tracking_urls");
?>

Replacement Codes for s2Member's Payment Notification.
SNAG-0012.png

Replacement Codes for s2Member's Specific Post/Page Sale Notification.
SNAG-0011.png