dotCMS / dotCMS/core

Add GET /v1/analytics/sessions/behavior endpoint with reach-target and URL-param goal support

Open
#37,224 1 comment 0 reactions 1 assignee View on GitHub

@jcastro-dotcms is already working on this.

Since Sep 18, 2026.

dotCMS : Experiments Team : Falcon Type : Task
Dominant language
Java
Stars
970
Forks
486
Avg merge
3d 33m
Merged PRs (30d)
170

Description

Description

Add a new GET /v1/analytics/sessions/behavior endpoint in CAEM that evaluates session behavior against experiment goals. The endpoint supports two goal types:

  • Reach-target goal: Determines whether sessions reached a target page after visiting a reference page
  • URL-param goal: Determines whether sessions contained a specific URL parameter during any event in the session

The endpoint accepts a behavior type, experiment context parameters (experimentId, runningId), and goal-specific required parameters. Includes service-layer dispatch with parameter validation and dedicated repositories for each goal type.

Acceptance Criteria

  • GET /v1/analytics/sessions/behavior accepts behavior, experimentId, runningId, and goal-specific required parameters
  • The endpoint returns reach-target goal results when behavior=reach-target is requested
  • The endpoint returns URL-param goal results when behavior=url-param is requested
  • Requesting a behavior value with missing required parameters returns a 400 error
  • Reach-target goal correctly counts sessions where the target page was visited after the reference page
  • URL-param goal correctly counts sessions where any event in the session contained the specified URL parameter
  • Existing GET /v1/analytics/sessions behavior is not affected
  • Unit tests cover service dispatch logic and parameter validation for all behavior values
  • Unit tests cover SQL logic and edge cases for reach-target queries
  • Unit tests cover SQL logic and edge cases for URL-param queries
  • Postman tests covering the new endpoint are added to the CAEM Postman collection

Additional Context

Implementation repository: dotCMS/dot-ca-event-manager

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.