Skip to content

New endpoint: GET /v1/analytics/content/attribution #35076

@freddyDOTCMS

Description

@freddyDOTCMS

Description

Create a new endpoint GET /v1/analytics/content/attribution that returns content items ranked by how often they appeared in a conversion path.

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

Parent epic: #35048

Query Parameters

Param Required Description
siteId dotCMS site identifier
environment Cluster/environment identifier
from + to OR range Time range — absolute or relative
eventType Filter by event type
identifier Filter by content identifier
title Filter by content title
orderBy title, identifier, eventType, attributionRate, attributionCount
orderDir asc or desc
page Page number (pagination)
pageSize Results per page

Headers

X-Customer-Id, X-Signature (HMAC-SHA256)

Time range rules

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

Response shape

{
  "params": { "siteId": "...", "environment": "...", "from": "...", "to": "..." },
  "pagination": { "page": 1, "pageSize": 50, "totalPages": 4, "totalItems": 180 },
  "data": [
    {
      "eventType": "content_click",
      "identifier": "f9e8d7c6-uuid",
      "title": "Download Our Guide CTA",
      "attributionCount": 75,
      "events": 310,
      "attributionRate": 24.19
    }
  ]
}

Acceptance Criteria

  • GET /v1/analytics/content/attribution endpoint created
  • Mandatory params validated: siteId, environment, time range — returns 400 when missing
  • Optional params work: eventType, identifier, title filter results correctly
  • orderBy supports all five values; orderDir defaults to desc
  • Pagination works: page + pageSize with correct totalPages / totalItems in response
  • Time range rules applied: absolute takes precedence over relative
  • X-Customer-Id enforces row-level data isolation
  • X-Signature validated (HMAC-SHA256)
  • Response matches the documented JSON shape

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