Copyright 2003, All rights reserved.
Any comments, suggestions, or mistakes:

Replicating Websites with Ultimate Affiliate

Replicated websites are an advanced feature of Ultimate Affiliate, requiring that you have some prior knowledge of HTML, cgi scripts, and your payment processing system. Plus, it's up to you to decide on and build the template website that will be replicated.


Ultimate Affiliate has the ability to replicate a "template" website for each of your affiliates. This site will be placed in a directory on your server named after the affiliate. So, for example, if you have it replicate a site for affiliate "joe" in your main web directory, he can send people to

Before I get into the thick of things, I'll say first that MOST affiliate programs use a cgi-based affiliate url that tracks by setting and reading cookies. This is the industry standard, and is the easiest to set up and use. The shortest cgi-based url is something like where g.o is actually the cgi script. Most people use something like


Replicated websites allow you to have the shortest url possible: If done properly, replicated websites could also ensure 100% affiliate tracking. The ONLY way to ensure 100% tracking is to NOT let people buy from your main website or domain and ONLY let people buy from replicated affiliate sites. Otherwise, a visitor could come to, but then realize it's an affiliate site and simply type in and make a non-affiliate purchase there.

With Ultimate Affiliate, you can also insert the affiliate's info into the web pages via special tags in the template site (%%Name%% , %%Email%%, etc...). The script also gives you 5 custom fields to use for any additional data you'd want to be able to insert into the replicated page.

Also, you can still track via cookies with replicated sites by including a little invisible image tag on the main replicated page (usually index.html) that triggers a "hit" in the system as well as sets the affiliate cookie in the visitors browser.


Replicated websites can potentially take up a lot of server space - especially if you are replicating a large website. Also, if you replicate the sites into your main web directory you'll accumulate a bunch of directories that will make administrating your site difficult - some FTP programs will be slow to load a directory containing 1000's of affiliate subdirectories. Also, every time you make a change to the replicated site you will have to "rebuild" the sites via a link in the Ultimate Affiliate main control panel.

With replicated sites, affiliates are sending people to static html web pages. Thus, you can not have the campaign tracking and the dynamic redirecting to different pages that you have with a cgi-based affiliate url. Of course, if you replicate the entire site, affiliate can send people to any page on that site.

Finally, replicated websites require some "web knowledge" to set up and you have to take some things into consideration: How will you trigger commissions? Will your replicated site be able to send the referring affiliate's name to your ordering system and then back to the affiliate program?

If your site depends heavily on cgi scripts - like a shopping cart, forums, etc.. - it would NOT be feasable to use replicated sites as things like this don't replicate well.

Step 1: Choosing the type of template site

There are basically three ways you can set up your replicated site:

1. Replicate a single "splash" page that will introduce the visitor to your site, track the "hit" in the system, and basically send the visitor on through to your main web page. Using this method you are relying on cookie tracking to award commissions - a visitor comes to the page, goes on to your main site, makes a purchase, and your payment system would trigger a commission and the cookie will be read by the affiliate program.

2. A second way to set up the site is to actually replicate your whole site, but still use cookie tracking for awarding commissions. This way the visitor stays within the affiliate's site the whole time and you can have all the pages customized with the affiliate's info. The commission triggering would still be done via an image tag or javascript tag in your payment system's "thank you" page that would look for the cookie and award the commission.

3. The last way is to completely replicate the site and ALSO tie it in with your billing system to award commissions. This could ONLY be done if your billing system can accept an extra variable (in this case the affiliate's username), carry it through the ordering process, and then send it back to the affiliate program. This would basically give you 100% affiliate tracking ONLY if you do not let people buy from your main site - only affiliate sites. This is also the most technically challenging way to set it up.

Step 2: Designing the template site

  • It's best to keep your replicated website as small, simple, and concise as possible.
  • The script can replicated directories and their contents, but typically it's best to not use directories and have all the files in one place.
  • To minimize server space do NOT replicate images. Put all your images in a directory (called "images" or something) and point to these images in your HTML template pages by using absolute links. This means something like this: <img src=> where you put the FULL URL to the image.
  • You can insert the affiliate's info into the HTML by placing these tags in your template pages:

%%year%% -- %%month%% -- %%day%% -- %%Sponsor%% -- %%Username%% -- %%Password%% -- %%Email%% --
%%Name%% -- %%Address1%% -- %%Address2%% -- %%City%% -- %%State%% -- %%Zip%% -- %%Country%% --
%%Company%% -- %%Sitename%% -- %%Siteurl%% -- %%Terms%% -- %%Checkname%% -- %%Phone%% -- %%Fax%% --%%SSNumber%% -- %%Field1%% -- %%Field2%% -- %%Field3%% -- %%Field4%% -- %%Field5%%

Step 3: Setting up the replicated site within Ultimate Affiliate

1. In the /cgi-bin/affiliates directory (or whichever directory you've put the cgi scripts in) you will create a folder called "templates" and set the permissions of this directory to 777. Then, simply FTP the template site files into this directory and chmod them 777 too.

2. In order to track a "hit" in the affiliate system, you will place an image on the main replicated page (which is always index.html or index.htm) that will be calling the clickthru.cgi script. The clickthru.cgi script will be Executed as an image which is a YES/NO setting at the admin.cgi configuration page. You must also have the Server path to the invisible.gif file set as well - that variable is in the commission variables of the admin config.

3. In your index.html file, the image tag will be placed:

<img src= border=0>

Where the %%Username%% tag will be replaced with the referring affiliate's username. This image will now trigger a "hit" in the system when the main replicated page is loaded.

4. You will need to configure the replicated site variables at the admin configuration page:

  • FULL server path to template site: This should be the FULL SERVER PATH to the /template directory.
  • FULL server path to replicated site: This should be the FULL SERVER PATH to the directory you want the affiliate sites created in. If it's your main web directory, it's usually called the www or html directory (ie. /home/yoursite/www - this is JUST AN EXAMPLE). You can find the specific server paths on your server using my helper.cgi script. I recommend putting the replicated sites within a subdirectory so you don't clutter up your main web page: /home/yoursite/www/sites or something similar.
  • Create a replicated page/website: Turn this variable on.

5. Finally, you will now edit the Url to clickthru.cgi variable to go to the replicated website:<username> or<username> are two examples. Make sure to NOT set clickthru.cgi to execute as a directory (that is for cgi-based urls).

Step 4: Integrating with your payment system and registering commissions

There are probably over 50 good payment/billing processors out there, and over 100 different shopping cart products on the market that integrate with them - thus, there MANY different types of setups and integrating the affiliate program with each one will be different.

You can visit the Ultimate Affiliate instructions page by clicking here. This will outline the standard ways of triggering commissions based on cookies. Here I will only outline the way you could potentially trigger commissions with replicated websites.

If you replicate a website, you can replicate the order form page as well (once again, if you use a cgi-based shopping cart you shouldn't be using replicated websites unless you know what you're doing...) and in that page you'll put your order buttons or the order form. You will include the affiliates name in the order button or form using the %%Username%% tag - but YOU MUST know how your order system works and IF IT CAN EVEN accepts extra variables and store or pass them on to the affiliate program. Not all systems are compatible, but at this point in time Paypal, 2Checkout, and Paysystems are some processors that are compatible. So are some merchant account systems like and

Once this value is sent to the ordering system, you could trigger commissions via an image tag or javascript tag - or send the buyer to sale.cgi directly. You can send along the affiliates name and trigger a commission for that affiliate. For example:

Will trigger a commission for the AFFILIATE which should be replaced by the affiliate's username you sent to the system. There are many ways to trigger the commission, but the main goal is have the url above executed by your ordering system in order to make it happen...

Step 5: Administering your replicated sites

Once everything is set up, there is minimal work needed to maintain the replicated sites. They should be created when a new affiliate signs up, and edited when you or the affiliate edits the affiliate info. However, the replicated sites will NOT change when you edit the template site. For this, you must use the "rebuild" feature at the administration page.

So, after you've edited your site you'll just go to the admin page and click on the "rebuild" link at the top of the page. There, you will prompted to either rebuild all the sites at once or in increments. If you have a lot of pages to your replicated site, the slower the process will be and the more server resources will be taken up. If you have a huge site you should probably replicate it in increments of 50-100 at a time to prevent the system from stalling. If you're just replicating a single page you can probably get away with rebuilding them all at once. Just sit there and let the script run, and the results will be printed to your browser.

© 1998 - present, All Rights Reserved