WordPress Plugin: UniqueVisitors…

Sometimes only having access to an IP address is just not sufficient enough for tracking your anonymous visitors. Maybe you want to view all the activity of one individual visitor moving between WiFi spots, or a spammer who is spoofing his IP address across a range of legitimate IP addresses, or a dialup or DSL user who acquires a dynamic (changing) IP address each time she logs on the Internet. The UniqueVisitors plugin was created to help provide a mechanism to consolidate those disparate logs into something more useful.

Once the plugin is activated, server logs will include a request to /images/spacer.gif with a unique ID as a parameter. The image doesn’t have to actually exist on your server, but you can add one if you like in order to reduce the number of “404 errors” on your website. This number is also available to you programatically (you have to write your own PHP code to use it, which I won’t assist with!) so you could even redirect specific individuals to wherever you want, if you chose to do so. Want to see the plugin in action? View the source of this web page, and look at the last few lines of code.

To install it, simply put the contents of the UniqueVisitors plugin file (changing the name from *.txt to *.php) into your wp-content/plugins/ folder. Activate the plugin in the WordPress Plugin Admin panel like you would any other plugin. You’ll start seeing the unique references to /images/spacer.gif in your raw web server log with your first visitor!

As always, this plugin is provided as-is, without any warranty of any kind, express, implied or otherwise, including without limitation, any warranty of merchantability or fitness for a particular purpose. In no event shall I be liable for any special, incidental, consequential or indirect damages of any kind, or any damages whatsoever resulting from loss of; use, data or profits, whether or not advised of the possibility of damage, and on any theory of liability, arising out of or in connection with the use or performance of this plugin.

History
0.99 — original version
0.99a — added ALT tag to image to make it valid XHTML 1.0 Transitional

If you liked this, you might also be interested in:

Responses

Contribute to the Conversation: