YOURaff™ 1.0
Advanced affiliate program software
© YOURsoft, 2003 and on. All rights reserved. YOURaff™ is a registered trademark of YOURsoft. Please
refer to the end of this document for more information.
http://www.yoursoft-tm.com
YOURaff™ installation requires:
- a UNIX based server
- 1 MySQL database
- CGI (Perl 5) support and a mail program (sendmail)
- FTP access and a FTP program
youraff10.zip file contains following files:
- ad.cgi
- admin.cgi
- admin.css
- admin.pass
- aff.cgi
- aff.lib
- ban.cgi
- com.cgi
- form.htm
- language.var
- login.cgi
- members.css
- notify.txt
- readme.htm (this file)
- set.cgi
- signup.cgi
- SQL.txt
- ty.cgi
- variables.dat
In case your youraff10.zip does not include all listed files, contact us!
>> Installing and configuring YOURaff™
- If the path to Perl on your server doesn't match the default path in the scripts '#!/usr/bin/perl',
open all '*.CGI' and '*.LIB' files in a PLAIN TEXT editor (like Notepad or Wordpad, DO
NOT use MS Word!) and change the very first line '#!/usr/bin/perl'
to the Perl path on your server. If you do not know the
exact path to Perl on your server, please read server
documentation or ask your server administrator! The path
is usually '#!/usr/bin/perl' or '#!/usr/local/bin/perl'
- Uploading files
Use your FTP client to login to your account. Got to your
CGI-BIN directory (or create one).
Create a directory called "youraff". Upload all
files expect "blank.gif" to this directory in ASCII mode (NOT
BINARY)! Then upload "blank.gif" in the same directory
but this time as BINARY.
CHMOD CGI and LIB files to "755"
(rwx-rx-rx), language.var and notify.txt to "644"
(rw-r-r), variables.dat and admin.pass to "666"
(rw-rw-rw).
Within the youraff directory create 1 new empty directory called "temp".
Do not use CAPITAL letters!
- Go to your MySQL client and create a new MySQL database youraff (usually the client creates database accountusername_youraff). Add
an existing user to the database or create a new one.
- Open your browser and go to "admin.cgi"
("http://www.yourdomain.com/youraff/admin.cgi").
Enter the default password "admin" (without the quotes).
Select tool "Settings editor" click "GO" and configure your affiliate program (Read the section "Setting up your
affiliate program" below). Then enter the "Banner editor" and
"Text ad editor" where
you can view/add/remove your ads which your
affiliates will choose from.
- Use the HTML code from "form.htm"
file to create a "subscription" and a
"user login" form on your site. CHANGE "<FORM ... action="
to the urls of "vpis.cgi" and "login.cgi" on your server!
(You may edit the appearance as you want, just DON'T
change any names or values of the "input
fields" (<input type= ... value=... name=...>)
between <FORM> and </FORM> headers!
>> Setting up your affiliate program
After clickin button "Edit settings" you will be taken to "Settings page". Here you can configure
your affiliate program. In order for YOURaff to work properly please follow guidelines below!
Site/server settings
- Site name (title) - the name (title) of your web site. Example: My web site
- Site URL - URL of your web site. Example: http://www.mydomain.com
- Admin e-mail - e-mail address of administrator. Example: admin@yourdomain.com
- Domain name - domain name (the one YOURaff is installed under. Usually same domain as in Site URL) without "www" and with a dot (.) before the name. Example: .mydomain.com
- Folder URL - URL of the folder where YOURaff is installed. Do not add a "/" at the end! Example:
wrong - http://www.domain.com/path/youraff/
correct - http://www.domain.com/path/youraff
- E-mail software on server - Path to e-mail software on the server (usually /usr/sbin/sendmail or /usr/lib/sendmail, ask your server administrator).
Add a " -t" at the end! Example: /usr/sbin/sendmail -t
- Database name - MySQL database name (Example: accountusername_youraff). If your database is not running on localhost (usually it is) add '@hostname:port'. Example: accountusername_youraff@otherhost:2082
- Database username - username for accessing the database. Example: accountusername_user
- Database password - password for accessing the database. Example: mypassword
- Thank you page URL - URL of your "Thank you" page (page where customers are redirected after a successful purchase). You only need this if you will be using com.cgi?n=p&d=XX or ty.cgi (see further down).
Example: http://www.domain.com/thankyou.html
- Use file locking? - 0 = NO, 1 = YES. 99,9% of UNIX hosts allow file locking (for greater security). We recommend you leave file locking set to 1!
Program settings
- Admin must confirm signups? - 0 = NO, 1 = YES. If set to 1 administrator will review/confirm all signups, if set to 0 affiliates
will have to confirm their signup by clicking a link in 'confirmation e-mail' sent to them.
- Pay Per Click (PPC)? - 0 = NO, 1 = YES. Set to 1 if you want to pay affiliates per click-through (for every unique visitor they send to your site).
In this case YOURaff will use cookies and log IP numbers to determine unique visitors and prevent fraud.
- Earnings per click: - Amount affiliates earn per click-through. Will be only used if PPC is set to 1.
- PPC cookie expiration (days): - PPC cookie expiration time in days. If set to 1 unique visitor will count as someone who
hasn't clicked affiliate link within 1 day (24 hours). Will be only used if PPC is set to 1.
- Default commission procent: - The default commission procent you will pay your affiliates. 0.1 = 10%, 0.12 = 12% etc.
You can later change the commission for each individual affiliate (credit good performing affiliates).
- Cookie expiration (days): - Expiration time of the 'commission cookie' in days. Example: 183 (half year). If someone clicks the affiliate link
and decides to purchase your product within 183 days the affiliate will be credited with commission.
- Currency - currency in which earnings will be displayed/paid
- Signup bonus - credit (money) affiliates receive just for signing up.
- Payout amount - money affiliates need to rais in order to be paid. Example: 50.00
- N.of digits behind the dot - set the number of digits in earnings after the dot (.) and add "f". Example: Script receives this value for earnings: earnings=23.642154631 $
2f will set the earnings to 23.64 $
1f will set the earnings to 23.6 $
5f will set the earnings to 23.64215 $
- Two-Tier program (2T)? - 0 = NO, 1 = YES. If set to 1 affiliates will be credited with a bonus (set below) for recruiting new webmasters to the program.
- Recruitment bonus: - Bonus for refering new webmasters. Will be only used if 2T (above) is set to 1. Example: 0.5 ($)
- Pay referral commission (RC)? - 0 = NO, 1 = YES. If set to 1 affiliates will be credited with receive a commission (set below) from what referred webmasters earn.
- Referral commission procent: - the commission referrers will receive. Will be only used if RC (above) is set to 1. Example: 0.5 = 50%, 0.25 = 25% etc. Webmaster A refers webmaster B to the program.
Webmaster B generates a sale for which he receives $10.00 commission. If RC is set to 1 and Referral commission procent is set to 0.5 (50%) webmaster A will earn $5.00 (50% of what webmaster B earned).
- Use an additional field? - 0 = NO, 1 = YES. Please read section "Optional field" below before making any changes!
- Additional field text - if above is set to 1 enter the text for this field. Example: PayPal e-mail (or EGold number, SSN, etc.)
- Add. field default value - default value of the additional field. Example: none (or Please enter one, etc.)
- Double IPN call for PayPal? - 0 = NO, 1 = YES. Please read the section "PayPal integration" below for more information.
- URL of the other IPN script - URL of your old IPN script. Example: http://www.domain.com/path/old_ipn_script.cgi Please read the section "PayPal integration" below for more information.
- Notify about sales? - 0 = NO, 1 = YES. If set to 1 you will receive a notification when an affiliate is credited with commission (a sale is made). The notification e-mail is easily editable
(see below)
- Use secure IPN URL? - 0 = NO, 1 = YES (recommended). For PayPal only. If set to 1 it will send IPN POST back to https://www.paypal.com/cgi-bin/webscr, if not it will POST it to http://www.paypal.com/cgi-bin/webscr.
Please read the section "PayPal integration" below for more information.
Click "Submit Changes" in order to store preferences.
Editing the notify e-mail
If you don't like the default notification e-mail, you can easily edit it - open file notify.txt and change the text.
If you use the phrases below YOURaff will automatically replace them with:
##SITE_NAME## - web site name (as set in Settings page)
##SITE_URL## - web site URL (as set in Settings page)
##ADMIN_MAIL## - administrator e-mail (as set in Settings page)
##CURRENCY## - currency (as set in Settings page)
##COMISSION## - the commission for this sale
Example:
Your commission for this sale is ##CURRENCY## ##COMISSION##.
... will for example become ...
Your commission for this sale is $ 15.25.
(This is example only. In reality the e-mail will contain the actual commission (not necessarily $ 15.25) and the currency which you set.)
>> Implementing YOURaff™ into your existing store/purchase forms
YOURaff™ can be easily implemented into your existing store or purchase forms (if you use PayPal please read instructions further down):
- Using an <IMG> tag (this is the easiest way).
Just place HTML code below on your "Thank you" page ( = the page where customer is
redirected after a successful purchase). Make sure you change the path to YOURaff™
and set XX as the value of purchase! By changing YY you can pass additional custom information
to the sales log file (DO NOT leave any space between characters/words and do not use any special characters (like: ?*,;:!%&$# etc.)! Use a plus (+) where you want space to appear in the sales log file. Example: &c=info+with+space+in+the+log ). If you do not wish to pass any extra information
you can leave '&c=' empty or remove it.
<IMG SRC="http://www.domain.com/path/to/youraff/com.cgi?n=i&d=XX&c=YY"
BORDER="0" HEIGHT="0" WIDTH="0">
Examples:
For a $50 sale and no extra information you would add following tag:
<IMG SRC="http://www.domain.com/path/to/youraff/com.cgi?n=i&d=50"
BORDER="0" HEIGHT="0" WIDTH="0">
For a $12.45 sale and some extra information you would add following tag:
<IMG SRC="http://www.domain.com/path/to/youraff/com.cgi?n=i&d=12.45&c=My+custom+information"
BORDER="0" HEIGHT="0" WIDTH="0">
- The second way you can implement YOURaff™ is by using redirection method (your
purchase script can be written in any programming language as long as you
know how to modify it or it lets you set it to redirect customers to a page of your choice after a successful purchase). Setup your purchase script so that it will redirect
customers after a successful purchase to com.cgi?n=p&d=XX&c=YY instead to the "Thank you"
page (XX is the value of purchase, &c=YY is optional for passing additional information). The script will then redirect customers to
the "Thank you" page (as set in Settings page).
Examples
For a $50 purchase and no extra information you would redirect customers to:
http://www.domain.com/path/to/youraff/com.cgi?n=p&d=50
For a $12.45 purchase and some extra information you would redirect them to:
http://www.domain.com/path/to/youraff/com.cgi?n=p&d=12.45&c=Extra+information+NO+SPACE+in+the+URL
>> I want to give my affiliates a flat commission rather than "percent-of-the-value" commission!
In this case just set Commission in Settings page to 1 (100% commission) and then replace XX in the examples above with the commission
your affiliates will be credited instead of the purchase value.
For a $5.50 commission you would use
http://.../com.cgi?n=i&d=5.50
ORhttp://.../com.cgi?n=p&d=5.50
as explained above.
>> Optional field
YOURaff allows you to setup one additional field to get additional information from your affiliates. This field is usually used
to collect PayPal e-mail addresses, E-gold numbers or other information. To activate it go to Settings page and
set "Use an additional field?" to 1. Enter the text for this field (edit "Additional field text") and set the
default value for this field ("Add. field default value"). See example below. Note: This field will NOT be entered during signup,
it can be set in User area or Admin area!
Use an additional field? 1
Additional field text: PayPal e-mail
Add. field default value: Please enter one
>> PayPal integration
YOURaff can be easily integrated into PayPal system. It uses PayPal's IPN (Instant Payment Notification)
to collect purchase information, so a PayPal Premier or Business account is required (Personal account
does not support IPN). Upgrade is free, please refer to PayPal website for further information.
To integrate YOURaff with PayPal you must activate IPN (login to your PayPal account, click "Profile",
under "Selling Preferences" click "Instant Payment Notification Preferences",
activate IPN and enter IPN URL (If you already use some othe IPN script please read instructions further down on how
setup your IPN):
http://www.domain.com/path/to/youraff/paypal.cgi
Next you have to add this line to your HTML code for PayPal buttons:
<script language=javascript src="http://www.yourdomain.com/cgi-bin/youraff/com.cgi?n=pp"></script>
EXAMPLE:
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<script language=javascript src="http://www.yourdomain.com/cgi-bin/youraff/com.cgi?n=pp"></script>
<input type="hidden" name="business" value="youremail@yourdomain.com">
<input type="hidden" name="item_name" value="Test Product">
<input type="hidden" name="item_number" value="874578">
<input type="hidden" name="amount" value="$1.00">
<input type="image" src="images/x-click-but22.gif" border="0" name="submit">
<input type="hidden" name="add" value="1">
</form>
For those having problems with the "Thank you" page with PayPal (not a YOURaff issue but anyway) we have included file ty.cgi. You can set it as the return parameter in
PayPal button HTML code - just add this line in the code (edit page URL!):
<input type="hidden" name="return" value="http://www.domain.com/path/youraff/ty.cgi">
and ty.cgi will redirect customers to the thank you page set in the Settings page after a successful purchase.
That's all there is to it! Make sure you change the URLs in the examples above!
Q: YOURaff isn't logging PayPal sales and adding commissions (a "HTTP error" is logged)!?
A: Please double-check the URL to paypal.cgi in your PayPal account. Set variable "Use secure IPN URL?" to 0 in the settings page and try again.
Q: What if someone finds the URL of the paypal.cgi script in my HTML source code and opens it? Will YOURcom count this as a sale?
A: Of course not, paypal.cgi script was written to protect you and knows the difference between a real sale and an illegal attempt!
Q: What if a customer reloads the Thank you page?
A: Don't worry, paypal.cgi logs all transaction ID numbers and compares new ones to the old ones to prevent doubled commissions!
Q: Can I give my affiliates a flat commission when using paypal.cgi?
A: Unfortunately not due to the way PayPal processes payments. We will try to find a way around this in the future and include it in the next update.
Q: But I already use some other IPN script - how do I implement YOURaff then?
A: Please read the "Double IPN issue" below.
You are already using some other IPN script with PayPal and would also like to use YOURaff, but PayPal lets you enter only one IPN script URL.
The solution is simple - all you have to do is go to the settings page in Admin area and set "Double IPN call for PayPal?" to 1 and
"URL of the other IPN script" to the URL of
your existing IPN script, ie.:
Double IPN call for PayPal? 1
URL of the other IPN script: http://www.domain.com/path/my_old_IPN_script.cgi
Then just set the IPN URL in your PayPal account manager
to paypal.cgi as described above ("PayPal integration") and both your IPN scripts will work!
>> Support
To request assistance
or ask questions please contact us!
Copyright notice and license
agreement
YOURaff™ 1.0 by YOURsoft. Copyright © 2002 YOURsoft. All Rights
Reserved. YOURaff™ is a registered trademark of YOURsoft.
WARNING: This Software is protected by copyright law and international treaties. Unauthorized reproduction
of this Software, or any portion of it, may result in severe civil and criminal penalties,
and will be prosecuted to the maximum extend possible under law.
With this license agreement you are allowed to use only one (1) copy of the Software.
For additional licenses please contact us!
YOURaff™ 1.0 ("Software") is licensed for use only
under the terms of this license agreement. Information in this document is subject to change
without notice and is provided for informational purposes only. The entire risk
of the use or results of the use of this Software remains with the user, and YOURsoft
makes no warranties, either express or implied. Complying with all applicable copyright
laws is the responsibility of the user. Without limiting the rights under copyright,
no part of this Software may be reproduced, stored in or introduced into a retrieval
system, or transmitted in any form or by any means (electronic, mechanical, photocopying,
recording, or otherwise), or for any purpose, without the express written permission of
YOURsoft.
YOURsoft reserves any rights not expressly granted to you.
To keep this license valid, you must ensure that the YOURaff™
copyright notice is left intact and is visible. You must also
keep all the copyright information intact in all the script
headers, and in the scripts themselves.
By using this Software you agree to the license agreement and are
bound by it. If you do not accept the license agreement, you are
prohibited by law from using this Software in any way.
Portions of this license agreement may refer to the Software as:
"YOURaff™".
For the purposes of this license agreement, "YOURaff™" is
the version 1.0 of the Software.