Download the PHP package xsuchy09/visitor without Composer
On this page you can find all versions of the php package xsuchy09/visitor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download xsuchy09/visitor
More information about xsuchy09/visitor
Files in xsuchy09/visitor
Package visitor
Short Description Visitor saves info about visitors of web page into DB and using cookies to identify them.
License Apache-2.0
Homepage https://github.com/xsuchy09/visitor
Informations about the package visitor
Visitor
PHP library to save info about visitors of web page into DB. PHP 7.1 is required.
Authors:
- Petr Suchy (xsuchy09 - www.wamos.cz)
Overview
Visitor saves info about visitor of web page into db and uses cookie to identify same visitor. Lifetime of that cookie is configurable - default is 10 years. It is using UtmCookie to save UTMs too and Hashids to get unique hash for every single visitor (for example in JavaScript it is not safe to use directly ID from DB).
SQL to create DB table is included (visitor.sql - for PostgreSQL). Column "visits_count" is counted with trigger (new visit is counted if it is more than 24 hours from last visit). You can change it as you want.
Installation (via composer)
Get composer and add this in your requires section of the composer.json:
and then
Usage
Basic Example
More examples can be found in the examples/ directory. Since version 1.0.4 you can set cookie params in constructor (path, domain, secure, httpOnly, sameSite) and some getters were added.
All versions of visitor with dependencies
xsuchy09/utm-cookie Version ^2.0
hashids/hashids Version ^4.0
ext-pdo Version *