For AllAffiliatePro to be able to track sales, it needs to be integrated with your order form, shopping cart, or card processor. This ranges in difficulty from relatively easy, to noteably hard, depending on your server, and order processing system. Because of this we offer to do the integration for a small extra charge, click here for details of ordering. Below are the integration methods for the different order processing systems. Also included at the bottom of this page is the technical information of how AllAffiliatePro tracks sales, which could prove very useful if you are a programmer or have a tech guy you can fob this off to. If you want, you have the option to bypass this, and enter all affiliate orders manually through the management area. This is often used if you are running a Pay Per Lead program. Simply configure your order email so that it includes the Environment variable HTTP_COOKIE ($ENV{'HTTP_COOKIE'}), if the lead was referred by an affiliate, the affiliates username will be included in the email.
If you are using both a shopping cart and a card processor then it is usually easiest to integrate through the card processor.
Order Forms
If you are using a simple form to email ordering system, then integration is relatively simple. Included
in the AllAffiliatePro zip is a modified version of Matt Wrights formmail.pl script. If you are using a
different order form script then you will need to view the Technical information section below. The latest
editing informatin will be within the formmail.pl script. Please edit the script, and copy accross your
configuration, you will also need to set the variable $COSMIC{'amount'} to the value of the product ordered
on this order form. If you have multiple products then you will need to change the code so that this
variable is loaded with the total amount of the products ordered. Then upload the script to your server,
chmod 755, and check that it works before replacing your current script. Using this script, you still need
to make changes to your order form, and thankyou page. On your order form page you need to change the
hidden form field "redirect" to a relative system path rather than a URL. Example below:-
<input type="hidden" name="redirect" value="http://www.cv-writers-affiliate.org.uk/thankyoupage.html">to
<input type="hidden" name="redirect" value="../thankyoupage.html">This is because the customer is no longer redirected to the thankyou page, but the thankyou page is read, parsed and displayed by the script. If you have problems with only a blank page being displayed when the order form is submit, then this is because you have input the incorrect server path to your thankyou page.
On your thankyou page you need to add the following HTML img tag to the page:-
<img src="http://www.cv-writers-affiliate.org.uk/cgi-bin/clickme2.cgi?id=::id::&amount=::amount::" height=1 width=1 border=0>This calls the script clickme2.cgi which is AllAffiliatePros order tracking script. The ::id:: and ::amount:: are swapped for the correct values by the script. When an order is placed you will now have 2 extra fields on the order email, named AFFILIATE and AFFILIATE_ORDER_ID. If you have your formmail.pl script installed and running on a secure server this causes another problem, as the order tracking script must also be called from a secure server, and so must the click tracking script. New special configuration needs to be done. Please view the section below "The Secure server problem". Otherwise your order tracking is now setup.
Shopping Carts
If you are using a shopping cart on your site, integration can be anything from very easy, the
relatively hard.
1. If you are lucky you will have a shopping cart which has a form in it's configuration where you
can input the affiliate link. This is usually labeled as "Affilate tracking URL" or something similar.
Input into this form the URL:-
http://www.cv-writers-affiliate.org.uk/cgi-bin/clickme2.cgi?id=ORDERID&amount=ORDERAMOUNTWith ORDERID and ORDERAMOUNT replaced with your shopping carts equivalent symbols. On the page it should tell you which symbols the shopping cart uses to input the relevant data for each order. If your shopping cart requires that you call clickme2.cgi from a secure server, then please read the section later on this page named "The Secure server problem", for special configuration.
2. If you are quite lucky then you will have a shopping cart which allows you to configure the order complete html output, by editing a template. This is also refered to as a thank you for your order page, or a order/transaction receipt page. On this page you need to insert the following HTML tag:-
<img src="http://www.cv-writers-affiliate.org.uk/cgi-bin/clickme2.cgi?id=::id::&amount=::amount::" height=1 width=1 border=0>The symbols ::id:: and ::amount:: must be replaced with those which are specific to your shopping cart. Your shopping carts documentation should contain which symbols to use. If your order complete page is displayed on a secure server then you will need to call clickme2.cgi securely to prevent a "Page contains insecure items" error, and insure correct order tracking. Please read the section later on this page named "The Secure server problem", for special configuration.
3. If you are very unlucky then your shopping cart does not allow you to do either of the above. The only way to integrate then is to modify your shopping carts coding. Please view the section "Technical Information" below, also read the section "The Secure server problem".
For Actinic integration please visit the following URL:-
http://www.allaffiliatepro.com/support/integration_actinic.html
Card Processors
If you are using a Card Processor on your site, then integration if often quite simple. We have a list
of card processors with their integration methods online at our site to ensure you are getting the most up
to date information. If your card processor is not listed, then we will work with you to get it listed.
Please visit the following URL:-
http://www.allaffiliatepro.com/support/integration.html
The Secure server problem
If your order form is hosted on a secure server, your shopping cart order pages are secure, or your card
processor only permits the tracking script to be called secure, then this poses a problem. The solution
depends on the type of secure server your hosting company provides. If your hosting company provides you
with a secure server under your own domain name, such as:-
https://www.cv-writers-affiliate.org.uk/
The solution is simple, all you need do is add the 's' to the http:// when inputing the line to call
clickme2.cgi.Such as:-
<img src="https://www.cv-writers-affiliate.org.uk/cgi-bin/clickme2.cgi?id=::id::&amount=::amount::" height=1 width=1 border=0>or
https://www.cv-writers-affiliate.org.uk/cgi-bin/clickme2.cgi?id=ORDERID&amount=ORDERAMOUNTAnd you can skip the rest of this section.
If your hosting company provides you with a secure server under a different domain, such as their own domain:-
https://www.yoursecurehost.com/yourusername
The solution is more complicated making integration a bit trickier to setup. This also affects the click tracking script, as the tracking cookie needs to be set under the secure domain. The solution is two new scripts included with AllAffiliatePro named click.cgi and click2.cgi, which need to be independantly configured and uploaded to your secure server along with cosmic.pm and p3p.xml. Described below is how to setup click.cgi and click2.cgi:-
- Click.cgi
-
Edit this file using notepad or a similar editing package. Set the correct path to perl for your secure server, change the line:-
$programurl = "http://www.yourserver.com/cgi-bin/affiliate/clickme.cgi";
To the location of clickme.cgi on your server. This is:-
$programurl = "http://www.cv-writers-affiliate.org.uk/cgi-bin/clickme.cgi";
Also change the line:-
$commissionperiod = 30;
To the commission period you have setup in the variables configuration.
Then change the link:-
$policyurl = "https://www.yourserver.com/p3p.xml";
To the location of your p3p reference file on your secure server. You should take this file from it's location:-
http://www.cv-writers-affiliate.org.uk/p3p.xml
and upload it to the secure server along with the other files. The file click.cgi is now ready to be uploaded to the secure server. - Click2.cgi
-
Edit this file using notepad or a similar editing package. Set the correct path to perl for your secure server, change the line:-
$validdomains = "yourdomain.com";
To the valid domains you have listed in your variable configuration. And the line:-
$pathtoclickme2 = "http://www.yourserver.com/cgi-bin/affiliate/clickme2.cgi";
To the path to clickme2.cgi on your server. This is:-
$pathtoclickme2 = "http://www.cv-writers-affiliate.org.uk/cgi-bin/clickme2.cgi";
Next select whether you want the referer accuracy to be tracked. By setting the following line to 1 ro 0.
$accuracy_referer = "0";
And set whether you want to Block invalid domains on sales tracking. Default is 0.
$referer_block = "0";
Then change the link:-
$policyurl = "https://www.yourserver.com/p3p.xml";
To the location of your p3p reference file on your secure server. You should take this file from it's location:-
http://www.cv-writers-affiliate.org.uk/p3p.xml
and upload it to the secure server along with the other files.
You will need the IP address of your server added to your valid domains list in your variable configuration for this tracking to be accepted by clickme2.cgi. If you dont know your IP address then this can be obtained later from the orders error log. The file click2.cgi is now ready to be uploaded to the server.
Upload the files click.cgi, click2.cgi, p3p.xml and cosmic.pm to your secure server. Chmod all files 755
(Win32 Execute permissions).
You need to edit your configuration variables, and set the "Secure cookie tracking required" to "On". You
also need to input the URL to where click.cgi and click2.cgi have been uploaded to your secure server in
the variable "Secure URL". Now (finally) change the clickme2.cgi calls, to secure click2.cgi calls, such
as:-
<img src="httpS://www.yoursecurehost.com/yourusername/cgi-bin/affiliate/click2.cgi?id=::id::&amount=::amount::" height=1 width=1 border=0>or
httpS://www.yoursecurehost.com/yourusername/cgi-bin/affiliate/clickme2.cgi?id=ORDERID&amount=ORDERAMOUNT
Technical information
The files clickme2.cgi and click2.cgi are used to track sales.
Clickme2.cgi can be called by either mehtod GET or POST. The method GET is usually done using a 1x1 img
tag, such as:-
<img src="http://www.yourserver.com/cgi-bin/affiliate/clickme2.cgi?id=::id::&amount=::amount::" height=1 width=1 border=0>::id:: and ::amount:: need to be swapped for the specific order transaction details. The clickme2.cgi script then checks for the affiliate tracking cookie, and/or check the IP tracking. When called using the method POST, you can configure the variable names which are passed to the script containing the order ID and amount. This can be done from the variable configuration section of management.
Click2.cgi can be called by method GET. It grabs the affiliate cookie (if it exists) from the secure server, and the IP address, and passes this information over to clickme2.cgi by the method POST, to a special sub-routine in clickme2.cgi named click2. It uses LWP to make this call. For a code example of how this is done, and exactly how the information needs to be passed, look in the file click2.cgi.
Please continue to the next section Testing the system