Retired Documentation:  You are using the documentation for version 1.7.3 which was retired in 2013. Go here for the latest version documentation or check here for your available upgrades to the latest version.

Referrer Module Tags

ExpressionEngine enables you track referrers with the Referrer Module.

A referrer is the URL that led a someone to your site.  For example, if the URL to your site appears as a link at your friend's site, when someone clicks the link, your friend's URL will show up in your referrer page. Tracking referrers allows you to see how people are finding your website.

To access the Referrer Module backed functions, go to the Modules > Referrer page in your Control Panel.

To globally disable referrer tracking, as well as set the maximum number of referrers to keep, visit the Admin > System Preferences > Referrer Preferences page in your Control Panel.

To display your referrers information use the following code in one of your templates:

<table border="0" width="100%" cellpadding="6" cellspacing="1">
<th>IP Address</th>

{exp:referrer limit="50" popup="yes"}
<td>{ref_date format="%m/%d/%Y"}</td>


Note: You enclose from the opening <tr> to the closing </tr> since that is the portion that gets repeated for each referrer.

Blacklist and Whitelist

ExpressionEngine maintains an editable Blacklist so that you can keep certain IP addresses, URLs, or even User Agents from being counted in your referrals as well as a Whitelist that will automatically let matches through. You may access this through the Blacklist/Whitelist Module in the Modules area.




The number of results you want to see



This parameter makes the link to the referring site open in a new window.




The user agent that made the referral to the site. For most cases, the "user agent" is simply a web browser that visited your site. The {ref_agent} variable outputs the full user agent string recorded by ExpressionEngine. It might look something like:

Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)

Which is the common user agent string for Internet Explorer 5.5 running on a Windows 2000 machine.



A shortened version of the user agent that made the referral to the site.It might look something like:



{ref_date format="%m/%d/%Y"}

The date on which the referral was made.



The URL of the referring site.



The IP address of the referring site.



The URL of the page they arrived from.



This variable permits you to alternate between any two values as the entries are displayed. The first entry will use "option_one", the second will use "option_two", the third "option_one", and so on.

The most straightforward use for this would be to alternate colors. It could be used like so:

{exp:referrer limit="50" popup="yes"}
<tr class="{switch="one|two"}">

The entries would then alternate between <tr class="one"> and <tr class="two">.

Multiple instances of the {switch=} tag may be used and the system will intelligently keep track of each one.

Top of Page