Successful affiliate marketers know that tracking what your visitors click on
and where they came from is crucial to making money. This article will teach
you what you need to track and how to track it.
Where The User Came From
Knowing this question is so important. I don't mean, what search engine did
they come from. You need to know what they typed in the search box to get
to your website and then what did they click on when they left. Users could
come from search engines, email, other peoples websites, or from just typing
in your website url.
To track where the user has come from takes a little bit of software programming. Hopefully,
you have some type of include file for the top of every page. Here is the basic
logic of the programming:
- If the user's
HTTP_REFERER does not have the string of your website domain name
- Then, write a cookie (365 day cookie) to the user's browser
- The cookie will contain the
HTTP_REFERER
This cookie will then contain only the external website url of where the user was before coming
to your website. Excellent information to know. When a search engine refers a user over
to your website, they include the keyword phrase that the user typed in to get to your website.
Tracking Your User's Clicks
Now, the user will view content on your website and may browse around. Since the
affiliate ads are the most important item to track, you need to alter the href code
to track the user. NOTE: This will require some type of database (SQL, Access, MySQL, etc).
We recommend sending all your affiliate program traffic to one webpage. This
webpage will take in 2 items of querystring information, LinkID and InternalURL.
When a user clicks on an affiliate ad, send them to your link tracker like so:
Track.php?linkid=4&internalurl=http://www.yoursite.com/page1.php
Then, when the page loads take the LinkID, InternalURL, and cookie ReferrerURL information
and save it to the database and redirect to the url that corresponds with the LinkID
passed in. We also recommend tracking the DateLinkWasClicked and IPAddress of the
user.
Data Structure
Here is the database structure:
TrackingLink
TrackingLinkID
RedirectURL
TrackingHit
TrackingHitID
TrackingLinkID
ReferrerURL
InternalURL
PPCKeywords (We will get to this later)
IPAddress
DateCreated
Click Tracking Reports
We also recommend creating a report for yourself that shows all the click information
for the past 24 hours. This will help you know what is working and what is not. You
will also know all the keyword phrases that are resulting in an affiliate program click
for you.
PPC Campaign Tracking
If you are using Pay Per Click, you can also track that by appending a querystring variable
to all of your ads like so: http://www.yoursite.com/?keywords=My_Keyword_Phrase.
Next, on your homepage (or whatever page your ads point to), make sure to save the keywords
querystring information to a cookie. Then, when you save your tracking click, pass in that
information on the insert to the database as well.