And whenever someone visits your site, one of the pieces of information recorded is where they came from. This is usually in the form of the URL of the page that they were on when they came to your page. Then you can often go back to that page and see the link they clicked on to get to your site. This log is called a “referrer log.”
Technically, even offline sources like print advertisements or references in books or magazines are referrers, but rather than listing a URL in the server referrer log they are listed as “-” or blank. When a web developer uses the term “referrer” she means those sites or services that are referenced in the referrer log.
Tracking Referrers is Harder Than it Seems
You would think, that because referrers are recorded in the server log (combined log format) of most web servers that they would be easy to track. But there are some big hurdles to overcome:
- Search engines provide information in their referring URL such as search terms used or the directory section the customer was in. This means that the URL is usually a lot more complicated than simply
- And, once that information is there, chances are you’ll want to know what terms people are searching for when finding your site, so you need to parse that information along with the URL.
- On the other extreme, email links and links from software may not provide much information at all on the referring URL. (In fact, some software and email clients deliberately mask the referrer, so that you can’t track them.) To get around this, when doing email marketing, you should include something in the URL that identifies it as an email or software link. For example:
http://webdesign.about.com/?ref=email. This also works for links inside software. But like the search engine referrals, you will then have to parse that information from your logs.
Not all log entries have referring URLs listed in the entry. This can mean several things:
- The customer typed in the URL by hand
- The customer had the page bookmarked
- The customer was using privacy protection software that blocked the referrer
- The referring site is blocking referrer information
Where is the Referrer Stored?
Web server logs track the referrer, but you have to set up your logs to be in Combined Log Format. The following is a sample log entry in Combined Log Format, with the referrer highlighted:
10.1.1.1 - - [08/Feb/2004:05:37:49 -0800] "GET /cs/loganalysistools/a/aaloganalysis.htm HTTP/1.1" 200 2758 "http://webdesign.about.com/" "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; YPC 3.0.2)"
Adding referrer information in your log files makes them larger and harder to parse, but that information can be very useful for determining how your website is doing and how well your marketing campaigns are performing.
Get more information about the HTML referer: What is a Referer | Why is Referrer Spelled "Referer" in Web Devlopment? | What is My Referer | Test Your Browser for the Referer | How to Use the Referer on Web Pages | How and Why to Hide Referer Information | What is Referer Spam | How to Block Referer Spam | What is Referer Spoofing? | What is the
rel=noreferrer Attribute | What is the DOM