EZstatz Integrated Website Statistics & Logging - Beta 
Contact us
Instructions for Getting Started
Notice - EZstatz is written in PHP.  Your web host must be php-enabled. 
You can use it for your website with other languages, as there is only a simple function to place in your executable. We will work with you on integrating into your framework. In most cases, this is fairly simple. However in the Beta mode, we may not be able to support all possible languages and development facilities. It helps if you are a knowledgable developer in whatever langauge or facility you use.

  1. First thing to do is define a directory to contain the logs on your web host. Create a directory called "ezstatz" (all lower case) in your root directory. Set the permissions to make the directory readable externally. (assuming your programs are executed from the root directory. Otherwise create it in the directory you operate from. If you execute programs (scripts) from multiple directories, or use a subdomain, send us an email describing your scenario.)

  2. Copy to your system (root directory) the function file - ezstatfun.php. The source is at then end of this section. You can check it to insure there is no malicious code.

  3. In the various scripts where you want to generate logs and stistics, include the php function file:
    <?php include(ezstatfun.php); ?>

  4. Insert in your various scripts the following code segment, where you want to record that an event occurred:
    <?php ezstatz(code,(user_id),count,description); ?>
    • code = A short text code for this event. This would normally be a literal. For example, if you want to start by tracking entries to your index program you might use 'index'.
    • user (optional) = This is normallly the User ID, so you can follow the actions of a user. If ther is no defined user at the point of the event, leave this parameter empty.
    • count = The amount you want to increment the counts for each occurence. Most commonly this will be simply a 1, but it might be a dollar amount for example. If the count is zero, a log entry is produced, but it is not counted toward a statistic.
    • description = A text description indicating the nature of this event, can include variable values, etc.

  5. Go to your Client Configuration Page and define how you want the event statistics to be displayed.

  • * If you call ezstatz() from a chron job, the chron environment may reference a different base directory. So it may be necessary to use a chdir() command to reference the proper base directory. (The same applies to a script or program executed from an alternate directory, or a subdomain.)

  • ** Normally programs that contain PHP code have to have a .php file name extension for the server to recognize it as such and interpret the PHP code. However, you can tell the server to look for php code in other file types. Just add this line to .htaccess:  AddType application/x-httpd-php .html  (substituting whatever file type you want for ".html")
    It can also be done individually for single files using for Apache.

  • *** In the code section below, set the variable "$server_offset" to the time difference in hours from your server to your location (the timezone in which you wish to have statistics recorded).
    For example, if your serever is on the U.S. East Coast and your location is California, then you will set the "$time_offset" to -3.
    There is a similar value in the client profile, except it's the difference between your location and OUR server which is in the east coast U.S. timezone.

    Further Notes and Advice

    Here's the ezstatfun.php include. Just copy this into a text editor (notepad will do) and store it in your root directory as ezstatfun.php:

    <> Home <> FAQ <> Contact Us <>