Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Fix top pages comparison tooltip missing date labels (#6221)

Sanne de Vriesad92741622b4
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4ed20bccee..08621734f9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -28,6 +28,7 @@ All notable changes to this project will be documented in this file.
- Fixed Stats API timeseries returning time buckets falling outside the queried range
- Fixed issue with all non-interactive events being counted as interactive
- Fixed countries map countries staying highlighted on Chrome
+- Fixed comparison tooltip in the top pages report missing date labels
## v3.2.0 - 2026-01-16
diff --git a/lib/plausible_web/controllers/api/stats_controller.ex b/lib/plausible_web/controllers/api/stats_controller.ex
index de7b72b5ea..68b8e22d6d 100644
--- a/lib/plausible_web/controllers/api/stats_controller.ex
+++ b/lib/plausible_web/controllers/api/stats_controller.ex
@@ -723,7 +723,7 @@ defmodule PlausibleWeb.Api.StatsController do
else
json(conn, %{
results: pages,
- meta: Map.merge(meta, Stats.Breakdown.formatted_date_ranges(query)),
+ meta: Map.new(meta.values) |> Map.merge(Stats.Breakdown.formatted_date_ranges(query)),
skip_imported_reason: meta[:imports_skip_reason]
})
end
diff --git a/test/plausible_web/controllers/api/stats_controller/pages_test.exs b/test/plausible_web/controllers/api/stats_controller/pages_test.exs
index 748d378c3f..5220a1b939 100644
--- a/test/plausible_web/controllers/api/stats_controller/pages_test.exs
+++ b/test/plausible_web/controllers/api/stats_controller/pages_test.exs
@@ -657,6 +657,8 @@ defmodule PlausibleWeb.Api.StatsController.PagesTest do
"percentage" => 100.0
}
]
+
+ assert json_response(conn, 200)["meta"] == %{"date_range_label" => "1 Jan 2021"}
end
test "returns top pages with :not_member filter on custom pageview props including (none) value",
@@ -2212,6 +2214,11 @@ defmodule PlausibleWeb.Api.StatsController.PagesTest do
}
}
]
+
+ assert json_response(conn, 200)["meta"] == %{
+ "date_range_label" => "2 Jan 2021",
+ "comparison_date_range_label" => "1 Jan 2021"
+ }
end
on_ee do