Page 1 of 1

shareasale recurring payments

PostPosted: October 20th, 2010, 3:19 am
by markelshark
Has anyone hooked up recurring affiliate payments through s2? The trick is that sharesale will POST back to your site with a simple HTTP request that contains the affiliate ID and some other variables, so you have to have a listener script to store that data. You then send it back to shareasale with every PAYMENT NOTIFICATION in s2.

Does anyone know if S2 has this type of 'listener script' built in for recurring payments or do I have to code somethign by hand?

Re: shareasale recurring payments

PostPosted: October 20th, 2010, 5:01 pm
by Jason Caldwell
Thanks for the excellent question.

Yes, s2Member can be configured to deal with this. However, it does take some planning to make it all work correctly and reliably. Please feel free to follow my tutorial below.

1. You'll need to pipe delimit the affiliate ID associated with each visitor into your PayPal Button Code(s). If you're running s2Member Pro Forms, you can do the same thing. In either case, you will receive the ?SSAID=xxx variable that ShareASale passes to your site, and insert that value into the "custom" attribute of your Shortcode, as follows:
Code: Select all
[s2Member-PayPal-Button ... custom="www.example.com|<?php echo $_GET["SSAID"]; ?>" /]
* The custom attribute MUST always start with your domain name, but you can pipe delimit additional data into this field. This ways it's available in s2Member's reporting in the future ( i.e. for recurring Payment Notifications processed by s2Member )

By default, ShareASale does NOT pass the ?SSAID=xxx variable. You will need to log into your ShareASale account and enable this feature. That way, when a potential Customer hits your site through an affiliate referral link, you will be capable of identifying the affiliate that referred them, via the ?SSAID=xxx variable.


2. Next, you will need a listener script that can be attached to s2Member's API / Payment Notifications. For further details, please have a look in your Dashboard. Go to:
s2Member -> API Notifications -> Payment Notifications

Pay particular attention the Replacement Codes that are made available. In this case, you will use the instructions provided by s2Member, and pull the affiliate ID associated with the payment, through the %%cv1%% Replacement Code. %%cv1%% = Custom Value #1, which is the affiliate ID that you originally piped into the Shortcode.


3. Now you just need to make the listener script do something each time s2Member processes a Payment Notification. Your listener script will need to speak with ShareASale using the ShareASale Merchant API tools that are documented inside of your ShareASale account.
shareasale-merchant-api.jpg
shareasale-merchant-api.jpg (20.16 KiB) Viewed 424 times

Re: shareasale recurring payments

PostPosted: October 21st, 2010, 12:14 am
by markelshark
Hi Jason,

First off, thanks for the response. As I see it there is one major issue with your solution: using the $GET to pull the variable down only works if the affiliate is sent directly to the signup page and doesn't click around through your site. If they click to a different page, or even close the browser and come back a few days later, then there is no SSAID variable to GET. This is also bad because I am promising my affiliates 90 day cookies for all sales via Shareasale.

So the workaround I put together is to put small code snippet at the bottom of every page (via s2clean's global footer space) to check and see if SSAID is !empty and, if it exists, to set a cookie for it.

Then on my order page I put a code snippet to check for my SSAID cookie and, if it exists, I put it into the paypal button shortcode.

It all seems to work OK - can you think of any drawbacks to this approach or have any additional feedback?

Thanks,

Mark

Re: shareasale recurring payments

PostPosted: October 21st, 2010, 12:33 am
by Jason Caldwell
Absolutely. I agree that is a very good idea!
Storing this incoming $_GET["SSAID"] value into a cookie ( i.e. $_COOKIE["SSAID"] ) will be much more reliable. I was just trying to keep the walk-through as simple as possible, but your idea is definitely a great way to ensure every affiliate receives credit all the way down the line.