TraceWatch Website Statistics

Google Web TraceWatch.com

twatchLogRequest()

function twatchLogRequest( $cookie = false, $websiteId = 1, $logErrors = true, $showErrors = false, $mutedErrors = true, $pageParams = true, $data = array() )

This is the function you call on your pages to send information about the requests made to that page to TraceWatch. Without this call TraceWarch is useless.

Arguments

$cookie (boolean)
Whether to store tracking cookies in visitor's browser or not. Setting this to true very much improves the accuracy of your stats and is highly recommended but 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.
$websiteId (string)
The ID of the website that this request belongs to.
$logErrors (boolean)
Whether to log errors or not.
$showErrors (boolean)
Whether to display errors on the page or not. NOTE that this is false by default.
$mutedErrors (boolean)
When true the error message displayed is always "Some Error Occurred" and no more details is revealed. Doesn't have any effect when $showErrors is false.
$pageParams (boolean)
Whether to include page parameters in the page url. When false /example.php?param=value will be stripped to /example.php.
$data (array)
An associative array of "data key" => "value" pairs. You can override any input data that TraceWatch uses (page, referrer, user agent string, ip, etc...) using this array. you can find data keys in the Administrate > Entities and check the definition of twatchLogRequest() function to see how the default value for each data is determined. Also NOTE that to remove a data you should explicitly set it's value to and instance of TwatchRemoveData class or the $twatchRemoveData global variable. Just ignoring it or setting it to null doesn't remove the data.

twatchRemoteLogRequest()

function twatchRemoteLogRequest( $address, $cookie = false, $websiteId = 1, $pageParams = true, $data = array(), $cookiePrefix = 'twatch', $cookieDomain = null, $cookieFolder = '/' )

This is the equivalent of twatchLogRequest() but you call it on a remote website's pages.

NOTE that PHP's ini variable allow_url_fopen must be 1 on the remote website for this function to work.

Arguments

$address (string)
Full internet address of twatch/remote/remote_logger.php on the website on which TraceWatch is installed. e.g. 'http://www.example.com/twatch/remote/remote_logger.php'
$cookie (boolean)
like twatchLogRequest
$websiteId (boolean)
like twatchLogRequest
$pageParams (boolean)
like twatchLogRequest
$data (array)
like twatchLogRequest
$cookiePrefix (string)
cookie name prefix
$cookieDomain (string)
cookie domain, null to set it automatically
$cookieFolder (string)
cookie folder

Current Version: 0.336

Donate!

Help the project keep going.