Table Of Contents

  1. Introduction
  2. Quick installation guide
  3. Preparing the HTML pages
  4. Server settings
  5. Configuring file paths
  6. Known issues
  7. Tricks & tips
  1. Introduction

    This tool has been designed to help administrators and webmasters to make fast usability tests and mainly to analyze the gathered data. Although in this page the system (smt) is introduced like a tool for real time mouse tracking visualization, its main goal goes beyond: to analyze user behaviour and to infer a visitor profile by means of psychological, social and statistical relations.

    Usually webmasters only want to track a certain HTML page, which is normally the one with the new layout or the most visited one. But sometimes a set of files is required to be tracked. It doesn't matter, this tool works in each HTML file marked with the needed line of JavaScript code. See preparing HTML pages to read more.

    disclaimer! (smt) is intended to work on standard HTML pages. If your website is entirely developed with Flash, you should try pure Flash/Flex solutions like Use It Better or Google Analytics Tracking for Adobe Flash.

  2. Quick installation guide

    1. Unzip the (smt) system in a folder called smt on your server root (/smt).
    2. Add this line in the <head> section of any HTML page that you wish to track:
      <script type="text/javascript" src="/smt/smt_record.js"></script>
    3. That's all! Navigate to playground folder (/smt/playground) and see how users behave in your site.

    See next chapters to know more about (smt).

  3. Preparing the HTML pages

    You need to add the following line of JavaScript code in each page that you wish to monitore, in your <head> section: <script type="text/javascript" src="/smt/smt_record.js"></script>, assuming that you have downloaded (smt) in a folder called /smt (recommended). You can also put the above-mentioned JavaScript line in your <body> section if you wish.

  4. Server settings

    The server must be able to run PHP code (99% of traditional [1] web servers can), preferably version 5. When writing this documentation the last PHP stable versions were 4.4.7 and 5.2.3.

    Your server also needs one (only one) of the following options, to write successfully [2] the HTML logs:

    • allow_url_fopen directive on, or
    • cURL module installed

    You need to unzip the (smt) system in your server root folder (/smt). Otherwise, you will need to configure manually the PHP and JavaScript files provided. Please read next chapter to achieve this task.

    [1] A 'traditional web server' means 'the one that you pay for a hosting service'. You can also try (smt) in your localhost. Check www.php.net for more info.

    [2] Both logs directories (logs_html and logs_xml) must be writeable by the PHP/Apache user (usually www-data).

  5. Configuring file paths

    Maybe you want to install (smt) in a different directory that the default one (/smt). For example, let's say you want to use the path /mysubdir/smt:

    1. You must include this line in your monitored HTML page(s):
      <script type="text/javascript" src="/mysubdir/smt/smt_record.js"></script>,
    2. Open smt_config.php and write the JavaScript path (JS_PATH) accordingly to your (smt) dir:
      [line 12] define ('JS_PATH', "/mysubdir/smt");.
    3. Open smt_recod.js and write:
      [line 21] smtPath: "/mysubdir/smt".

    Due to the fact that a copy of your HTML page is created in /smt/logs_html folder, a <base /> element is automatically included in the HTML head, for linking correctly path-relative external files (such as CSS or images) when replaying mouse tracking data. If you have previously included a <base /> element to link your external files, please edit smt_storeData.php and comment line 93 as follows: //$parse_url = str_replace(HEAD_TAG, $head_fix, $parse_url);

  6. Known issues

    • Almost all browsers (Firefox does not, for example) must load the entire page before being able to fire the unload event – which makes sense. So, if the user leaves the page before all the binary content is fully loaded, the session log won't be created.
    • Safari cannot send Ajax POST requests on page unload. Is this a bug or a feature?
    • Opera does not fire the unload event when closing the browser window, either if you type the page URL manually in the address bar or load a bookmarked page (link). However, the unload event is indeed fired when clicking on a link on that page.
    • Additionally, Opera maintains the runstate of scripts, so both load and unload events do not fire when going back, forward or refreshing the page (link).

    If you find a bug, you can fill in the bug report form.

  7. Tricks & Tips

    • disclaimer! By default, (smt) works with random sampling; that is, some visits are tracked and others not. If you need to track all visits, edit line 24 of smt_record.js and write disabled: false.
    • deprecated! Did you know that the mouse tracking background layer can be customized? Open the file smt_replay.js and edit the function setBgCanvas, on line 92. You can change the background color, the layer opacity and add some offsets to its dimensions (both in width and height).
    • Colors in mouse tracking layer can be customized. Just open smt_replay.js and edit the (smt) default options. Color values must be enclosed in quotation marks, and should be hexadecimal following the pattern "#rrggbb" or "#rgb" (as usual with HTML). Color names availables in HTML (for instance "maroon") may be used as well.
    • You can track the mouse activity over Flash animations. For each Flash object, the system will set automatically the wmode to transparent, being able to track mouse movements over these embed objects too.
    • What about tracking an entire site? You can track all your site's pages at once if all of them share the same header or footer (a very very common case). In this case, place the line of JavaScript code on the common header (or footer) and you're done.