The Referrer System lets you list the sites that sent visitors from their page to your page. This service, through the use of two JavaScript commands, allows you to gather referrers from as many pages of your web site as you wish, while listing the referrers on one or more pages.
This is a free service. The actual referrer data is hosted on the Python & CGI Programming site. If you prefer, you can download the JavaScript and Python scripts and install them yourself.
I have no idea which particular web sites will be listed as referrers. These web sites sent visitors to any of the pages of the Python & CGI Programming web site that had the JavaScript code used to gather referrer information, not just this page.
I've chosen to list referrers from the last 90 days. Your website will probably get more traffic, so you may want to list referrers for fewer days. You can also limit referrers by the minimum number of references and by absolute number (list only the top 20, for example).
The referrer web site name is a link back to the referrer web site. You can click on it to see where your visitors are coming from, or to check out the link reference to your website. If the referrer is a search engine, the main page of the search engine is referenced.
The number following the web site title in the referrer list is the total number of references, not the number of references in the 90 day period.
To try this out, place the following JavaScript on every web page for which you want to gather referral statistics. You don't need to change it at all. I recommend placing it at the bottom of the web page so it loads last.
<script type="text/javascript" language="JavaScript"
src="http://www.python-cgi-programming.com/referrers.js">
</script>
Place the following JavaScript on the web page you want to list the referral statistics. This is the same code I used to generate the referrer listing on this page.
<div style="overflow:hidden;text-overflow:ellipsis">
<script type="text/javascript" language="JavaScript"
src="http://www.python-cgi-programming.com/referrerlist.js">
</script>
<script type="text/javascript" language="JavaScript">
<!-- Set referrer list variables and call list function
var min = "1" /* Minimum number of references to be listed */
var exp = "90" /* Number of days since last reference */
var lim = "0" /* Maximum number of references to list
( 0 = list all references) */
write_ref(min, exp, lim);
// -->
</script>
</div>
The <div> code is not required. The local style will truncate the name of the referrer websites if they're too long for the space allotted on your web page.
The three JavaScript variables allow you to adjust the number of referrer web sites listed. The first variable, min, is the minimum number of references from a web site before it's listed. The second variable, exp, is the number of days since the last reference. You'll probably want to use a smaller number than 90. The third variable, lim, is the maximum number of references to list. For example, you may only want to list the top 20 referrers. If this variable is set to 0, then all of the references that meet the criteria of the first two variables will be listed.
You can put the referrer list JavaScript on more than on page of your web site. For example, you may want to list seven days on your index page, and list thirty days on a separate link page.
The referrer list generated by JavaScript allows for three class definitions in your Cascading Style Sheet; rhead, rname, and rcredits. The rhead line is the header line. The rname lines are the referring web page lines. The rcredits line is the final line of the referrer list. Here are the references for the referrer list displayed earlier on this page:
.rhead {font-size:small; padding-bottom: 12px}
.rname {font-size:x-small; padding-bottom: 12px}
.rcredits {font-size:small; padding-bottom: 12px}
If you don't specify list class definitions, the referrer list text will take on the properties of the rest of your web page.
If you have any suggestions for improving the Referrer System, you can write me here.
A more technical explanation of the Referrer System, along with download links, can be found on the next page.
Top Page: Index, Next Page: Referrer System Technical Explanation