Skip to content

Web Analytics settings: what is recorded, for how long, and whose

Describes Web Analytics 0.9.0.

The Settings page decides what Web Analytics records, what it leaves out of the reports, and how long it keeps the data. Privacy and consent settings have a guide of their own, and so do alerts.

Where to find it

Web Analytics → Settings (/admin/web-analytics/settings). You need the Owner role or the Web Analytics permission. Everything in the big form is saved with Save settings at its bottom; the buttons above and below the form act at once.

Web Analytics settings: Tracking is on with Turn off, the hook notice, and collection settings such as Do Not Track, bot traffic and excluded paths Web Analytics settings: Tracking is on with Turn off, the hook notice, and collection settings such as Do Not Track, bot traffic and excluded paths

Web Analytics settings.

Tracking on and off

The bar at the top says Tracking is on or Tracking is off. Turn off asks Stop recording visits? Reports keep what is already stored. and stops recording; Turn on starts it again. This is the same switch as Web Analytics on the Modules page.

Warnings may appear under it: LiveView pages that don’t run the analytics hook, and LiveView visits from a private or loopback address that aren’t recorded because of a missing socket setting. Both name what a developer has to change.

Collection

  • Respect Do Not Track: skip visitors whose browser sends DNT or Global Privacy Control. On by default.
  • Record bot traffic: keep visits from crawlers and monitors that name themselves. Off by default, since they would otherwise dominate every report. Reports show them only with Bots ticked.
  • Spot bots by behaviour: also catch bots posing as a normal browser: a browser under automation (needs the client script), page views faster than a person reads, and LiveView pages that never connected. On by default.
  • Excluded paths: one pattern per line; a trailing * matches a prefix, and a pattern covers the page in every language. The default list is /admin*, /dev*, /phoenix* and /live*.
  • Visit timeout, minutes: how long a visitor can be away before coming back starts a new visit. 30 by default.
  • Keep raw events, days: 365 by default. 0 keeps raw events forever. Daily totals are always kept.

Your own traffic

Visits by the site’s own people are stored with a mark and left out of the reports, alerts and recordings. Nothing is deleted, and Own traffic on a report counts them back in. Each kind has its own switch, all on by default:

  • Leave out internal networks, with Internal networks: office, VPN or server addresses, one per line, as an address or a network such as 192.0.2.0/24 or 2001:db8::/48. A network wider than /8 (IPv4) or /16 (IPv6) is refused, and a warning counts entries that are skipped. These addresses are not written into the activity log.
  • Leave out site staff, with Staff roles: comma-separated role names, Owner and Admin by default. Leave it empty and no one counts as staff. A visit where someone signs in as staff midway is left out whole.
  • Leave out staff networks, with Staff network, hours (24 by default): every visit from an address where a staff member signed in or was active within those hours. Behind a mobile network or an office gateway one address is many people, so a staff sign-in from a phone leaves out everyone sharing it. 0 stops marking staff networks.

What visitors do

  • Record LiveView interactions: every event a LiveView handles, by name. On by default. Form typing and form contents are never recorded.
  • Events not to record: comma-separated event names; validate by default.
  • Event values to keep: comma-separated parameter names whose short values are kept with an interaction, such as which tab was opened. The default is tab, view, section, step, sort, filter, period.
  • Accept the client script: store what the optional browser script reports: outbound links, downloads, plain buttons, scroll depth, and exits from pages without a LiveView. Off by default.
  • Accept the beacon and pixel: page views reported from the browser, for pages a CDN serves without reaching the app. The endpoints are public, so leave it off unless you use them.

Session recordings

  • Record visits: replay where the pointer went, what was clicked and hovered, and how the page scrolled. Off by default, and it needs the client script. Only coordinates and element positions are recorded, never text, typing or form values. Visitors asking not to be tracked, bots and excluded paths are never recorded.
  • Visitors recorded, %: record a share of visitors, 1 to 100.
  • Keep recordings, days: 30 by default.

Recordings play on the visit’s page; see the Visits guide.

Stored data

Four counts: Events, Rollup rows, Oldest event and Visitor profiles. Then:

  • Remove stored profile data: pick IP address, User-Agent, Request headers, Network, Device measurements or All visitor profiles, and click Remove stored data. It asks to confirm, cannot be undone, and reports how many profiles it changed. Switch the matching setting off first, or new data keeps arriving.
  • Roll up & prune now: run the hourly pass at once. It rolls finished days up into daily totals and deletes raw events and recordings past their retention, then says how many days and events it handled.
  • Rotate visitor salt: change the secret visitor IDs are hashed with. It asks to confirm: visitors seen before now will be counted again today, and open visits split.

Installation

The last section lists the steps a developer takes to connect tracking: the plug, the LiveView hook, the socket’s connect_info, and what to do behind a reverse proxy.

What it doesn’t do

  • Turning tracking off doesn’t delete anything; reports keep what is stored.
  • Daily totals hold only traffic that isn’t marked. Counting a kind of own traffic back in makes the reports read raw events, so days past the raw-event retention show no data.
  • Retention never prunes past the last rolled-up day.