Tracer
in package
Simple user tracer can be used via javascript or/and php (fewer features)
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- createTrace() : void
- Save visitor page interaction tracing information
- creteVisitAjax() : int
- Save view from javascript
- creteVisitLocal() : int
- Save view from noscript
- getBrowser() : array<string|int, string|int>|string|null
- Get browser info from agent
- getResponseCode() : mixed
- Get url response code
- getSystem() : array<string|int, string|int>|string|null
- Get system info from agent
- isMobile() : bool
- Is mobile client
- script() : void
- Print tracking javascript
- updateVisitor() : void
- createVisit() : int
- Save page view
- createVisitor() : int
- Create new visitor with basic information about browser and system
- getDomain() : string
- loadVisitor() : int|null
- Get visitor ID based on given hash
- makeHash() : string
- Make unique hash
- setVisitorHash() : void
- Creates unique hash for visitor
Properties
$cookie
public
static string
$cookie
= 'pfxvistr'
$life
public
static int
$life
= 2592000
$timeout
public
static int
$timeout
= 3600
$db
protected
SQL
$db
$id
protected
int|null
$id
$path
protected
string
$path
Methods
__construct()
public
__construct(SQL $db[, string $path = '/' ][, string|null $page = null ]) : mixed
Parameters
- $db : SQL
- $path : string = '/'
- $page : string|null = null
createTrace()
Save visitor page interaction tracing information
public
createTrace(mixed|int $visitId, mixed|float $trace, mixed|float $width, mixed|float $height, mixed|float $active, mixed|int $time) : void
Parameters
- $visitId : mixed|int
- $trace : mixed|float
- $width : mixed|float
- $height : mixed|float
- $active : mixed|float
- $time : mixed|int
creteVisitAjax()
Save view from javascript
public
creteVisitAjax(string $inRef, string $inReq) : int
Parameters
- $inRef : string
- $inReq : string
Return values
intcreteVisitLocal()
Save view from noscript
public
creteVisitLocal() : int
Return values
intgetBrowser()
Get browser info from agent
public
static getBrowser(string $agent) : array<string|int, string|int>|string|null
Parameters
- $agent : string
Return values
array<string|int, string|int>|string|nullgetResponseCode()
Get url response code
public
static getResponseCode(string $fullUrl) : mixed
Parameters
- $fullUrl : string
getSystem()
Get system info from agent
public
static getSystem(string $agent) : array<string|int, string|int>|string|null
Parameters
- $agent : string
Return values
array<string|int, string|int>|string|nullisMobile()
Is mobile client
public
static isMobile(string $agent) : bool
Parameters
- $agent : string
Return values
boolscript()
Print tracking javascript
public
static script([array<string, string|int> $settings = [] ]) : void
Parameters
- $settings : array<string, string|int> = []
updateVisitor()
public
updateVisitor(mixed|float $width, mixed|float $height, mixed|float $ratio) : void
Parameters
- $width : mixed|float
- $height : mixed|float
- $ratio : mixed|float
createVisit()
Save page view
protected
createVisit(string $request, string $referer, string|int $status) : int
Parameters
- $request : string
- $referer : string
- $status : string|int
Return values
intcreateVisitor()
Create new visitor with basic information about browser and system
protected
createVisitor() : int
Return values
intgetDomain()
protected
getDomain() : string
Return values
stringloadVisitor()
Get visitor ID based on given hash
protected
loadVisitor(string $mark) : int|null
Parameters
- $mark : string
Return values
int|nullmakeHash()
Make unique hash
protected
makeHash(int $id) : string
Parameters
- $id : int
Return values
stringsetVisitorHash()
Creates unique hash for visitor
protected
setVisitorHash(int $id) : void
Parameters
- $id : int