Step 1. From the Dashboard, click "Setup Up Software


Step 2. Under "Setup",  click on Link Software to My Store to get the snippet of code.


Step 3. Select "PayPal" from the List of Shopping Carts. Once you select PayPal, copy the code shown in preparation to add to your subscription button code.


Step 4. Add code to your PayPal subscription button

Take the code you copied above in Step 3 and add it to your PayPal subscription button right before the closing form tag shown below.


NOTE:

EXAMPLE OF HOW IT SHOULD LOOK LIKE ONCE ADDED TO THE PAYPAL BUTTON EMBED CODE. OSI TRACKING CODE IS THE BOLD TEXT. DO NOT USE:


<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 name="notify_url" type="hidden" value="https://ninademo.ositracker.com/sales/paypal_plugin" />
<input id="custom" name="custom" type="hidden" />
<script language="JavaScript" src="https://ninademo.ositracker.com/sales/get_affiliate" type="text/javascript">
</form>

Step 5. Add the code below right before the closing body tag of your website landing page. Note, this should get added to the page that people go to when they click on an affiliate link.

<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>


Step 6Add the code below to the same page that your PayPal button is on. Thie code shown below should be right before your closing body tag.

<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>


Your PayPal subscription button integration is now complete. The system will now automatically add commission to an affiliate that refers someone that purchases through your PayPal subscription button as long as the subscription is active.