TraceWatch Website Statistics


  1. Web server with PHP 5 or higher and Mysql 4.1 or higher.
  2. JavaScript enabled browser for viewing report pages.
    Successfully tested with Internet Explorer 7 & 8, FireFix 3 & 3.5, Safari 4, Opera 10 and Google Chrome 5.
  3. Adobe Flash Player for viewing graphs and path analysis page.

How to Install TraceWatch Web Stats

  1. Download one of TraceWatch packages. There is one folder named twatch in the package extract the folder to your hard drive.
  2. Open twatch/base/profiles/default/settings.php file in a text editor.
  3. Enter information below between single quotes in front of the corresponding variable and save changes:
    Your MySql database server address, it's very likely to be localhost or
    Name of an existing database on the server to be used by TraceWatch
    Database Username
    Database Password
    Choose a username for accessing reports and administration pages
    Choose a password for above username
  4. Upload twatch folders to the root folder of your website usually named htdocs or public_html.
  5. With your web browser go to this address: http://{yourdomain}/twatch/admin/install.php (Replace {yourdomain} with the domain name of your website).
  6. Enter your TraceWatch root username and password (those you just enterened in the settings file) and click Login.
  7. Click Install TraceWatch. Wait for a while for the installation to finish and you get 'TraceWatch installed successfuly'.
    • If during the installation you get "Some Error Occurred" message, in the settings file set $settings[ 'unauthorized_muted_errors' ] to false to view the full error message.
  8. put the code below on any page you want to trace:

    • Make sure the file is processed by the server as php (if the file extension is .html or .htm change it to .php)
    • You can also use javascript code if you can't change the file to PHP (or you can get a dedicated server).
    • If you are using IIS web server use the Code Generator and check "Web Server is Microsoft IIS" to get IIS specific code.
    • [Important] If you use twatchLogRequest(true) instead of twatchLogRequest() in the code TraceWatch stores some cookies in visitors' browser to track them more accurately. this is highly recommended BUT you must make sure the code with twatchLogRequest(true) is placed at the beginning of the page before anything is printed or you'll get an error message.
    • [Tip] If you are not using the javascript code or the remote code edit twatch/profiles/default/settings.php set $settings[ 'allow_js_logging' ] and $settings[ 'allow_remote_logging' ] to false to prevent getting spam through those scripts.
    • It takes 3-4 days before you can see any path analysis data.
  9. Installation is complete, now you can access the report pages using this address: http://{yourdomain}/twatch/

Using JavaScript Code to Trace Pages

If you can't change your pages to PHP, you still can use the JavaScript code below to trace your pages.

The disadvantage is obvious, you will lose any information from visitors without a javascript enabled browser including almost all web robots and crawlers. You will not be able to track robots behavior on your website which is one of interesting parts of TraceWatch Web Stats. Change the file extension to .php instead of using JS code if possible.

Current Version: 0.353