How to setup a Paypal Affiliate Program
Step 1. From your admin dashboard, click on Set up software.
Step 2. Click on Link Software to my Store to get the code.
Step 3. On the drop-down list, click and select Paypal.
Step 4. Embed the following tracking code within your PayPal button. It is easy to do this. All you have to do is insert the three codes below before the closing tag within your Paypal button.
NOTE:
<form action="http://www.paypal.com/cgi-bin/webscr" method="post">
<input name="cmd" type="hidden" value="_s-xclick" />
<input name="hosted_button_id" type="hidden" value="XXXXXXXX" />
<input alt="PayPal - The safer, easier way to pay online!" border="0" name="submit" src="http://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif" type="image" />
<img alt="" border="0" height="1" src="http://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" />
<input type="hidden" name="notify_url" value="https://osidemo2.ositracker.com/sales/paypal_plugin">
<input type="hidden" name="custom" id="custom">
<script type="text/javascript">
function setCookie(cname,cvalue,exdays) {
var d = new Date();
d.setTime(d.getTime() + (exdays*24*60*60*1000));
var expires = "expires=" + d.toGMTString();
document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/";
}
var urlParams;
(window.onpopstate = function () {
var match,
pl = /\+/g, // Regex for replacing addition symbol with a space
search = /([^&=]+)=?([^&]*)/g,
decode = function (s) { return decodeURIComponent(s.replace(pl, " ")); },
query = window.location.search.substring(1);
urlParams = {};
while (match = search.exec(query))
urlParams[decode(match[1])] = decode(match[2]);
if (urlParams['affiliate_id']) {
// alert('affiliate_id = '+urlParams['affiliate_id']);
setCookie("affiliate_id", urlParams['affiliate_id'], 60);
}
if (urlParams['prodgroup']) {
// alert('prodgroup = '+urlParams['prodgroup']);
setCookie("prodgroup", urlParams['prodgroup'], 60);
}
})();
</script>
<script type="text/javascript">
function getCookie(cname) {
var name = cname + "=";
var decodedCookie = decodeURIComponent(document.cookie);
var ca = decodedCookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
var affiliate_id = getCookie("affiliate_id");
var prodgroup = getCookie("prodgroup");
if (affiliate_id != "" && prodgroup != "") {
var hidvar=affiliate_id+'@'+prodgroup;
var x = document.getElementsByName('custom');
for (i=0; i<x.length; i++) {
x[i].value=hidvar;
}
}
</script>
</form>
That is it. The software is now integrated with PayPal. You can go ahead and test to see if it works.