What is a Referrer?

Who is Driving Visits to Your Site

Referrers are like secrets
Referrers are like secrets. Image courtesy Taxi / Getty Images

An “http referrer”, often simply referred to as the “referrer”,  is any source online that drives visits and visitors to your website. These may include:

  • search engines
  • links from other websites
  • social media
  • online ads
  • email markreting campaigns
  • affiliate links
  • links built into software

Whenever someone visits your site, one of the pieces of information recorded is where that person came from. This is usually in the form of the URL of the page that they were on when they came to your page - for instance, the page they were on when they selected a link that then brought them to your site.

If you know that information, you can often go to the referring page and see the link they clicked or tapped 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. That obviously makes those offline referrers harder to track (I do have a trick for this, which I will present later in this article). Typically. when a web developer uses the term “referrer” they are referencing online sources - specifically those sites or services that are referenced in the referrer log.

Tracking Referrers is Harder Than it Seems

You may think that because referrers are recorded in the server log (combined log format) of most web servers that they would be easy to track. Unfortunately, there are some big hurdles to overcome to do this:

  • Search engines provide information in their referring URL such as search terms used or the directory section the customer was in. In some cases, that search term information is not even transmitted due to security concern. This means that the URL is usually a lot more complicated than simply http://webdesign.about.com/.
  • 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.
  • This same trick of using a URL unique to a campaign can be used for those aforementioned offline sources (print ads, radio, etc.). If you use a URL like http://webdesign.about.com/magazine-name, and you only use that URL for one specific magazine, you know that any traffic to that page (which you can find in Google analytics or a similar program) came from that source.

Back too those logs, you should be aware that 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.

Original article by Jennifer Krynin. Edited by Jeremy Girard on 10/9/16