Skip to content

Configuration

Publish the file to change anything:

Terminal window
php artisan vendor:publish --tag=visits-config

All keys live in config/visits.php. Keys without an env variable can only be changed in the published file. Class names are stored as strings, never closures, so the config survives php artisan config:cache.

KeyEnvDefaultDescription
enabledVISITS_ENABLEDtrueTurns tracking off: TrackVisit and Visits::track() do nothing, POST /visits/collect returns {"visitor_id": null}, the Login/Logout listeners and Visits::identify() do nothing, and TrackVisit is not added to the web group. The dashboard and /visits/whoami routes are not registered and Visits::whoami() returns [] (before 0.13.6 they kept working)
models.visitor—Fomvasss\Visits\Models\VisitorVisitor model class. Overrides must extend the package model (Custom models)
models.session—Fomvasss\Visits\Models\SessionSession model class
models.event—Fomvasss\Visits\Models\EventEvent model class
models.stat_daily—Fomvasss\Visits\Models\StatDailyDaily rollup model class
token_resolver—Fomvasss\Visits\Support\TokenResolverClass that resolves and generates visitor ids, bound in the container in place of TokenResolver. Must extend it (Visitor identity)
queue.connectionVISITS_QUEUE_CONNECTIONconfig('queue.default')Queue connection for RecordVisitJob
queue.queueVISITS_QUEUE'default'Queue name for RecordVisitJob
KeyEnvDefaultDescription
cookie.name—'visits_visitor_id'Name of the visitor id cookie. Laravel’s EncryptCookies encrypts it like any other cookie
cookie.ttl_minutes—1051200 (2 years)Cookie lifetime; re-queued on every tracked request
visitor_id.format_regex—UUID, /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/iFormat a visitor id must match to be accepted — from the X-Visitor-Id header, the visitor_id input, the cookie, inheritFrom and the authenticated-user fallback. Anything else is silently ignored. The token column holds at most 64 characters
reset_identity_on_logout—falseOn Logout, clear user_type/user_id on the current visitor (shared or kiosk devices)
session_timeout_minutes—30Inactivity after which a new event opens a new session instead of joining the current one; also the cutoff for visits:close-stale-sessions
KeyEnvDefaultDescription
auto_track—trueAppend TrackVisit to the web group. false: attach the track-visits middleware alias to the routes you want tracked (Page views)
exclude_paths—['admin/*', '_debugbar/*', 'horizon/*', 'up', 'storage/*']Path patterns (Request::is() syntax) TrackVisit never tracks. Checked whenever TrackVisit runs, including routes it was attached to by alias. 'storage' without /* matches only /storage itself
page_views—'every''first_only': TrackVisit writes an Event only for a request that carries no visitor id yet; later requests still refresh the visitor and session (Page views)
exclude_ips—[]IPs and CIDR ranges (IPv4/IPv6) never recorded, from any entry point: ['203.0.113.42', '198.51.100.0/24', '2001:db8::/32']
tracking_params.core—utm_source, utm_medium, utm_campaign, utm_term, utm_content, refMap column => query parameter. Only these six columns exist — renaming the query parameter works ('ref' => 'aff'), adding a column does not
tracking_params.extra_keys—gclid, fbclid, msclkid, ttclid, yclid, twclid, li_fat_idQuery parameters always captured into the extra_params JSON column
tracking_params.extra_pattern—nullPCRE pattern with delimiters ('/^aff_/'); any other query parameter whose name matches is captured into extra_params too
search_engines—google. q, bing.com q, duckduckgo.com q, search.yahoo.com p, yandex. texthost substring => query parameter: the search keyword is read from the referrer URL of a matching host (Campaign attribution)
KeyEnvDefaultDescription
geo.cache_ttl—86400Seconds a successful geo lookup is cached per IP. A failed lookup is cached for 300 seconds
geo.store_coordinates—trueStore lat/lng. With false the Overview map and the Live page have nothing to show
device_detection.cache_dir—storage_path('framework/cache/device-detector')Not read by the current code — device detection runs without a persistent rule cache

All values use Laravel’s throttle format "max,decay_minutes".

KeyEnvDefaultDescription
rate_limit.endpoint—'60,1'throttle middleware appended to POST /visits/collect
rate_limit.visitor_budget—'120,1'Events per visitor id, checked inside RecordVisitJob for every entry point. Over the budget the job writes nothing
rate_limit.whoami—'60,1'throttle middleware appended to GET /visits/whoami
KeyEnvDefaultDescription
collect.middleware—['web']Middleware for POST /visits/collect; the throttle from rate_limit.endpoint is appended automatically. Use ['api'] (or exclude the route from CSRF) for API-only backends, other origins and mobile apps (Client integration)
collect.allowed_origins—nullArray of origins ('https://example.com'). When set, a request whose Origin (or the scheme and host of Referer) is not listed gets 403. A filter against casual misuse, not authentication
KeyEnvDefaultDescription
schedule.enabledVISITS_SCHEDULE_ENABLEDtrueRegister visits:close-stale-sessions and visits:aggregate in the scheduler (Rollups)
retention_days—90Default age for visits:prune. Pruning never runs on its own
aggregate.dimensions—utm_source, utm_medium, utm_campaign, utm_term, utm_content, ref, referrer_host, country_code, device_type, browser, client_type, nameDimensions visits:aggregate writes to visit_stats_daily besides the totals. Removing one empties the matching dashboard panel
KeyEnvDefaultDescription
consent.require_consent—falseAsk consent.resolver before TrackVisit tracks a request
consent.resolver—nullClass implementing ConsentResolverInterface. With require_consent on and no resolver, nothing is tracked by TrackVisit (Consent)
KeyEnvDefaultDescription
dashboard.enabledVISITS_DASHBOARD_ENABLEDtrueRegister the dashboard routes
dashboard.pathVISITS_DASHBOARD_PATH'visits'URL prefix of the dashboard
dashboard.middleware—['web']Middleware for every dashboard route. No auth by default
dashboard.per_pageVISITS_DASHBOARD_PER_PAGE50Rows per page on Sessions and Visitors
dashboard.default_range_daysVISITS_DASHBOARD_DEFAULT_RANGE_DAYS30Date range of Overview and Campaigns without ?from=/?to=
dashboard.map_tile_urlVISITS_DASHBOARD_MAP_TILE_URL'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png'Leaflet tile URL for the Overview and Live maps. Switch to a paid tile provider for heavy use, per OpenStreetMap’s tile usage policy
dashboard.map_marker_limitVISITS_DASHBOARD_MAP_MARKER_LIMIT300Most recent sessions plotted on the Overview map
dashboard.top_pages_limitVISITS_DASHBOARD_TOP_PAGES_LIMIT10Rows in the Top pages panel
dashboard.online_window_minutesVISITS_DASHBOARD_ONLINE_WINDOW_MINUTES5An open session active within this many minutes counts as “online now”
KeyEnvDefaultDescription
live.enabledVISITS_LIVE_ENABLEDtrueRegister the Live page routes
live.transportVISITS_LIVE_TRANSPORT'poll''poll' or 'sse' (Dashboard)
live.poll_interval_msVISITS_LIVE_POLL_INTERVAL_MS10000Polling interval of the browser (poll)
live.feed_limitVISITS_LIVE_FEED_LIMIT50Maximum events per poll or push
live.sse_check_intervalVISITS_LIVE_SSE_CHECK_INTERVAL2Seconds between database checks inside one SSE connection
live.sse_max_durationVISITS_LIVE_SSE_MAX_DURATION300Seconds one SSE connection stays open before the browser reconnects
KeyEnvDefaultDescription
whoami.enabledVISITS_WHOAMI_ENABLEDtrueRegister the public GET /visits/whoami endpoint
whoami.pathVISITS_WHOAMI_PATH'visits/whoami'Its path, independent of dashboard.path
whoami.middleware—['web']Its middleware; the throttle from rate_limit.whoami is appended
KeyEnvDefaultDescription
tenant_resolver—nullReserved; the package does not read it (Multi-tenancy)
user_display_resolver—DefaultUserDisplayNameResolverClass implementing UserDisplayNameResolverInterface that turns the linked user into a display name on the dashboard. The default returns name, then email, then null