VisitorLog

Realtime Visitor Logging & Statistics

VisitorLog Screenshot

VisitorLog is a web application that shows you who's on your website right now, and everyone who has visited before.  It logs all your visitors and displays them for you in a constantly-updating table on a private password-protected page.  It logs not only your visitors' hostnames & IP addresses, but lots of other useful information about them, like where they came from, how long they stayed, what they're looking at on your site, and more. 

VisitorLog also includes a stats page which displays detailed breakdowns of your site's audience, showing you which browsers are most popular amongst your visitors, which pages are most popular, how many visitors you've had in each day/month/year, and much more.

VisitorLog will silently (invisibly) log all your visitors, but if you'd like, you can also choose to display a short Recent/Online Visitors list, a daily-visitors graph, or a box for your visitors to enter their names.  Here are some sample screenshots:

VisitorLog Sample Screenshots

Sample Pages

Download

You should download and test the trial version on your server before purchasing the full version.  The trial version is identical to the full version in all aspects necessary for testing performance and compatibility with your server.  But it does have other limitations, including:

  • no password protection, no stats page, no display of total-visitor-count
  • no automatic splitting/archiving of the visitors table
  • hostnames and referers (referrers) are not logged
  • only displays 1 day's worth of visitors

Purchase

To get the full version of VisitorLog, please choose your license type below.

VisitorLog Full Version:
Personal Website License: 1-site
$19.99
add to cart
Non-Personal Website License: 1-site
$39.99
add to cart
Non-Personal Website License: 3-site
$89.99
add to cart
Non-Personal Website License: 10-site
$249.99
add to cart
Instant credit card payments through PayPal.
No sign-up required!

Note: a Non-Personal Site is one that is commercial, academic, organizational, community, government, etc.

Installation Instructions

Want us to install it for you?  Just purchase the VisitorLog Installation Package.  We also provide customization and integration services -- just ask!

On your website:

  1. Upload the visitors.cgi script to the /cgi-bin/ folder.  (If installing the trial version, rename visitors.txt to visitors.cgi.)  You could also name it visitors.pl, or in fact, anything.cgi or anything.pl.
  2. Chmod the visitors.cgi script to 0755 or a+x (world-executable).  Do NOT use 0777 (world-writable).
  3. Open the visitors.cgi script in a text editor, adjust the hard-coded variables at the top, and set the database preferences.  (The script will create the necessary database tables for you.)
  4. Create the folder /cgi-bin/vldata/ and set the permissions on it to world-readable, -writable, and -executable, that is, a+rwx or mode 0777.  On Windows servers you may also need to set a separate "Delete" bit.
  5. In your browser, go to yoursite.com/cgi-bin/visitors.cgi and follow the brief instructions that it gives you.
  6. Add the following lines to the <head>...</head> section near the top of every page on your site:

    <script type="text/javascript" src="/cgi-bin/visitors.cgi?js"></script>

    <link rel="stylesheet" type="text/css" media="all" href="/cgi-bin/visitors.cgi?css" />


    Of course, if your site uses a standard header file (header.php, header.shtml, etc) or template which is automatically included in every page on your site, then you can just add the above lines to the header/template file.  (Contact us if you'd like to learn how you can get such a standard header/footer set up on your site, so that you never have to go through and edit every single file again!)
  7. Now you just need to add one more line somewhere within the body of every page on your site.  If you only want to log visitors (and not display a list of online/recent visitors on every page), and if the pages on your site are .html or .shtml (SSI) pages, then the line you need to add is:

    <!--#include virtual="/cgi-bin/visitors.cgi?$QUERY_STRING" -->


    If your server does not support the virtual() function, you may be able to use #exec cgi instead.  This method may not pass along the query-string, but depending on your needs that might be OK.

    <!--#exec cgi="/cgi-bin/visitors.cgi" -->


    Or if the pages on your site are PHP pages, then you can use either one of these methods:

    Method A: add this line to your pages:

    <?PHP virtual("/cgi-bin/visitors.cgi"); ?>

    Method B: save this file as call_visitorlog.php in your website's document-root (its top level), and then add this line to your pages:

    <?PHP require($_SERVER['DOCUMENT_ROOT'] . "/call_visitorlog.php"); ?>

    PHP users, if your server doesn't seem to be passing the query-string on to the CGI script, try adding either ?$_SERVER['QUERY_STRING'] or just ?$QUERY_STRING after visitors.cgi or call_visitorlog.php, within the virtual()/require() call.


    (Note: you cannot use the PHP include("http://mysite.com/cgi-bin/visitors.cgi") method to call VisitorLog.)

    If you're in the sorry state of having a server that doesn't support PHP nor SSI/shtml, then you can enable the $PREF{allow_URI_and_REF_on_query_string} option.  But that should only be used as a last resort, because it's susceptible to spoofing.
  8. (Optional) If in addition to logging every visitor, you want to display a list of online/recent visitors on every page, like this:

    online visitors screenshot

    ...then just add ?showoutput=N to the lines above, like this:

    PHP users:
    <?PHP virtual("/cgi-bin/visitors.cgi?showoutput=8"); ?>

    SSI users:
    <!--#include virtual="/cgi-bin/visitors.cgi?showoutput=8&$QUERY_STRING" -->


    ...where 8 is the number of visitors you want to be displayed.  In this case, you will also need to open visitors.cgi in a text editor, go to the hard-coded variables section at the top of the file, and adjust the value of the $lines_of_output_to_display variable.

VisitorLog is now installed and logging visitors for you.  To view the full VisitorLog and see who's on your site in realtime, go to yoursite.com/cgi-bin/visitors.cgi?mode=full.  And to see the statistics for your visitors, go to yoursite.com/cgi-bin/visitors.cgi?mode=stats.

Optional Features

  • Nice, short URLs: If your server supports SSI (via .shtml files) and/or PHP, and you want to be able to use mysite.com/visitors/ instead of mysite.com/cgi-bin/visitors.cgi?mode=full (and mysite.com/vstats/ instead of mysite.com/cgi-bin/visitors.cgi?mode=stats) to access the script, then do this:

    SSI users (most servers support this):
    Create /visitors/index.shtml (and /vstats/index.shtml) and put this line in it:

    <!--#include virtual="/cgi-bin/visitors.cgi?mode=full&$QUERY_STRING" -->

    (or ?mode=stats)

    If you're running Apache, you may also have to put these lines into your .htaccess file:

    DirectoryIndex index.shtml index.php index.html index.htm
    Options +Includes
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml

    PHP users:
    Create /visitors/index.php (and /vstats/index.php) and put this line in it:

    <?PHP virtual("/cgi-bin/visitors.cgi?mode=full"); ?>

    (or ?mode=stats)

    PHP users, if your server doesn't seem to be passing the query-string on to the CGI script, try adding either ?$_SERVER['QUERY_STRING'] or just ?$QUERY_STRING after the .cgi in visitors.cgi, within the virtual() call.  Also, if the virtual() call doesn't work on your server, try using include() instead, possibly with the full URL (including http:// and domain name) to the script.
  • Allow visitors to enter their names: If you want to display a small box for your visitors to enter their names, like this:

    enter your name box screenshot

    ...then just add this line wherever you want the box to go:

    PHP users:
    <?PHP virtual("/cgi-bin/visitors.cgi?getname"); ?>

    SSI users:
    <!--#include virtual="/cgi-bin/visitors.cgi?getname" -->


    And if you enable this box, then you'll probably also want to enable a "Logout" link somewhere on your page, with this:

    PHP users:
    <?PHP virtual("/cgi-bin/visitors.cgi?printLogoutLink"); ?>

    SSI users:
    <!--#include virtual="/cgi-bin/visitors.cgi?printLogoutLink" -->
  • Display a graph of your visitors: If you want to display a small daily visitors graph like this:

    hits graph screenshot

    ...then just add this line wherever you want the graph to go:

    PHP users:
    <?PHP virtual("/cgi-bin/visitors.cgi?mode=hitsgraph"); ?>

    SSI users:
    <!--#include virtual="/cgi-bin/visitors.cgi?mode=hitsgraph" -->
  • Show a brief visitor summary:

    summary output screenshot

    Add this line wherever you want the summary to appear:

    PHP users:
    <?PHP virtual("/cgi-bin/visitors.cgi?justsummary"); ?>

    SSI users:
    <!--#include virtual="/cgi-bin/visitors.cgi?justsummary" -->

Troubleshooting

If you're getting an Internal Server Error, you can probably solve it by using the information on our Internal Server Error page.

If you're getting errors about missing Perl modules, then our page on installing Perl modules will help.

If it still doesn't work, then contact us for help.  Be sure to send us the URL to the script on your server.

Support

If you need any help with VisitorLog, please complete the following steps in order:

  1. Make sure you've followed the Installation Instructions.
  2. Make sure you've completed the steps in the Troubleshooting section.
  3. Contact us and in your message, make sure to include the URL to VisitorLog on your server.

ChangeLog

v1.68 (20070722):

  • Improved the ignore_visitor options: you can now do multiple matches on a single field, and now HTTP_REFERER and REQUEST_URI are available to match against.  Also improved the documentation for this feature quite a bit.
  • Updated HTTP_USER_AGENT parsing to detect Safari running on the Apple iPhone.
  • On the view-full-log page, we now always put the full user-agent into a tooltip that's displayed when you hover over the parsed/abbreviated one.  (Previously we only did this for unknown UAs.)
  • New option to allow VisitorLog to be fully functional even on lame servers that support neither PHP nor SSI/shtml.

v1.67 (20070717):

  • Improved the default security of the database credentials.
  • Improved the error message displayed when the db creds are missing; it now actually tells you what needs to be done instead of just pointing you towards the documentation.

v1.66 (20070618):

  • Miscellaneous changes due to UserBase updates.
  • Bugfix: all template variables are now of the form %%var%% instead of %var% as before, because %foo% is ambiguous within a template that may also contain a URL with hex-encoded portions.

v1.65 (20070606):

  • Changed the query-string argument for the login action from "login" to "vllogin" so that sites running both VisitorLog and FileChucker but without UserBase won't get a double login prompt on a call to FileChucker which also includes VisitorLog.

v1.64 (20070418):

  • Small markup change to aid in styling.

v1.63 (20070413):

  • The output in ?mode=full can now be sorted by different columns besides date-of-visit, by passing ?orderby=foo.
  • The search function can now search the entire visitor log including archive tables, not just the current past-7-days table.
  • The search function now supports the logical AND operation within a single field via &&, i.e. google&&upload within the CameFrom field to find visitors who found you by searching google for "upload".
  • The hits-graph feature can now display an arbitrary number of days instead of being fixed at 7 days, by passing ?numdays=N.  It can also be instructed to use a different bar-width by passing ?barwidth=N.
  • In delete mode, when a row is selected, it is now highlighted in a different color to indicate that.
  • There is a new ?mode=dbmaint feature that allows you to easily remove duplicate records from your visitor tables (should only be necessary in the event of a server issue which affects your SQL tables).

v1.62 (20070329):

  • We now display the output of the server's uptime command at the bottom of the page in ?mode=full.

v1.61 (20070328):

  • Moved the main block to the bottom of the script, below the subroutines, as part of a larger effort to reduce the number of warnings logged when running in -w mode.

v1.60 (20070301):

  • Changed the name of our username cookie when in non-UserBase mode, and a bunch of corresponding variables and query-string arguments, so as not to cause weird behavior on sites that might be non-UserBase and then add UserBase later (or vice-versa).
  • We no longer print our own "authenticate yourself" page/form; instead, we just redirect to UserBase when appropriate.

v1.59 (20070228):

  • Miscellaneous changes due to UserBase updates.

v1.58 (20070208):

  • Miscellaneous changes due to UserBase updates.

v1.57 (20070208):

  • Check for our prefs file in the current directory as well as in /cgi-bin/ and ../cgi-bin/.
  • Applied some of our standard classes to form elements to make styling more consistent between applications.
  • Miscellaneous changes due to UserBase updates.

v1.56 (20070131):

  • Treat $ENV{PATH_INFO} and $ENV{SCRIPT_NAME} as case-insensitive, for brain-dead servers where the filesystem is case-insensitive and the awful server software changes the case of the variables at random.

v1.55 (20070127):

  • Bugfix: a missing "qq" before a backtick caused a bunch of output to be null.

v1.54 (20070122):

  • Try to get the CWD from $ENV{PATH_TRANSLATED} for brain-dead servers.

v1.53 (20070113):

  • Updated to work with new version of UserBase, which is now database-backed.

v1.51 (20061210):

  • Moved default install location from /cgi-bin/visitors/ to just /cgi-bin/ to make installation one step easier.
  • Changed some of the AJAX code for regularly refreshing the visitorlog output in the browser.
  • Added a new ?justsummary query-string option to display only an output like "Online 15 / Today 362 / Total 83,229".
  • The AJAX calls now return proper XML, which increases the size of the output by a large percentage, but makes it "valid".
  • Now when displaying the short list of recent or online visitors, the online visitors list is separated by line-breaks instead of commas.  (Commas look a little nicer when the list is populated mostly by people's names, but when it's mostly hostnames and IPs, line breaks look better.)
  • Improved screen-resolution-logging so it's logged much more consistently even for visitors who don't stick around very long.

v1.50 (20060905):

  • First public release, after ~4 years of development & refinement on select client sites.