Create perfect tracking links with your .htaccess file

How to create perfect tracking links with .htaccess file

AffiliationSoftware allows you to choose between 7 different Ref-link formats. But if this is not enough, here is a short tutorial that explains how to create perfect tracking links, seo-friendly and easy to remember!


Generate the affiliate tracking link in AffiliationSoftware

To create perfect tracking links you first need to access the affiliate panel and go to the Banners & Links page. Then select the desired link and copy it.

You can also create multiple links for the same affiliate by assigning a different channel to each one, the statistics will be split accordingly.

Affiliate panel > Banners & Links > Show / hide banner code

Create perfect tracking links


Customize the tracking link with the .htaccess file

With the .htaccess file it is possible to customize any tracking link by redirecting it with one of your choice.

Here’s an example. We want to create beautiful links to our best affiliates and some of our internal campaigns, these:

https://www.affiliationsoftware.com/jane
https://www.affiliationsoftware.com/adwords
https://www.affiliationsoftware.com/social

To track sales and measure the results achieved on these links we need to make them tracking links. To do this, we can redirect each link to an existing ref-links of our affiliate program.

In this way, when “https://www.affiliationsoftware.com/social” is clicked, it will actually be redirecting to the ref-link of a specific affiliate “https://affiliation.software/demo/c?a=1&b=33950&c=social”.


Example of a .htaccess file with custom tracking links

One of the easiest ways to do the above is to edit the .htaccess file of your website.

Just open the .htaccess file and add this code, then edit the highlighted parts as explained below:

# affiliationsoftware.com - custom tracking links
# explanation:
# RewriteRule ^DESIRED_LINK_NAME$ COMPLETE_REF_LINK [L]
RewriteEngine On
RewriteRule ^jane$ https://affiliation.software/demo/c?a=123&b=33950 [L]
RewriteRule ^adwords$ https://affiliation.software/demo/c?a=1&b=33950&c=adwords [L]
RewriteRule ^social$ https://affiliation.software/demo/c?a=1&b=33950&c=social [L]

The only disadvantage is that you have to insert the links manually, so we recommend you to only add the best links, those that are really worth monitoring. We use this technique to monitor our adwords, ppc and social campaigns.

An advantage is surely that you will be able to modify the ref-link and the desintation url without asking the affiliates to change their links. At the same way if those rules are removed from the .htaccess file the links will no longer work, and would most likely return a 404 error.