Skip to content

[FEATURE] Add granularity selector for Analytics dashboard custom date ranges #33523

@oidacra

Description

@oidacra

Problem

Currently, when users select a custom date range in the Analytics dashboard, the system automatically determines the data granularity (day/week/month) based on the date range size. This automatic logic removes flexibility and control from users who may want to view their data at a specific granularity regardless of the selected date range.

Goal

Users will be able to explicitly select the data granularity (day/week/month) when using custom date ranges in the Analytics dashboard, providing them with full control over how their analytics data is aggregated and displayed. This will result in more flexible data analysis and better alignment with user reporting needs.

Target Personas

  • Content teams
  • System administrators (dotCMS)

Demo Expectations

In the demo, we will show:

  1. A user selecting a custom date range in the Analytics dashboard
  2. A new granularity selector dropdown appearing with options: Day, Week, Month
  3. The user selecting different granularity options and the dashboard updating accordingly
  4. The automatic granularity logic no longer interfering with user-selected values
  5. The selected granularity being persisted across sessions

Acceptance Criteria

  • Add a granularity selector (dropdown/select) in the Analytics dashboard UI that is only visible when custom date range is selected
  • Selector should offer three options: Day, Week, Month
  • Remove automatic granularity calculation logic when custom date range is used
  • Selected granularity should immediately update the dashboard data display
  • Granularity selection should be persisted in user preferences/localStorage
  • Default granularity should be "Day" when custom date range is first selected
  • All existing date range presets (Last 7 days, Last 30 days, etc.) should continue working as before
  • Frontend tests should validate the new selector behavior
  • Backend API should accept granularity parameter for custom date ranges

User Stories

  • As a Content Manager, I want to select weekly granularity for a 3-month custom date range, so that I can see trends without overwhelming daily detail
  • As a System Administrator, I want to select daily granularity for any custom date range, so that I can perform detailed analysis regardless of date span
  • As a Content Analyst, I want my granularity preference to be remembered, so that I don't have to reselect it every time I view the dashboard

Links

  • Component: Analytics Dashboard (core-web/libs/portlets/dot-analytics)

Metadata

Metadata

Assignees

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions