Skip to content

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

Describes Web Analytics 0.10.0. On an older release? The version menu above has this guide as it was then.

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 notice about pages without the analytics hook, the visitor-address check, and collection settings Web Analytics settings: Tracking is on with Turn off, the notice about pages without the analytics hook, the visitor-address check, and collection settings

Web Analytics settings.

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.

Below them, a check of visitors’ addresses, from the last 200 page views on this server:

  • All your visitors look like one internal address.: the page views came from a private or loopback address. A reverse proxy in front of the app doesn’t pass the visitor’s address on, so visits, visitors, internal networks and rate limits all count it as one visitor. The warning says what to change in the proxy.
  • All your visitors look like one address.: every page view came from the same public address. If that isn’t just you testing, a CDN or proxy is in front of the app and its forwarded header isn’t read.
  • Otherwise a short line says the addresses look right, or that there aren’t enough page views on this server yet to tell.

Only a summary is kept, in memory; the addresses themselves are not.

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.

Rate limits

This section works with the rate-limit plug a developer adds to the site’s routes; the limits themselves are rules in the site’s code. Each request a rule covers is counted for its visitor and for its network. The internal networks and staff are never limited. The section links to the Rate limits page, with how many rules are installed.

  • Rate limits: on (requests over a limit are refused, the default), log only (they are recorded on the Rate limits page and let through, to see what a limit would do before it does it) or off.
  • Blocked networks: addresses or networks refused with a 403 on every path the rate-limit plug covers, while rate limits aren’t off. One per line, nothing wider than /8 (IPv4) or /16 (IPv6). Only what you enter here is blocked; nothing is ever added by itself. These addresses are not written into the activity log.

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.
  • API requests: path patterns, one per line, a trailing * matching a prefix. Requests to them are recorded with their method and status (2xx to 4xx) and shown on the Events page. They are not page views and join no visit, so no other number changes. At most 60 a minute per visitor are kept. Empty, the default, is off.
  • 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.