Installing SlimStat

Two-minute installation guide

SlimStat has been designed to be quick and easy to install. It usually only takes two minutes.

  1. Extract the files from the zip archive. Upload the entire slimstat directory to your server. (The remainder of these instructions assume that you have uploaded this to the root level, i.e. that it is at http://www.example.com/slimstat/. Substitute your actual URL in all following examples.)

  2. Load http://www.example.com/slimstat/ in the web browser of your choice. Follow the instructions to connect SlimStat to your database.

  3. Add this line of JavaScript to your site’s HTML code:
  4. <script type="text/javascript" src="/slimstat/?js"></script>

    Alternatively you can include the stats_include.php file directly in your PHP code. Use code similar to:

    <?php
    @include_once( $_SERVER['DOCUMENT_ROOT'].'/slimstat/stats_include.php' );
    ?>

    You can use either of these two methods, but don’t use both, as each hit will be counted twice. We recommend the JavaScript method because it records screen sizes and page titles, which the PHP method cannot do.

  5. That’s it. Load http://www.example.com/slimstat/ in your web browser.

Upgrading from older versions of SlimStat

SlimStat 2.0 uses different table names to SlimStat 0.9, so they can co-exist in the same database.

Data from SlimStat 0.9 can be imported into the new tables with the included slimstatexport.php script. Run it at the command line for best results.

If you are including SlimStat via PHP, please note that the name of the file you need to include has changed from inc.stats.php to stats_include.php.