Add GET /v1/analytics/sessions/behavior endpoint with reach-target and URL-param goal support
Open
@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/behavioracceptsbehavior,experimentId,runningId, and goal-specific required parameters - The endpoint returns reach-target goal results when
behavior=reach-targetis requested - The endpoint returns URL-param goal results when
behavior=url-paramis 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/sessionsbehavior 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.