Customizing an affiliate program
From ISPWiki
Contents |
Сookies
This method uses cookie files to track and award sales that are made through the referral link.
No additional web site setting are required. You only need to provide a URL to our billing system in the property form of the affiliate program. For example, 'https://your_domain'.
Customizing click-through statistics
To register affiliate program clicks-through, your web-site needs to transfer corresponding information to the billing. To do that, you need to call the BILLmanager partner.click function in the site's script.
https://.../manager/billmgr?func=partner.click&project=1&partner=12345&ip=12.34.56.78&site=some.site&sesid=UNIQUE_COOKIE&authinfo=user:password
Where:
- project
- project ID (in BILLmanager Corporate).
- partner
- affiliate ID.
- ip
- referral's IP-address.
- site
- web-site a referral has come from.
- sesid
- referral's ID (random characters). Referrals' Ids must be unique.
- authinfo
- BILLmanager authorization information. A specified user must have enough privileges to use the partner.click function.
Example
Your site name is test.com. You have a client with ID 12345 who is going to become your affiliate. He places the link below on his web-sites:
http://test.com/index.pl?from=12345
Develop the handler in index.pl (Perl script):
if ($ENV{REQUEST_URI} =~ /from=(.*)/) {
# Take the partner ID from the requested URL:
$partner = $1;
# HTTP referrer
$site = uri_escape ($ENV{HTTP_REFERER});
# ID from cookie (set by the script)
$sesid = $CGI->cookie (-name=>'session_id');
# IP-address
$ip = $ENV{REMOTE_ADDR};
get ("https://.../manager/billmgr?func=partner.click&project=1&partner=$partner&ip=$ip&site=$site&sesid=$sesid&authinfo=user:password");
}
Affiliate registration link
Place the affiliate registration link on the web-site:
https://.../manager/billmgr?func=register&sesid=UNIQUE_COOKIE&project=1&partner=12345
Where:
- project
- project ID (in BILLmanager Corporate).
- sesid
- referral's ID (random characters). Referrals' Ids must be unique.
- partner
- affiliate ID.
Crediting an account
The funds are credited according to referral expenses over the previous month despite the date and time when /usr/local/ispmgr/sbin/billmaintain partnermonthly run.
