# Referrers for DokuWiki

This plugin logs referrers for your site, so you can see where your traffic comes from. The log will be located at wiki:referrers, so you will need to create that page for this plugin to work.

Currently the superuser will not be logged, along with some search engines and some referrer spammers. This will all be configurable in a future release.

The plugin also exports a function for use with your template, so you will have to insert the following code into your template, somewhere inside of the <head></head> tags.

Typically you'll want to do this for any PHP (or HTML) files containing the string "<head>"; at a minimum you can do just main.php. 1)

<?php
if (file_exists(DOKU_PLUGIN.'referrers/code.php')) include_once(DOKU_PLUGIN.'referrers/code.php');
if (function_exists('re_log_referrers')) re_log_referrers();
?>

Note: Inserting the code above is required, not optional.

Template Authors Note: You can insert the above code and make your template “Referrers Ready", even if your users do not use Referrers for DokuWiki (or have this plugin.)

## Install

As a plugin all you need to do is unpack the file into the lib/plugins/ directory (you should end up with a lib/plugins/referrers folder.)

Remember to create a page in the wiki namespace called referrers.

To upgrade, remove the original lib/plugins/referrers folder, and install the new version as instructed above. You may wish to make a note of your settings first though.

## What's New

April 29, 2007

• More referrer spam blocking is in place.
• Better support for not logging spiders and search engines.
• Non-standard browser/client IDs will also get logged.

September 3, 2006

• Initial release
1)
If you only do main.php though you'll miss some hits to certain types of pages, so I suggest searching for head tags through all the php files in a template to make sure you get them all.