Free Affiliates Tracking Script
NEW Version 4.0 Released 4 March 2004!
Now handles variable commissions and multiple products!
An affiliates tracking script can help boost your sales dramatically. Recruit a worldwide army of eager salesmen with this (fairly) simple to understand but powerful script...
|
See the page on TWB: ECommerce Website System for a complete system based on this script. It's includes fully-functional affiliates-management and products-management scripts, PLUS a full-featured PayPal IPN handler to record your sales and referrals automatically. Works with all the PayPal merchant's tools... More...
|
This free script allows your affiliates to sign up, get links, change their details and retrieve lost passwords. It includes a banners manager, an admin 'control-panel' page and a stats page. It's basic but functional!
Script Features:
- Handles full lifecycle from signup to removal
- Tracks down 3 levels of referrals
- Works with any number of products.
- Handles product price changes.
- Affiliates can see how many hits / referrals / sales they have made
- Example explanation text included.
|
To see this free script in action on a test database - click here: Affiliates Tracking Script - LIVE.
To download any of the free scripts, please go to the Free Scripts page.
My scripts are FREE for non-profit use. If you use them commercially, please make a donation. Thanks.
Requirements
You need to be able to install the scripts in the root directory of your website. If you need an FTP tool, see the page on Telnet and FTP.
You need to enter your database login details into the two scripts using a text editor. If you need an HTML / PHP Editor, see the page on HTML Editors.
You need to have access to PHP and a MySQL Database. You'll need to know your database username and password because these must be entered into the scripts.
You need access to PHPMyAdmin or similar tool so you can create the database tables.
Installation - Free Script
See the TWB: ECommerce Website System page for basic installation info.
The free script doesn't include the products manager, so you have to set up your products another way. You can setup your products directly in the table using PHPMyAdmin or by creating an SQL script with INSERT statements like the following, and running it in 'mysql' via Telnet or in PHPMyAdmin:
INSERT INTO products (pr_id, name, descr, price, lev1_commission, lev2_commission, lev3_commission, valid_from, valid_to)
VALUES (1, 'TestProduct1', 'TP1: A test product, for testing the system', '248.95', '45.77', '25.55', '12.23', '2003-01-01', '2003-07-01');
Now the affiliates ID will be available in all the (PHP) pages of your website - as the variable: $referrer_id. You can use this to track sales with PayPal (for example) by including something this in your paypal button form code:
<input type="hidden" name="custom" value="<? echo $referrer_id; ?>">
The value is 'passed through' the PayPal system and can be automatically added to the database of receipt of a notification: PayPal's Instant Payment Notification system can call a script on your website with all the sales details, this script then adds the appropriate data to the database.
If you don't want to buy TWB-EWS, an example IPN processing script you can modify to handle this data is available on the Free Scripts page.
How The Script Works:
- An affiliate signs up.
- A unique ID is generated for them.
- They are sent an email with this info in it.
- Once logged in, they can see a 'banner' link to your website to cut and paste into their webpages, i.e.
http://www.web-bureau.com/index.php?referrer_id=1
- That link contains their ID, and when the browser arrives at your site...
- A cookie with that ID is placed on the prospect's computer using the code described above.
Cookies contain values which are transmitted back to the site they came from. That's all they do!
- If they click to buy your product, the
referrer_id is included in the post to PayPal by including the line in the paypal button form code as described above.
- The
referrer_id value is passed through the PayPal ordering system, and ends up, along with the rest of the order info, at your ipn.php (payment processing) script.
- The
ipn.php script records the affiliate's ID along with the rest of the order info into the 'sales' table in the database.
It's then up to you to pay your affiliates!
Note: A lot of people ask me about getting an automated system setup to pay their affiliates. This isn't possible thru PayPal - they have 'Mass Pay' but the amounts must be pre-set (apparently). If you're making enough sales for it to be a problem - you can afford to hire someone else to do it!
I hope you find this script useful. Let me know how you get on!
For More Info....
- A popular commercial tutorial on making your affiliate program a success is James Martell's Affiliate Master Course. I hear it's a good read, but I've yet to read it myself.
- 'The Affiliate Masters Course' is an excellent free ebook from SiteSell.com. It's available in the free ebooks library.
- For more info on affiliate programs, what they are, how they work etc. see the affiliates page.
- This script is listed in totalscripts.com!
Warning: Cannot modify header information - headers already sent by (output started at /home/sites/web-bureau.com/public_html/modules/free-php-affiliates-tracking-script.php:7) in /home/sites/web-bureau.com/public_html/footer.php on line 12
|