How Analytics Works

Analytics data starts as individual interactions in the visitor's browser and ends as figures on a dashboard. This page describes that path: the four kinds of interaction dotCMS records, when the browser sends them, and how they are grouped into visitors and sessions.

Four Event Types#


EventInternal nameWhat it meansWhat it takes to get it
Page ViewpageviewA visitor loaded or viewed a page.On by default on Traditional sites. In headless it comes from the React component, or from your own pageView() call.
Content Clickcontent_clickA visitor clicked a link or button inside a tracked content item.Off by default. Turn it on and dotCMS marks your content for tracking.
Content Impressioncontent_impressionA content item became visible on screen long enough to count as seen.Off by default. Turn it on and dotCMS marks your content for tracking.
ConversionconversionA visitor completed a goal you defined.Always sent from your own code, after the goal actually succeeds.

Page View records the page URL, title, host, path, protocol, query string, hash, encoding and locale, plus the visitor's screen resolution, viewport size and language, and any UTM campaign parameters present in the URL. See the Ingest API for the exact payload. It is the one event that needs no markup — any page reached by the tracking script is counted.

Content Click fires when a visitor clicks an <a> or <button> inside a tracked content item. Only those two element types are tracked, and only inside content carrying the tracking markup — a click anywhere else on the page produces nothing. It captures the element's text, type, id, class and href, plus its position on the page. Rapid duplicate clicks are throttled at 300 ms. Any data-* attributes you add to the element are captured with the event.

Content Impression fires when a tracked content item is at least 50% visible for at least 750 ms — distinguishing "rendered somewhere on the page" from "actually seen". As with clicks, only content carrying the tracking markup is watched. Each content item counts at most once per session. Both the visibility fraction and the dwell time are configurable, as is the maximum number of items watched on a page.

Conversion events are always sent manually from your code, and only after the action has actually succeeded. See Conversions.

When Events Are Sent#


Events are queued in the browser and sent together when the batch reaches 15 events or every 5 seconds, whichever comes first. Any events still queued when the visitor leaves the page are flushed on pagehide using keepalive, so they survive navigation.

Batch size and flush interval are both tunable, and batching can be turned off entirely so each event is sent immediately — see Traditional or Headless setup.

Visitors and Sessions#


  • Visitor ID — a random identifier stored in the browser and reused across visits to recognize a returning visitor. It is not a personal identifier and is not shared across sites.
  • Session — a single continuous visit. A new session starts when the visitor has been inactive for 30 minutes, when the clock passes midnight UTC, or when the visitor arrives with a different UTM campaign.