Skip to content

Extend unique-visitors endpoint with includeConverting param #35074

@freddyDOTCMS

Description

@freddyDOTCMS

Description

Extend GET /v1/analytics/event/unique-visitors with a new optional query parameter includeConverting=true. When present, the response also includes uniqueConvertingVisitors — the count of visitors with at least one conversion event. This is a fully backward-compatible addition.

Improvement plan: https://docs.google.com/document/d/1hVfIurPqAJJ1PN1EalmvrWXnGNt5sY21MI-409lrXpU/edit?tab=t.klqavlz4cis7#heading=h.8vek9yxwq8yt

Parent epic: #35048

Endpoint

GET /v1/analytics/event/unique-visitors

Query parameters

Param Required Description
siteId dotCMS site identifier
eventType Event type filter
from + to OR range Time range (absolute or relative)
clusterId Environment identifier
includeConverting When true, include uniqueConvertingVisitors in response

Headers

Header Description
X-Customer-Id Customer identifier
X-Signature HMAC-SHA256 signature

Time range rules

  • If from/to are present → use them, ignore range
  • Else if range is present → compute from/to

Acceptance Criteria

  • includeConverting optional param added to GET /v1/analytics/event/unique-visitors
  • When includeConverting=true: response includes uniqueConvertingVisitors (visitors with ≥1 conversion event)
  • When includeConverting is absent or false: response is unchanged (backward compatible)
  • Mandatory params validated: siteId, eventType, time range, clusterId
  • Time range rules applied correctly (absolute takes precedence over relative)
  • Tests cover: with flag, without flag, missing mandatory params

Additional Context

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions