System settings

Stats3x7 min readPage 6 of 7
On this page 7

All system settings of the component and their default values. They are changed in System Settings, namespace stats3x. Values in curly braces ({core_path} and so on) are substituted automatically.

Visitor tracking

SettingDescriptionDefault
Visitor tracking mode
stats3x.tracking_mode
cookie - the visitor gets the _st3x cookie with their number, returning visitors are detected exactly. cookieless - no cookie: the visitor number is calculated on the server from the IP and the browser and changes every day, so returning visitors are not visible in this mode.cookie
Cookie lifetime, days
stats3x.cookie_lifetime
How many days the browser keeps the _st3x cookie in the cookie mode. A visitor who comes back later is counted as new.365
Pause before a new visit, minutes
stats3x.visit_timeout
If the visitor did nothing on the site for longer than this, the next page view starts a new visit. A new visit also starts when the visitor comes from another source.30
Track clicks on elements
stats3x.click_selectors
CSS selectors separated by commas, for example: .btn-buy, #callback, a[href^="tel:"]. Clicks on these elements and on elements inside them are saved as visitor actions.empty
Ignore IP addresses
stats3x.exclude_ips
IPv4 and IPv6 addresses or subnets separated by commas or new lines, for example: 192.168.0.1, 10.0.0.0/8, 2001:db8::/32. Requests from these addresses are dropped when the data is processed.empty
Header with the visitor IP
stats3x.ip_header
Fill it only if the site works behind a proxy: then REMOTE_ADDR holds the proxy address and the visitor address comes in a header. For example: CF-Connecting-IP for Cloudflare, X-Real-IP or X-Forwarded-For for nginx in front of Apache. From X-Forwarded-For the last public address is taken: your proxy added it, while the beginning of the list can be sent by the visitor. So behind a CDN use its header with the visitor address, not X-Forwarded-For. The header is used only from trusted proxies (stats3x.ip_proxies). Without a proxy leave it empty: any visitor can fake the header.empty
Trusted proxies
stats3x.ip_proxies
The stats3x.ip_header header is used only when the request comes from a proxy: otherwise a visitor connecting to the site directly could send the header and fake their IP. Empty - trust only internal addresses (nginx on the same server, a load balancer in the local network). For a CDN list its addresses and subnets separated by commas or new lines (for example, Cloudflare subnets), * - trust any address.empty
Hidden URL parameters
stats3x.hidden_params
The part after # and parameters with secrets and personal data are always removed from the page address, the referrer and links: everything with token, secret, passw, session, signature, apikey in the name, and auth, code, key, hash, sig, sid, ticket, otp, pin, email, mail, phone, tel. Add your own names here separated by commas, for example order_id, promo.empty
Show visitor IP addresses
stats3x.show_ip
The IP address in the visits list, session recordings, the "Online now" tab and the visitor card. No - IP is not shown in the manager (it is still stored in the database: needed for exclusions and geography).1

Data storage

SettingDescriptionDefault
Data folder
stats3x.data_path
Temporary files with incoming data (buffer/) and session recordings (replays/). IP2Location databases are not kept here - their path is in the stats3x.geo_ipv4_path and stats3x.geo_ipv6_path settings. Placeholders: {core_path}, {base_path}, {assets_path}. Default: {core_path}components/stats3x/data/ - inside the component folder: upgrades keep it, uninstalling the package removes it together with the session recordings. To keep the data after uninstalling, set a folder outside the component, better outside the site root, for example on HestiaCP: /home/user/web/domain/private/stats3x/. Such a folder is kept when the package is uninstalled, unless stats3x.remove_tables_on_uninstall is enabled.{core_path}components/stats3x/data/
Keep detailed data, days
stats3x.keep_details_days
Visits, page views and actions older than this are removed once a day. Daily totals are kept forever. 0 - do not remove.90

Geography

SettingDescriptionDefault
IP2Location database for IPv4
stats3x.geo_ipv4_path
IP2Location LITE database file in the BIN format or a folder with it. For a folder the IP2LOCATION-LITE-DB*.BIN file is used. DB1 - country, DB3 - country, region and city, DB5 and DB11 - also coordinates and time zone. Default: {core_path}components/stats3x/geo_ip/ - inside the component folder, removed together with the package. The folder can be anywhere on the server (one for several sites if open_basedir allows it), but not in a web-accessible part of the site. Placeholders: {data_path}, {core_path}, {base_path}.{core_path}components/stats3x/geo_ip/
IP2Location database for IPv6
stats3x.geo_ipv6_path
IP2Location LITE database file for IPv6 (IP2LOCATION-LITE-DB*.IPV6.BIN) or a folder with it, may be the same as for IPv4. Default: {core_path}components/stats3x/geo_ip/. Placeholders: {data_path}, {core_path}, {base_path}.{core_path}components/stats3x/geo_ip/
Token for downloading IP2Location databases
stats3x.geo_token
Download Token for the free IP2Location LITE databases. Sign up: https://www.ip2location.com/register?id=lite, the token is in your account at https://www.ip2location.com/account, Download section. When it is set, the cron task "IP2Location databases update" downloads the databases from stats3x.geo_download into the folder from stats3x.geo_ipv4_path (IPv6 databases - from stats3x.geo_ipv6_path) and updates them monthly. Empty - put the databases manually.empty
IP2Location databases to download
stats3x.geo_download
IP2Location LITE database codes separated by commas. DB11LITEBINIPV6 - country, region, city, coordinates and time zone for IPv4 and IPv6 in one file. IPv4 only: DB1LITEBIN (country), DB3LITEBIN (+ region and city), DB5LITEBIN (+ coordinates), DB11LITEBIN (+ time zone); with the IPV6 ending - the same databases for IPv4 and IPv6.DB11LITEBINIPV6

Cron

SettingDescriptionDefault
Warn when cron has not run, minutes
stats3x.cron_alert_minutes
If cron.php has not run for longer than this, the component shows a warning and an entry is written to the MODX error log.10

Email reports (Vestnik)

SettingDescriptionDefault
Send email reports
stats3x.vestnik_enabled
Works only if the Vestnik component is installed: Stats3x passes the report data to it, Vestnik builds and sends the email. Without Vestnik the setting has no effect.0
How often to send
stats3x.vestnik_period
daily - every day for yesterday, weekly - on Mondays for the last week, monthly - on the 1st for the last month. The report goes out on the first cron run after 7:00.weekly
Report recipients
stats3x.vestnik_recipients
Addresses separated by commas or new lines. Vestnik gets the stats3x.report event for every address.empty

Session recording

SettingDescriptionDefault
Record visitor sessions
stats3x.replay_enabled
Only pages where the snippet is called with &replay=1 are recorded. Recording does not slow the page down: the recording script (rec.js) is loaded only for sampled visits, recording parts go to the server compressed.0
Share of recorded visits, %
stats3x.replay_sample
For example, 10 - every tenth visit is recorded. 100 - all visits.10
Mask typing in fields
stats3x.replay_mask_inputs
Text typed into form fields is replaced with asterisks in the recording. Passwords are always masked. Separate blocks are hidden with the classes st3x-block (do not record the block) and st3x-mask (hide the text).1
Minimum recording length, seconds
stats3x.replay_min_duration
Shorter recordings are not kept.10
Keep recordings, days
stats3x.replay_keep_days
Older recordings are removed together with their files. 0 - do not remove.30
Image and style domains in recordings
stats3x.replay_hosts
Anyone can forge a recording, so the player loads images, styles and fonts from it only from the site domain and context domains (with subdomains), except the manager and connectors. If they are on a CDN, list its domains separated by commas, for example cdn.example.com. Everything else is shown without images, frames are left empty.empty

System

SettingDescriptionDefault
Remove tables on uninstall
stats3x.remove_tables_on_uninstall
If enabled, uninstalling the package from the manager removes the component tables with all data, the component system settings and the files in the data folder (buffer/, replays/). Disabled by default: the tables and the settings survive reinstallation. The default data folder is inside the component and is always removed with the package, a folder set in stats3x.data_path - only when this option is enabled.0