:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(web_analytics): page heatmaps-list with limit/offset, hottest-first (#63890)
Paul D'Ambraca4ce21dc5c9
diff --git a/frontend/src/lib/components/heatmaps/heatmapDataLogic.ts b/frontend/src/lib/components/heatmaps/heatmapDataLogic.tsindex bded77b54083..1104c783f21e 100644--- a/frontend/src/lib/components/heatmaps/heatmapDataLogic.ts+++ b/frontend/src/lib/components/heatmaps/heatmapDataLogic.ts@@ -30,6 +30,9 @@ import { FilterType } from '~/types'import type { heatmapDataLogicType } from './heatmapDataLogicType'+// The endpoint defaults to a bounded page for API callers; the overlay renders every point.+const UNBOUNDED_HEATMAP_LIMIT = 0+export const HEATMAP_COLOR_PALETTE_OPTIONS: LemonSelectOption<string>[] = [{ value: 'default', label: 'Default (multicolor)' },{ value: 'red', label: 'Red (monocolor)' },@@ -223,6 +226,7 @@ export const heatmapDataLogic = kea<heatmapDataLogicType>([aggregation,filter_test_accounts,cohort_ids: cohort_ids && cohort_ids.length > 0 ? cohort_ids : undefined,+ limit: UNBOUNDED_HEATMAP_LIMIT,},'?')}`diff --git a/products/web_analytics/backend/api/heatmaps_api.py b/products/web_analytics/backend/api/heatmaps_api.pyindex b93f69a5e051..c608bcfef894 100644--- a/products/web_analytics/backend/api/heatmaps_api.py+++ b/products/web_analytics/backend/api/heatmaps_api.py@@ -16,7 +16,7 @@ from posthog.schema import DateRange, HogQLFilters, HogQLQueryResponse, ProductKfrom posthog.hogql import astfrom posthog.hogql.ast import Constantfrom posthog.hogql.base import Expr-from posthog.hogql.constants import LimitContext+from posthog.hogql.constants import MAX_SELECT_HEATMAPS_LIMIT, LimitContextfrom posthog.hogql.context import HogQLContextfrom posthog.hogql.filters import replace_filtersfrom posthog.hogql.parser import parse_expr, parse_select@@ -82,6 +82,9 @@ DEFAULT_QUERY = """where {predicates})group by `pointer_target_fixed`, pointer_relative_x, client_y+ order by cnt desc+ limit {limit}+ offset {offset}"""SCROLL_DEPTH_QUERY = """@@ -210,6 +213,23 @@ class HeatmapsRequestSerializer(serializers.Serializer):help_text="JSON array of cohort IDs (e.g. '[123, 456]') to restrict results to people in those cohorts. ""Feature-flagged; ignored when the cohort filter is not enabled for the caller.",)+ limit = serializers.IntegerField(+ required=False,+ default=500,+ min_value=0,+ max_value=MAX_SELECT_HEATMAPS_LIMIT,+ help_text="Maximum number of coordinate points to return, ordered hottest-first by count. Defaults to 500. "+ "Pass 0 to fetch the full set (every coordinate) needed to render a complete heatmap overlay. "+ "Ignored for the 'scrolldepth' type, which always returns every bucket.",+ )+ offset = serializers.IntegerField(+ required=False,+ default=0,+ min_value=0,+ max_value=MAX_SELECT_HEATMAPS_LIMIT,+ help_text="Number of hottest-first points to skip, for paging through cooler coordinates. "+ "Ignored for the 'scrolldepth' type.",+ )def validate_cohort_ids(self, value: str | None) -> list[int]:if value is None or value == "":@@ -329,6 +349,12 @@ class HeatmapsResponseSerializer(serializers.Serializer):help_text="Above/below-the-fold summary for the returned interactions. Present for ""click/rageclick/mousemove; omitted for scrolldepth.",)+ has_more = serializers.BooleanField(+ required=False,+ default=False,+ help_text="True when more coordinate points exist beyond the returned page. Raise 'limit' or page with "+ "'offset' to fetch them. Always false for scrolldepth, which returns every bucket.",+ )class HeatmapScrollDepthResponseItemSerializer(serializers.Serializer):@@ -410,6 +436,8 @@ class HeatmapViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):aggregation = request_serializer.validated_data.pop("aggregation")hide_zero_coordinates = request_serializer.validated_data.pop("hide_zero_coordinates", True)+ limit = request_serializer.validated_data.pop("limit")+ offset = request_serializer.validated_data.pop("offset")if request_serializer.validated_data.get("cohort_ids") and not _heatmaps_cohort_filter_enabled(cast(User, request.user), self.team):@@ -430,7 +458,19 @@ class HeatmapViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):date_to: date | None = request_serializer.validated_data.get("date_to", None)exprs.append(self._build_test_accounts_filter(date_from, date_to))- stmt = parse_select(raw_query, {"aggregation_count": aggregation_count, "predicates": ast.And(exprs=exprs)})+ unbounded = limit == 0+ query_placeholders: dict[str, Expr] = {+ "aggregation_count": aggregation_count,+ "predicates": ast.And(exprs=exprs),+ }+ if not is_scrolldepth_query:+ # Unbounded fetches everything up to the hard cap; otherwise fetch one extra row so we can+ # report has_more without a second count query.+ fetch_limit = MAX_SELECT_HEATMAPS_LIMIT if unbounded else limit + 1+ query_placeholders["limit"] = Constant(value=fetch_limit)+ query_placeholders["offset"] = Constant(value=offset)++ stmt = parse_select(raw_query, query_placeholders)context = HogQLContext(team_id=self.team.pk, limit_top_select=False)tag_queries(product=ProductKey.HEATMAPS, feature=Feature.QUERY)results = execute_hogql_query(query=stmt, team=self.team, limit_context=LimitContext.HEATMAPS, context=context)@@ -438,8 +478,12 @@ class HeatmapViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):if is_scrolldepth_query:return self._return_scroll_depth_response(results)+ has_more = not unbounded and len(results.results or []) > limit+ if not unbounded:+ results.results = (results.results or [])[:limit]+fold = self._compute_fold_summary(exprs)- return self._return_heatmap_coordinates_response(results, fold)+ return self._return_heatmap_coordinates_response(results, fold, has_more)def _compute_fold_summary(self, exprs: List[ast.Expr]) -> dict[str, Any]: # noqa: UP006stmt = parse_select(FOLD_SUMMARY_QUERY, {"predicates": ast.And(exprs=exprs)})@@ -533,7 +577,7 @@ class HeatmapViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):@staticmethoddef _return_heatmap_coordinates_response(- query_response: HogQLQueryResponse, fold: dict[str, Any]+ query_response: HogQLQueryResponse, fold: dict[str, Any], has_more: bool) -> response.Response:data = [{@@ -545,7 +589,7 @@ class HeatmapViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):for item in query_response.results or []]- response_serializer = HeatmapsResponseSerializer(data={"results": data, "fold": fold})+ response_serializer = HeatmapsResponseSerializer(data={"results": data, "fold": fold, "has_more": has_more})response_serializer.is_valid(raise_exception=True)resp = response.Response(response_serializer.data, status=status.HTTP_200_OK)diff --git a/products/web_analytics/backend/max_tools.py b/products/web_analytics/backend/max_tools.pyindex fe6fd1254c57..42ef82d4ef51 100644--- a/products/web_analytics/backend/max_tools.py+++ b/products/web_analytics/backend/max_tools.py@@ -575,10 +575,15 @@ def _execute(team: Team, stmt: ast.SelectQuery | ast.SelectSetQuery) -> Any:def _coordinate_points(team: Team, exprs: list[ast.Expr]) -> list[dict[str, Any]]:stmt = parse_select(DEFAULT_QUERY,- {"aggregation_count": parse_expr("count(*) as cnt"), "predicates": ast.And(exprs=exprs)},+ {+ "aggregation_count": parse_expr("count(*) as cnt"),+ "predicates": ast.And(exprs=exprs),+ "limit": ast.Constant(value=_TOP_POINTS),+ "offset": ast.Constant(value=0),+ },)result = _execute(team, stmt)- points = [+ return [{"pointer_target_fixed": bool(item[0]),"pointer_relative_x": item[1],@@ -587,8 +592,6 @@ def _coordinate_points(team: Team, exprs: list[ast.Expr]) -> list[dict[str, Any]}for item in result.results or []]- points.sort(key=lambda p: p["count"], reverse=True)- return points[:_TOP_POINTS]def _fold_summary(team: Team, exprs: list[ast.Expr]) -> dict[str, Any]:diff --git a/products/web_analytics/backend/test/__snapshots__/test_heatmaps_api.ambr b/products/web_analytics/backend/test/__snapshots__/test_heatmaps_api.ambrindex 6a9f4a0ac5a6..69e6521d39e5 100644--- a/products/web_analytics/backend/test/__snapshots__/test_heatmaps_api.ambr+++ b/products/web_analytics/backend/test/__snapshots__/test_heatmaps_api.ambr@@ -18,18 +18,20 @@GROUP BY pointer_target_fixed,pointer_relative_x,client_y- LIMIT 1000000 SETTINGS readonly=2,- max_execution_time=60,- allow_experimental_object_type=1,- max_ast_elements=4000000,- max_expanded_ast_elements=4000000,- max_bytes_before_external_group_by=0,- transform_null_in=1,- optimize_min_equality_disjunction_chain_length=4294967295,- optimize_rewrite_aggregate_function_with_if=0,- optimize_min_inequality_conjunction_chain_length=4294967295,- allow_experimental_join_condition=1,- use_hive_partitioning=0+ ORDER BY cnt DESC+ LIMIT 501+ OFFSET 0 SETTINGS readonly=2,+ max_execution_time=60,+ allow_experimental_object_type=1,+ max_ast_elements=4000000,+ max_expanded_ast_elements=4000000,+ max_bytes_before_external_group_by=0,+ transform_null_in=1,+ optimize_min_equality_disjunction_chain_length=4294967295,+ optimize_rewrite_aggregate_function_with_if=0,+ optimize_min_inequality_conjunction_chain_length=4294967295,+ allow_experimental_join_condition=1,+ use_hive_partitioning=0'''# ---# name: TestSessionRecordings.test_can_filter_by_exact_url.1@@ -75,18 +77,20 @@GROUP BY pointer_target_fixed,pointer_relative_x,client_y- LIMIT 1000000 SETTINGS readonly=2,- max_execution_time=60,- allow_experimental_object_type=1,- max_ast_elements=4000000,- max_expanded_ast_elements=4000000,- max_bytes_before_external_group_by=0,- transform_null_in=1,- optimize_min_equality_disjunction_chain_length=4294967295,- optimize_rewrite_aggregate_function_with_if=0,- optimize_min_inequality_conjunction_chain_length=4294967295,- allow_experimental_join_condition=1,- use_hive_partitioning=0+ ORDER BY cnt DESC+ LIMIT 501+ OFFSET 0 SETTINGS readonly=2,+ max_execution_time=60,+ allow_experimental_object_type=1,+ max_ast_elements=4000000,+ max_expanded_ast_elements=4000000,+ max_bytes_before_external_group_by=0,+ transform_null_in=1,+ optimize_min_equality_disjunction_chain_length=4294967295,+ optimize_rewrite_aggregate_function_with_if=0,+ optimize_min_inequality_conjunction_chain_length=4294967295,+ allow_experimental_join_condition=1,+ use_hive_partitioning=0'''# ---# name: TestSessionRecordings.test_can_filter_by_exact_url.3@@ -133,18 +137,20 @@GROUP BY pointer_target_fixed,pointer_relative_x,client_y- LIMIT 1000000 SETTINGS readonly=2,- max_execution_time=60,- allow_experimental_object_type=1,- max_ast_elements=4000000,- max_expanded_ast_elements=4000000,- max_bytes_before_external_group_by=0,- transform_null_in=1,- optimize_min_equality_disjunction_chain_length=4294967295,- optimize_rewrite_aggregate_function_with_if=0,- optimize_min_inequality_conjunction_chain_length=4294967295,- allow_experimental_join_condition=1,- use_hive_partitioning=0+ ORDER BY cnt DESC+ LIMIT 501+ OFFSET 0 SETTINGS readonly=2,+ max_execution_time=60,+ allow_experimental_object_type=1,+ max_ast_elements=4000000,+ max_expanded_ast_elements=4000000,+ max_bytes_before_external_group_by=0,+ transform_null_in=1,+ optimize_min_equality_disjunction_chain_length=4294967295,+ optimize_rewrite_aggregate_function_with_if=0,+ optimize_min_inequality_conjunction_chain_length=4294967295,+ allow_experimental_join_condition=1,+ use_hive_partitioning=0'''# ---# name: TestSessionRecordings.test_can_filter_by_test_accounts.1@@ -189,18 +195,20 @@GROUP BY pointer_target_fixed,pointer_relative_x,client_y- LIMIT 1000000 SETTINGS readonly=2,- max_execution_time=60,- allow_experimental_object_type=1,- max_ast_elements=4000000,- max_expanded_ast_elements=4000000,- max_bytes_before_external_group_by=0,- transform_null_in=1,- optimize_min_equality_disjunction_chain_length=4294967295,- optimize_rewrite_aggregate_function_with_if=0,- optimize_min_inequality_conjunction_chain_length=4294967295,- allow_experimental_join_condition=1,- use_hive_partitioning=0+ ORDER BY cnt DESC+ LIMIT 501+ OFFSET 0 SETTINGS readonly=2,+ max_execution_time=60,+ allow_experimental_object_type=1,+ max_ast_elements=4000000,+ max_expanded_ast_elements=4000000,+ max_bytes_before_external_group_by=0,+ transform_null_in=1,+ optimize_min_equality_disjunction_chain_length=4294967295,+ optimize_rewrite_aggregate_function_with_if=0,+ optimize_min_inequality_conjunction_chain_length=4294967295,+ allow_experimental_join_condition=1,+ use_hive_partitioning=0'''# ---# name: TestSessionRecordings.test_can_filter_by_test_accounts.3@@ -242,18 +250,20 @@GROUP BY pointer_target_fixed,pointer_relative_x,client_y- LIMIT 1000000 SETTINGS readonly=2,- max_execution_time=60,- allow_experimental_object_type=1,- max_ast_elements=4000000,- max_expanded_ast_elements=4000000,- max_bytes_before_external_group_by=0,- transform_null_in=1,- optimize_min_equality_disjunction_chain_length=4294967295,- optimize_rewrite_aggregate_function_with_if=0,- optimize_min_inequality_conjunction_chain_length=4294967295,- allow_experimental_join_condition=1,- use_hive_partitioning=0+ ORDER BY cnt DESC+ LIMIT 501+ OFFSET 0 SETTINGS readonly=2,+ max_execution_time=60,+ allow_experimental_object_type=1,+ max_ast_elements=4000000,+ max_expanded_ast_elements=4000000,+ max_bytes_before_external_group_by=0,+ transform_null_in=1,+ optimize_min_equality_disjunction_chain_length=4294967295,+ optimize_rewrite_aggregate_function_with_if=0,+ optimize_min_inequality_conjunction_chain_length=4294967295,+ allow_experimental_join_condition=1,+ use_hive_partitioning=0'''# ---# name: TestSessionRecordings.test_can_filter_by_url_pattern_http://example.com*.1@@ -295,18 +305,20 @@GROUP BY pointer_target_fixed,pointer_relative_x,client_y- LIMIT 1000000 SETTINGS readonly=2,- max_execution_time=60,- allow_experimental_object_type=1,- max_ast_elements=4000000,- max_expanded_ast_elements=4000000,- max_bytes_before_external_group_by=0,- transform_null_in=1,- optimize_min_equality_disjunction_chain_length=4294967295,- optimize_rewrite_aggregate_function_with_if=0,- optimize_min_inequality_conjunction_chain_length=4294967295,- allow_experimental_join_condition=1,- use_hive_partitioning=0+ ORDER BY cnt DESC+ LIMIT 501+ OFFSET 0 SETTINGS readonly=2,+ max_execution_time=60,+ allow_experimental_object_type=1,+ max_ast_elements=4000000,+ max_expanded_ast_elements=4000000,+ max_bytes_before_external_group_by=0,+ transform_null_in=1,+ optimize_min_equality_disjunction_chain_length=4294967295,+ optimize_rewrite_aggregate_function_with_if=0,+ optimize_min_inequality_conjunction_chain_length=4294967295,+ allow_experimental_join_condition=1,+ use_hive_partitioning=0'''# ---# name: TestSessionRecordings.test_can_filter_by_url_pattern_http://example.com*.3@@ -348,18 +360,20 @@GROUP BY pointer_target_fixed,pointer_relative_x,client_y- LIMIT 1000000 SETTINGS readonly=2,- max_execution_time=60,- allow_experimental_object_type=1,- max_ast_elements=4000000,- max_expanded_ast_elements=4000000,- max_bytes_before_external_group_by=0,- transform_null_in=1,- optimize_min_equality_disjunction_chain_length=4294967295,- optimize_rewrite_aggregate_function_with_if=0,- optimize_min_inequality_conjunction_chain_length=4294967295,- allow_experimental_join_condition=1,- use_hive_partitioning=0+ ORDER BY cnt DESC+ LIMIT 501+ OFFSET 0 SETTINGS readonly=2,+ max_execution_time=60,+ allow_experimental_object_type=1,+ max_ast_elements=4000000,+ max_expanded_ast_elements=4000000,+ max_bytes_before_external_group_by=0,+ transform_null_in=1,+ optimize_min_equality_disjunction_chain_length=4294967295,+ optimize_rewrite_aggregate_function_with_if=0,+ optimize_min_inequality_conjunction_chain_length=4294967295,+ allow_experimental_join_condition=1,+ use_hive_partitioning=0'''# ---# name: TestSessionRecordings.test_can_filter_by_url_pattern_http://example.com/products*.1@@ -401,18 +415,20 @@GROUP BY pointer_target_fixed,pointer_relative_x,client_y- LIMIT 1000000 SETTINGS readonly=2,- max_execution_time=60,- allow_experimental_object_type=1,- max_ast_elements=4000000,- max_expanded_ast_elements=4000000,- max_bytes_before_external_group_by=0,- transform_null_in=1,- optimize_min_equality_disjunction_chain_length=4294967295,- optimize_rewrite_aggregate_function_with_if=0,- optimize_min_inequality_conjunction_chain_length=4294967295,- allow_experimental_join_condition=1,- use_hive_partitioning=0+ ORDER BY cnt DESC+ LIMIT 501+ OFFSET 0 SETTINGS readonly=2,+ max_execution_time=60,+ allow_experimental_object_type=1,+ max_ast_elements=4000000,+ max_expanded_ast_elements=4000000,+ max_bytes_before_external_group_by=0,+ transform_null_in=1,+ optimize_min_equality_disjunction_chain_length=4294967295,+ optimize_rewrite_aggregate_function_with_if=0,+ optimize_min_inequality_conjunction_chain_length=4294967295,+ allow_experimental_join_condition=1,+ use_hive_partitioning=0'''# ---# name: TestSessionRecordings.test_can_filter_by_url_pattern_http://example.com/products*.3@@ -454,18 +470,20 @@GROUP BY pointer_target_fixed,pointer_relative_x,client_y- LIMIT 1000000 SETTINGS readonly=2,- max_execution_time=60,- allow_experimental_object_type=1,- max_ast_elements=4000000,- max_expanded_ast_elements=4000000,- max_bytes_before_external_group_by=0,- transform_null_in=1,- optimize_min_equality_disjunction_chain_length=4294967295,- optimize_rewrite_aggregate_function_with_if=0,- optimize_min_inequality_conjunction_chain_length=4294967295,- allow_experimental_join_condition=1,- use_hive_partitioning=0+ ORDER BY cnt DESC+ LIMIT 501+ OFFSET 0 SETTINGS readonly=2,+ max_execution_time=60,+ allow_experimental_object_type=1,+ max_ast_elements=4000000,+ max_expanded_ast_elements=4000000,+ max_bytes_before_external_group_by=0,+ transform_null_in=1,+ optimize_min_equality_disjunction_chain_length=4294967295,+ optimize_rewrite_aggregate_function_with_if=0,+ optimize_min_inequality_conjunction_chain_length=4294967295,+ allow_experimental_join_condition=1,+ use_hive_partitioning=0'''# ---# name: TestSessionRecordings.test_can_filter_by_url_pattern_http://example.com/products/*/parts/*.1@@ -507,18 +525,20 @@GROUP BY pointer_target_fixed,pointer_relative_x,client_y- LIMIT 1000000 SETTINGS readonly=2,- max_execution_time=60,- allow_experimental_object_type=1,- max_ast_elements=4000000,- max_expanded_ast_elements=4000000,- max_bytes_before_external_group_by=0,- transform_null_in=1,- optimize_min_equality_disjunction_chain_length=4294967295,- optimize_rewrite_aggregate_function_with_if=0,- optimize_min_inequality_conjunction_chain_length=4294967295,- allow_experimental_join_condition=1,- use_hive_partitioning=0+ ORDER BY cnt DESC+ LIMIT 501+ OFFSET 0 SETTINGS readonly=2,+ max_execution_time=60,+ allow_experimental_object_type=1,+ max_ast_elements=4000000,+ max_expanded_ast_elements=4000000,+ max_bytes_before_external_group_by=0,+ transform_null_in=1,+ optimize_min_equality_disjunction_chain_length=4294967295,+ optimize_rewrite_aggregate_function_with_if=0,+ optimize_min_inequality_conjunction_chain_length=4294967295,+ allow_experimental_join_condition=1,+ use_hive_partitioning=0'''# ---# name: TestSessionRecordings.test_can_filter_by_url_pattern_http://example.com/products/*/parts/*.3@@ -560,18 +580,20 @@GROUP BY pointer_target_fixed,pointer_relative_x,client_y- LIMIT 1000000 SETTINGS readonly=2,- max_execution_time=60,- allow_experimental_object_type=1,- max_ast_elements=4000000,- max_expanded_ast_elements=4000000,- max_bytes_before_external_group_by=0,- transform_null_in=1,- optimize_min_equality_disjunction_chain_length=4294967295,- optimize_rewrite_aggregate_function_with_if=0,- optimize_min_inequality_conjunction_chain_length=4294967295,- allow_experimental_join_condition=1,- use_hive_partitioning=0+ ORDER BY cnt DESC+ LIMIT 501+ OFFSET 0 SETTINGS readonly=2,+ max_execution_time=60,+ allow_experimental_object_type=1,+ max_ast_elements=4000000,+ max_expanded_ast_elements=4000000,+ max_bytes_before_external_group_by=0,+ transform_null_in=1,+ optimize_min_equality_disjunction_chain_length=4294967295,+ optimize_rewrite_aggregate_function_with_if=0,+ optimize_min_inequality_conjunction_chain_length=4294967295,+ allow_experimental_join_condition=1,+ use_hive_partitioning=0'''# ---# name: TestSessionRecordings.test_can_filter_by_url_pattern_http://example.com/products/*/reviews/*.1@@ -613,18 +635,20 @@GROUP BY pointer_target_fixed,pointer_relative_x,client_y- LIMIT 1000000 SETTINGS readonly=2,- max_execution_time=60,- allow_experimental_object_type=1,- max_ast_elements=4000000,- max_expanded_ast_elements=4000000,- max_bytes_before_external_group_by=0,- transform_null_in=1,- optimize_min_equality_disjunction_chain_length=4294967295,- optimize_rewrite_aggregate_function_with_if=0,- optimize_min_inequality_conjunction_chain_length=4294967295,- allow_experimental_join_condition=1,- use_hive_partitioning=0+ ORDER BY cnt DESC+ LIMIT 501+ OFFSET 0 SETTINGS readonly=2,+ max_execution_time=60,+ allow_experimental_object_type=1,+ max_ast_elements=4000000,+ max_expanded_ast_elements=4000000,+ max_bytes_before_external_group_by=0,+ transform_null_in=1,+ optimize_min_equality_disjunction_chain_length=4294967295,+ optimize_rewrite_aggregate_function_with_if=0,+ optimize_min_inequality_conjunction_chain_length=4294967295,+ allow_experimental_join_condition=1,+ use_hive_partitioning=0'''# ---# name: TestSessionRecordings.test_can_filter_by_url_pattern_http://example.com/products/*/reviews/*.3@@ -666,18 +690,20 @@GROUP BY pointer_target_fixed,pointer_relative_x,client_y- LIMIT 1000000 SETTINGS readonly=2,- max_execution_time=60,- allow_experimental_object_type=1,- max_ast_elements=4000000,- max_expanded_ast_elements=4000000,- max_bytes_before_external_group_by=0,- transform_null_in=1,- optimize_min_equality_disjunction_chain_length=4294967295,- optimize_rewrite_aggregate_function_with_if=0,- optimize_min_inequality_conjunction_chain_length=4294967295,- allow_experimental_join_condition=1,- use_hive_partitioning=0+ ORDER BY cnt DESC+ LIMIT 501+ OFFSET 0 SETTINGS readonly=2,+ max_execution_time=60,+ allow_experimental_object_type=1,+ max_ast_elements=4000000,+ max_expanded_ast_elements=4000000,+ max_bytes_before_external_group_by=0,+ transform_null_in=1,+ optimize_min_equality_disjunction_chain_length=4294967295,+ optimize_rewrite_aggregate_function_with_if=0,+ optimize_min_inequality_conjunction_chain_length=4294967295,+ allow_experimental_join_condition=1,+ use_hive_partitioning=0'''# ---# name: TestSessionRecordings.test_can_filter_by_url_pattern_http://example.com/products/1*.1@@ -719,18 +745,20 @@GROUP BY pointer_target_fixed,pointer_relative_x,client_y- LIMIT 1000000 SETTINGS readonly=2,- max_execution_time=60,- allow_experimental_object_type=1,- max_ast_elements=4000000,- max_expanded_ast_elements=4000000,- max_bytes_before_external_group_by=0,- transform_null_in=1,- optimize_min_equality_disjunction_chain_length=4294967295,- optimize_rewrite_aggregate_function_with_if=0,- optimize_min_inequality_conjunction_chain_length=4294967295,- allow_experimental_join_condition=1,- use_hive_partitioning=0+ ORDER BY cnt DESC+ LIMIT 501+ OFFSET 0 SETTINGS readonly=2,+ max_execution_time=60,+ allow_experimental_object_type=1,+ max_ast_elements=4000000,+ max_expanded_ast_elements=4000000,+ max_bytes_before_external_group_by=0,+ transform_null_in=1,+ optimize_min_equality_disjunction_chain_length=4294967295,+ optimize_rewrite_aggregate_function_with_if=0,+ optimize_min_inequality_conjunction_chain_length=4294967295,+ allow_experimental_join_condition=1,+ use_hive_partitioning=0'''# ---# name: TestSessionRecordings.test_can_filter_by_url_pattern_http://example.com/products/1*.3@@ -772,18 +800,20 @@GROUP BY pointer_target_fixed,pointer_relative_x,client_y- LIMIT 1000000 SETTINGS readonly=2,- max_execution_time=60,- allow_experimental_object_type=1,- max_ast_elements=4000000,- max_expanded_ast_elements=4000000,- max_bytes_before_external_group_by=0,- transform_null_in=1,- optimize_min_equality_disjunction_chain_length=4294967295,- optimize_rewrite_aggregate_function_with_if=0,- optimize_min_inequality_conjunction_chain_length=4294967295,- allow_experimental_join_condition=1,- use_hive_partitioning=0+ ORDER BY cnt DESC+ LIMIT 501+ OFFSET 0 SETTINGS readonly=2,+ max_execution_time=60,+ allow_experimental_object_type=1,+ max_ast_elements=4000000,+ max_expanded_ast_elements=4000000,+ max_bytes_before_external_group_by=0,+ transform_null_in=1,+ optimize_min_equality_disjunction_chain_length=4294967295,+ optimize_rewrite_aggregate_function_with_if=0,+ optimize_min_inequality_conjunction_chain_length=4294967295,+ allow_experimental_join_condition=1,+ use_hive_partitioning=0'''# ---# name: TestSessionRecordings.test_can_filter_by_url_pattern_http://example.com/products/1*/parts/*.1@@ -825,18 +855,20 @@GROUP BY pointer_target_fixed,pointer_relative_x,client_y- LIMIT 1000000 SETTINGS readonly=2,- max_execution_time=60,- allow_experimental_object_type=1,- max_ast_elements=4000000,- max_expanded_ast_elements=4000000,- max_bytes_before_external_group_by=0,- transform_null_in=1,- optimize_min_equality_disjunction_chain_length=4294967295,- optimize_rewrite_aggregate_function_with_if=0,- optimize_min_inequality_conjunction_chain_length=4294967295,- allow_experimental_join_condition=1,- use_hive_partitioning=0+ ORDER BY cnt DESC+ LIMIT 501+ OFFSET 0 SETTINGS readonly=2,+ max_execution_time=60,+ allow_experimental_object_type=1,+ max_ast_elements=4000000,+ max_expanded_ast_elements=4000000,+ max_bytes_before_external_group_by=0,+ transform_null_in=1,+ optimize_min_equality_disjunction_chain_length=4294967295,+ optimize_rewrite_aggregate_function_with_if=0,+ optimize_min_inequality_conjunction_chain_length=4294967295,+ allow_experimental_join_condition=1,+ use_hive_partitioning=0'''# ---# name: TestSessionRecordings.test_can_filter_by_url_pattern_http://example.com/products/1*/parts/*.3@@ -878,18 +910,20 @@GROUP BY pointer_target_fixed,pointer_relative_x,client_y- LIMIT 1000000 SETTINGS readonly=2,- max_execution_time=60,- allow_experimental_object_type=1,- max_ast_elements=4000000,- max_expanded_ast_elements=4000000,- max_bytes_before_external_group_by=0,- transform_null_in=1,- optimize_min_equality_disjunction_chain_length=4294967295,- optimize_rewrite_aggregate_function_with_if=0,- optimize_min_inequality_conjunction_chain_length=4294967295,- allow_experimental_join_condition=1,- use_hive_partitioning=0+ ORDER BY cnt DESC+ LIMIT 501+ OFFSET 0 SETTINGS readonly=2,+ max_execution_time=60,+ allow_experimental_object_type=1,+ max_ast_elements=4000000,+ max_expanded_ast_elements=4000000,+ max_bytes_before_external_group_by=0,+ transform_null_in=1,+ optimize_min_equality_disjunction_chain_length=4294967295,+ optimize_rewrite_aggregate_function_with_if=0,+ optimize_min_inequality_conjunction_chain_length=4294967295,+ allow_experimental_join_condition=1,+ use_hive_partitioning=0'''# ---# name: TestSessionRecordings.test_can_filter_by_url_pattern_where_end_is_anchored.1@@ -931,18 +965,20 @@GROUP BY pointer_target_fixed,pointer_relative_x,client_y- LIMIT 1000000 SETTINGS readonly=2,- max_execution_time=60,- allow_experimental_object_type=1,- max_ast_elements=4000000,- max_expanded_ast_elements=4000000,- max_bytes_before_external_group_by=0,- transform_null_in=1,- optimize_min_equality_disjunction_chain_length=4294967295,- optimize_rewrite_aggregate_function_with_if=0,- optimize_min_inequality_conjunction_chain_length=4294967295,- allow_experimental_join_condition=1,- use_hive_partitioning=0+ ORDER BY cnt DESC+ LIMIT 501+ OFFSET 0 SETTINGS readonly=2,+ max_execution_time=60,+ allow_experimental_object_type=1,+ max_ast_elements=4000000,+ max_expanded_ast_elements=4000000,+ max_bytes_before_external_group_by=0,+ transform_null_in=1,+ optimize_min_equality_disjunction_chain_length=4294967295,+ optimize_rewrite_aggregate_function_with_if=0,+ optimize_min_inequality_conjunction_chain_length=4294967295,+ allow_experimental_join_condition=1,+ use_hive_partitioning=0'''# ---# name: TestSessionRecordings.test_can_filter_by_viewport_0_min_150.1@@ -984,18 +1020,20 @@GROUP BY pointer_target_fixed,pointer_relative_x,client_y- LIMIT 1000000 SETTINGS readonly=2,- max_execution_time=60,- allow_experimental_object_type=1,- max_ast_elements=4000000,- max_expanded_ast_elements=4000000,- max_bytes_before_external_group_by=0,- transform_null_in=1,- optimize_min_equality_disjunction_chain_length=4294967295,- optimize_rewrite_aggregate_function_with_if=0,- optimize_min_inequality_conjunction_chain_length=4294967295,- allow_experimental_join_condition=1,- use_hive_partitioning=0+ ORDER BY cnt DESC+ LIMIT 501+ OFFSET 0 SETTINGS readonly=2,+ max_execution_time=60,+ allow_experimental_object_type=1,+ max_ast_elements=4000000,+ max_expanded_ast_elements=4000000,+ max_bytes_before_external_group_by=0,+ transform_null_in=1,+ optimize_min_equality_disjunction_chain_length=4294967295,+ optimize_rewrite_aggregate_function_with_if=0,+ optimize_min_inequality_conjunction_chain_length=4294967295,+ allow_experimental_join_condition=1,+ use_hive_partitioning=0'''# ---# name: TestSessionRecordings.test_can_filter_by_viewport_1_min_161.1@@ -1037,18 +1075,20 @@GROUP BY pointer_target_fixed,pointer_relative_x,client_y- LIMIT 1000000 SETTINGS readonly=2,- max_execution_time=60,- allow_experimental_object_type=1,- max_ast_elements=4000000,- max_expanded_ast_elements=4000000,- max_bytes_before_external_group_by=0,- transform_null_in=1,- optimize_min_equality_disjunction_chain_length=4294967295,- optimize_rewrite_aggregate_function_with_if=0,- optimize_min_inequality_conjunction_chain_length=4294967295,- allow_experimental_join_condition=1,- use_hive_partitioning=0+ ORDER BY cnt DESC+ LIMIT 501+ OFFSET 0 SETTINGS readonly=2,+ max_execution_time=60,+ allow_experimental_object_type=1,+ max_ast_elements=4000000,+ max_expanded_ast_elements=4000000,+ max_bytes_before_external_group_by=0,+ transform_null_in=1,+ optimize_min_equality_disjunction_chain_length=4294967295,+ optimize_rewrite_aggregate_function_with_if=0,+ optimize_min_inequality_conjunction_chain_length=4294967295,+ allow_experimental_join_condition=1,+ use_hive_partitioning=0'''# ---# name: TestSessionRecordings.test_can_filter_by_viewport_2_min_177.1@@ -1090,18 +1130,20 @@GROUP BY pointer_target_fixed,pointer_relative_x,client_y- LIMIT 1000000 SETTINGS readonly=2,- max_execution_time=60,- allow_experimental_object_type=1,- max_ast_elements=4000000,- max_expanded_ast_elements=4000000,- max_bytes_before_external_group_by=0,- transform_null_in=1,- optimize_min_equality_disjunction_chain_length=4294967295,- optimize_rewrite_aggregate_function_with_if=0,- optimize_min_inequality_conjunction_chain_length=4294967295,- allow_experimental_join_condition=1,- use_hive_partitioning=0+ ORDER BY cnt DESC+ LIMIT 501+ OFFSET 0 SETTINGS readonly=2,+ max_execution_time=60,+ allow_experimental_object_type=1,+ max_ast_elements=4000000,+ max_expanded_ast_elements=4000000,+ max_bytes_before_external_group_by=0,+ transform_null_in=1,+ optimize_min_equality_disjunction_chain_length=4294967295,+ optimize_rewrite_aggregate_function_with_if=0,+ optimize_min_inequality_conjunction_chain_length=4294967295,+ allow_experimental_join_condition=1,+ use_hive_partitioning=0'''# ---# name: TestSessionRecordings.test_can_filter_by_viewport_3_min_201.1@@ -1143,18 +1185,20 @@GROUP BY pointer_target_fixed,pointer_relative_x,client_y- LIMIT 1000000 SETTINGS readonly=2,- max_execution_time=60,- allow_experimental_object_type=1,- max_ast_elements=4000000,- max_expanded_ast_elements=4000000,- max_bytes_before_external_group_by=0,- transform_null_in=1,- optimize_min_equality_disjunction_chain_length=4294967295,- optimize_rewrite_aggregate_function_with_if=0,- optimize_min_inequality_conjunction_chain_length=4294967295,- allow_experimental_join_condition=1,- use_hive_partitioning=0+ ORDER BY cnt DESC+ LIMIT 501+ OFFSET 0 SETTINGS readonly=2,+ max_execution_time=60,+ allow_experimental_object_type=1,+ max_ast_elements=4000000,+ max_expanded_ast_elements=4000000,+ max_bytes_before_external_group_by=0,+ transform_null_in=1,+ optimize_min_equality_disjunction_chain_length=4294967295,+ optimize_rewrite_aggregate_function_with_if=0,+ optimize_min_inequality_conjunction_chain_length=4294967295,+ allow_experimental_join_condition=1,+ use_hive_partitioning=0'''# ---# name: TestSessionRecordings.test_can_filter_by_viewport_4_min_161_and_max_192.1@@ -1196,18 +1240,20 @@GROUP BY pointer_target_fixed,pointer_relative_x,client_y- LIMIT 1000000 SETTINGS readonly=2,- max_execution_time=60,- allow_experimental_object_type=1,- max_ast_elements=4000000,- max_expanded_ast_elements=4000000,- max_bytes_before_external_group_by=0,- transform_null_in=1,- optimize_min_equality_disjunction_chain_length=4294967295,- optimize_rewrite_aggregate_function_with_if=0,- optimize_min_inequality_conjunction_chain_length=4294967295,- allow_experimental_join_condition=1,- use_hive_partitioning=0+ ORDER BY cnt DESC+ LIMIT 501+ OFFSET 0 SETTINGS readonly=2,+ max_execution_time=60,+ allow_experimental_object_type=1,+ max_ast_elements=4000000,+ max_expanded_ast_elements=4000000,+ max_bytes_before_external_group_by=0,+ transform_null_in=1,+ optimize_min_equality_disjunction_chain_length=4294967295,+ optimize_rewrite_aggregate_function_with_if=0,+ optimize_min_inequality_conjunction_chain_length=4294967295,+ allow_experimental_join_condition=1,+ use_hive_partitioning=0'''# ---# name: TestSessionRecordings.test_can_get_all_data_response.1@@ -1249,18 +1295,20 @@GROUP BY pointer_target_fixed,pointer_relative_x,client_y- LIMIT 1000000 SETTINGS readonly=2,- max_execution_time=60,- allow_experimental_object_type=1,- max_ast_elements=4000000,- max_expanded_ast_elements=4000000,- max_bytes_before_external_group_by=0,- transform_null_in=1,- optimize_min_equality_disjunction_chain_length=4294967295,- optimize_rewrite_aggregate_function_with_if=0,- optimize_min_inequality_conjunction_chain_length=4294967295,- allow_experimental_join_condition=1,- use_hive_partitioning=0+ ORDER BY cnt DESC+ LIMIT 501+ OFFSET 0 SETTINGS readonly=2,+ max_execution_time=60,+ allow_experimental_object_type=1,+ max_ast_elements=4000000,+ max_expanded_ast_elements=4000000,+ max_bytes_before_external_group_by=0,+ transform_null_in=1,+ optimize_min_equality_disjunction_chain_length=4294967295,+ optimize_rewrite_aggregate_function_with_if=0,+ optimize_min_inequality_conjunction_chain_length=4294967295,+ allow_experimental_join_condition=1,+ use_hive_partitioning=0'''# ---# name: TestSessionRecordings.test_can_get_count_by_aggregation.1@@ -1302,18 +1350,20 @@GROUP BY pointer_target_fixed,pointer_relative_x,client_y- LIMIT 1000000 SETTINGS readonly=2,- max_execution_time=60,- allow_experimental_object_type=1,- max_ast_elements=4000000,- max_expanded_ast_elements=4000000,- max_bytes_before_external_group_by=0,- transform_null_in=1,- optimize_min_equality_disjunction_chain_length=4294967295,- optimize_rewrite_aggregate_function_with_if=0,- optimize_min_inequality_conjunction_chain_length=4294967295,- allow_experimental_join_condition=1,- use_hive_partitioning=0+ ORDER BY cnt DESC+ LIMIT 501+ OFFSET 0 SETTINGS readonly=2,+ max_execution_time=60,+ allow_experimental_object_type=1,+ max_ast_elements=4000000,+ max_expanded_ast_elements=4000000,+ max_bytes_before_external_group_by=0,+ transform_null_in=1,+ optimize_min_equality_disjunction_chain_length=4294967295,+ optimize_rewrite_aggregate_function_with_if=0,+ optimize_min_inequality_conjunction_chain_length=4294967295,+ allow_experimental_join_condition=1,+ use_hive_partitioning=0'''# ---# name: TestSessionRecordings.test_can_get_count_by_aggregation.3@@ -1355,18 +1405,20 @@GROUP BY pointer_target_fixed,pointer_relative_x,client_y- LIMIT 1000000 SETTINGS readonly=2,- max_execution_time=60,- allow_experimental_object_type=1,- max_ast_elements=4000000,- max_expanded_ast_elements=4000000,- max_bytes_before_external_group_by=0,- transform_null_in=1,- optimize_min_equality_disjunction_chain_length=4294967295,- optimize_rewrite_aggregate_function_with_if=0,- optimize_min_inequality_conjunction_chain_length=4294967295,- allow_experimental_join_condition=1,- use_hive_partitioning=0+ ORDER BY cnt DESC+ LIMIT 501+ OFFSET 0 SETTINGS readonly=2,+ max_execution_time=60,+ allow_experimental_object_type=1,+ max_ast_elements=4000000,+ max_expanded_ast_elements=4000000,+ max_bytes_before_external_group_by=0,+ transform_null_in=1,+ optimize_min_equality_disjunction_chain_length=4294967295,+ optimize_rewrite_aggregate_function_with_if=0,+ optimize_min_inequality_conjunction_chain_length=4294967295,+ allow_experimental_join_condition=1,+ use_hive_partitioning=0'''# ---# name: TestSessionRecordings.test_can_get_empty_response.1@@ -1408,18 +1460,20 @@GROUP BY pointer_target_fixed,pointer_relative_x,client_y- LIMIT 1000000 SETTINGS readonly=2,- max_execution_time=60,- allow_experimental_object_type=1,- max_ast_elements=4000000,- max_expanded_ast_elements=4000000,- max_bytes_before_external_group_by=0,- transform_null_in=1,- optimize_min_equality_disjunction_chain_length=4294967295,- optimize_rewrite_aggregate_function_with_if=0,- optimize_min_inequality_conjunction_chain_length=4294967295,- allow_experimental_join_condition=1,- use_hive_partitioning=0+ ORDER BY cnt DESC+ LIMIT 501+ OFFSET 0 SETTINGS readonly=2,+ max_execution_time=60,+ allow_experimental_object_type=1,+ max_ast_elements=4000000,+ max_expanded_ast_elements=4000000,+ max_bytes_before_external_group_by=0,+ transform_null_in=1,+ optimize_min_equality_disjunction_chain_length=4294967295,+ optimize_rewrite_aggregate_function_with_if=0,+ optimize_min_inequality_conjunction_chain_length=4294967295,+ allow_experimental_join_condition=1,+ use_hive_partitioning=0'''# ---# name: TestSessionRecordings.test_can_get_filter_by_click.1@@ -1461,18 +1515,20 @@GROUP BY pointer_target_fixed,pointer_relative_x,client_y- LIMIT 1000000 SETTINGS readonly=2,- max_execution_time=60,- allow_experimental_object_type=1,- max_ast_elements=4000000,- max_expanded_ast_elements=4000000,- max_bytes_before_external_group_by=0,- transform_null_in=1,- optimize_min_equality_disjunction_chain_length=4294967295,- optimize_rewrite_aggregate_function_with_if=0,- optimize_min_inequality_conjunction_chain_length=4294967295,- allow_experimental_join_condition=1,- use_hive_partitioning=0+ ORDER BY cnt DESC+ LIMIT 501+ OFFSET 0 SETTINGS readonly=2,+ max_execution_time=60,+ allow_experimental_object_type=1,+ max_ast_elements=4000000,+ max_expanded_ast_elements=4000000,+ max_bytes_before_external_group_by=0,+ transform_null_in=1,+ optimize_min_equality_disjunction_chain_length=4294967295,+ optimize_rewrite_aggregate_function_with_if=0,+ optimize_min_inequality_conjunction_chain_length=4294967295,+ allow_experimental_join_condition=1,+ use_hive_partitioning=0'''# ---# name: TestSessionRecordings.test_can_get_filter_by_click.3@@ -1514,18 +1570,20 @@GROUP BY pointer_target_fixed,pointer_relative_x,client_y- LIMIT 1000000 SETTINGS readonly=2,- max_execution_time=60,- allow_experimental_object_type=1,- max_ast_elements=4000000,- max_expanded_ast_elements=4000000,- max_bytes_before_external_group_by=0,- transform_null_in=1,- optimize_min_equality_disjunction_chain_length=4294967295,- optimize_rewrite_aggregate_function_with_if=0,- optimize_min_inequality_conjunction_chain_length=4294967295,- allow_experimental_join_condition=1,- use_hive_partitioning=0+ ORDER BY cnt DESC+ LIMIT 501+ OFFSET 0 SETTINGS readonly=2,+ max_execution_time=60,+ allow_experimental_object_type=1,+ max_ast_elements=4000000,+ max_expanded_ast_elements=4000000,+ max_bytes_before_external_group_by=0,+ transform_null_in=1,+ optimize_min_equality_disjunction_chain_length=4294967295,+ optimize_rewrite_aggregate_function_with_if=0,+ optimize_min_inequality_conjunction_chain_length=4294967295,+ allow_experimental_join_condition=1,+ use_hive_partitioning=0'''# ---# name: TestSessionRecordings.test_can_get_filter_by_date_from.1@@ -1567,18 +1625,20 @@GROUP BY pointer_target_fixed,pointer_relative_x,client_y- LIMIT 1000000 SETTINGS readonly=2,- max_execution_time=60,- allow_experimental_object_type=1,- max_ast_elements=4000000,- max_expanded_ast_elements=4000000,- max_bytes_before_external_group_by=0,- transform_null_in=1,- optimize_min_equality_disjunction_chain_length=4294967295,- optimize_rewrite_aggregate_function_with_if=0,- optimize_min_inequality_conjunction_chain_length=4294967295,- allow_experimental_join_condition=1,- use_hive_partitioning=0+ ORDER BY cnt DESC+ LIMIT 501+ OFFSET 0 SETTINGS readonly=2,+ max_execution_time=60,+ allow_experimental_object_type=1,+ max_ast_elements=4000000,+ max_expanded_ast_elements=4000000,+ max_bytes_before_external_group_by=0,+ transform_null_in=1,+ optimize_min_equality_disjunction_chain_length=4294967295,+ optimize_rewrite_aggregate_function_with_if=0,+ optimize_min_inequality_conjunction_chain_length=4294967295,+ allow_experimental_join_condition=1,+ use_hive_partitioning=0'''# ---# name: TestSessionRecordings.test_can_get_filter_by_relative_date.1@@ -1620,18 +1680,20 @@GROUP BY pointer_target_fixed,pointer_relative_x,client_y- LIMIT 1000000 SETTINGS readonly=2,- max_execution_time=60,- allow_experimental_object_type=1,- max_ast_elements=4000000,- max_expanded_ast_elements=4000000,- max_bytes_before_external_group_by=0,- transform_null_in=1,- optimize_min_equality_disjunction_chain_length=4294967295,- optimize_rewrite_aggregate_function_with_if=0,- optimize_min_inequality_conjunction_chain_length=4294967295,- allow_experimental_join_condition=1,- use_hive_partitioning=0+ ORDER BY cnt DESC+ LIMIT 501+ OFFSET 0 SETTINGS readonly=2,+ max_execution_time=60,+ allow_experimental_object_type=1,+ max_ast_elements=4000000,+ max_expanded_ast_elements=4000000,+ max_bytes_before_external_group_by=0,+ transform_null_in=1,+ optimize_min_equality_disjunction_chain_length=4294967295,+ optimize_rewrite_aggregate_function_with_if=0,+ optimize_min_inequality_conjunction_chain_length=4294967295,+ allow_experimental_join_condition=1,+ use_hive_partitioning=0'''# ---# name: TestSessionRecordings.test_can_get_filter_by_relative_date.3diff --git a/products/web_analytics/backend/test/test_heatmaps_api.py b/products/web_analytics/backend/test/test_heatmaps_api.pyindex 19085e34a616..963e092b6ab6 100644--- a/products/web_analytics/backend/test/test_heatmaps_api.py+++ b/products/web_analytics/backend/test/test_heatmaps_api.py@@ -158,6 +158,7 @@ class TestSessionRecordings(APIBaseTest, ClickhouseTestMixin, QueryMatchingTest)"pct_below_fold": 0.0,"median_viewport_height": None,},+ "has_more": False,},)@@ -227,6 +228,51 @@ class TestSessionRecordings(APIBaseTest, ClickhouseTestMixin, QueryMatchingTest)self._assert_heatmap_single_result_count({"date_from": "2023-03-08", "type": "rageclick"}, 2)+ def _create_three_distinct_points(self) -> None:+ # three distinct coordinates (differ by x) with counts 1, 2, 3 — created coolest-first so+ # insertion order is the reverse of count order, making the hottest-first assertions fail+ # if the query stops ordering by count.+ self._create_heatmap_event("s3", "click", "2023-03-08T08:00:00", x=80)+ for _ in range(2):+ self._create_heatmap_event("s2", "click", "2023-03-08T08:00:00", x=48)+ for _ in range(3):+ self._create_heatmap_event("s1", "click", "2023-03-08T08:00:00", x=16)++ @parameterized.expand(+ [+ ("default_returns_all", None, None, [3, 2, 1], False),+ ("limit_zero_is_unbounded", 0, None, [3, 2, 1], False),+ ("limit_truncates_hottest_first", 2, None, [3, 2], True),+ ("limit_equal_to_total", 3, None, [3, 2, 1], False),+ ("offset_pages_into_cooler_points", 2, 1, [2, 1], False),+ ("offset_past_end_returns_empty", 2, 5, [], False),+ ]+ )+ @freezegun.freeze_time("2025-03-31")+ def test_limit_and_offset_page_hottest_first(+ self, _name: str, limit: int | None, offset: int | None, expected_counts: list[int], expected_has_more: bool+ ) -> None:+ self._create_three_distinct_points()++ params: dict[str, str | int | None] = {"date_from": "2023-03-08", "type": "click"}+ if limit is not None:+ params["limit"] = limit+ if offset is not None:+ params["offset"] = offset++ response = self._get_heatmap(params)+ assert [r["count"] for r in response.data["results"]] == expected_counts+ assert response.data["has_more"] is expected_has_more++ @freezegun.freeze_time("2025-03-31")+ def test_scrolldepth_ignores_limit_and_has_no_has_more(self) -> None:+ for i, y in enumerate([100, 200, 300, 400]):+ self._create_heatmap_event(f"session_{i}", "scrolldepth", "2023-03-08T08:00:00", y=y, viewport_height=1000)++ response = self._get_heatmap({"date_from": "2023-03-08", "type": "scrolldepth", "limit": 1})+ assert len(response.data["results"]) > 1+ assert "has_more" not in response.data+@freezegun.freeze_time("2025-03-31")@snapshot_clickhouse_queriesdef test_can_filter_by_exact_url(self) -> None:diff --git a/products/web_analytics/frontend/generated/api.schemas.ts b/products/web_analytics/frontend/generated/api.schemas.tsindex f0ea62f67020..be11f337d7f7 100644--- a/products/web_analytics/frontend/generated/api.schemas.ts+++ b/products/web_analytics/frontend/generated/api.schemas.ts@@ -172,6 +172,8 @@ export interface HeatmapsResponseApi {results: HeatmapResponseItemApi[]/** Above/below-the-fold summary for the returned interactions. Present for click/rageclick/mousemove; omitted for scrolldepth. */fold?: HeatmapFoldSummaryApi | null+ /** True when more coordinate points exist beyond the returned page. Raise 'limit' or page with 'offset' to fetch them. Always false for scrolldepth, which returns every bucket. */+ has_more?: boolean}export interface HeatmapEventItemApi {@@ -447,6 +449,18 @@ export type HeatmapsListParams = {* When true (default), drop interactions recorded at the (0, 0) origin, which are usually noise.*/hide_zero_coordinates?: boolean+ /**+ * Maximum number of coordinate points to return, ordered hottest-first by count. Defaults to 500. Pass 0 to fetch the full set (every coordinate) needed to render a complete heatmap overlay. Ignored for the 'scrolldepth' type, which always returns every bucket.+ * @minimum 0+ * @maximum 1000000+ */+ limit?: number+ /**+ * Number of hottest-first points to skip, for paging through cooler coordinates. Ignored for the 'scrolldepth' type.+ * @minimum 0+ * @maximum 1000000+ */+ offset?: number/*** The interaction type to return. One of: 'click' (default), 'rageclick', 'mousemove', or 'scrolldepth'. Scrolldepth returns scroll buckets instead of x/y coordinates.* @minLength 1diff --git a/products/web_analytics/mcp/tools.yaml b/products/web_analytics/mcp/tools.yamlindex 57417a153bd7..3c7fd8656829 100644--- a/products/web_analytics/mcp/tools.yaml+++ b/products/web_analytics/mcp/tools.yaml@@ -51,7 +51,11 @@ tools:line in CSS px) — so a high `pct_below_fold` flags engaged content sitting off the first screen. `rageclick`hotspots and shallow scroll depth are the strongest signals that something on the page is confusing orburied. Heatmaps only know coordinates, not what was clicked — cross-reference autocapture events on the- same URL to name the elements, and use `heatmaps-events` to jump to the sessions behind a hotspot.+ same URL to name the elements, and use `heatmaps-events` to jump to the sessions behind a hotspot. Click+ results are returned hottest-first and capped at `limit` (default 500); busy pages have thousands of+ distinct coordinates, so the default page plus the `fold` summary is usually enough for analysis — raise+ `limit` or page with `offset` only if you need more, and check `has_more` to know when the list is+ truncated.feature_flag: heatmaps-mcpheatmaps-saved-create:operation: saved_creatediff --git a/products/web_analytics/skills/assessing-heatmaps/SKILL.md b/products/web_analytics/skills/assessing-heatmaps/SKILL.mdindex c842e395766f..e59388d7f2f8 100644--- a/products/web_analytics/skills/assessing-heatmaps/SKILL.md+++ b/products/web_analytics/skills/assessing-heatmaps/SKILL.md@@ -45,6 +45,12 @@ querying-posthog-data skill, `models-heatmaps`):Use `aggregation: "unique_visitors"` when you care about how many people (not how many clicks); `total_count`exaggerates a few heavy clickers.+Click results come back **hottest-first** and are capped at `limit` (default 500). A busy page can have+thousands of distinct coordinates, so the default page plus the `fold` summary is almost always enough — the+hottest points are what analysis turns on. Don't ask for everything: raise `limit` or page with `offset` only+when you specifically need more, and check `has_more` to know the list was truncated. `scrolldepth` ignores+`limit` and always returns every bucket.+### Step 2b: Above the fold — read the `fold` summaryFor the click types, `heatmaps-list` returns a `fold` object alongside `results`:diff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.jsonindex 3bc3af044ee5..c142b75a3390 100644--- a/services/mcp/schema/generated-tool-definitions.json+++ b/services/mcp/schema/generated-tool-definitions.json@@ -3397,7 +3397,7 @@"feature_flag": "heatmaps-mcp"},"heatmaps-list": {- "description": "Aggregated heatmap interactions captured on a page. Filter by `url_exact` (one page) or `url_pattern` (regex across pages), a date window (`date_from`/`date_to`, data is retained 90 days), and optionally a viewport range (`viewport_width_min`/`viewport_width_max`, CSS px) to isolate a device class. Set `type` to 'click' (default), 'rageclick', 'mousemove', or 'scrolldepth'. For clicks each result is a point — `pointer_relative_x` (0..1 across the viewport), `pointer_y` (absolute pixels down the page), and a `count`; 'scrolldepth' returns reach buckets instead. For the click types the response also includes a `fold` summary — `pct_below_fold` (share of non-fixed interactions that landed below the user's initial viewport, i.e. required scrolling), `below_fold_count`, `total_count`, and the `median_viewport_height` (the typical fold line in CSS px) — so a high `pct_below_fold` flags engaged content sitting off the first screen. `rageclick` hotspots and shallow scroll depth are the strongest signals that something on the page is confusing or buried. Heatmaps only know coordinates, not what was clicked — cross-reference autocapture events on the same URL to name the elements, and use `heatmaps-events` to jump to the sessions behind a hotspot.",+ "description": "Aggregated heatmap interactions captured on a page. Filter by `url_exact` (one page) or `url_pattern` (regex across pages), a date window (`date_from`/`date_to`, data is retained 90 days), and optionally a viewport range (`viewport_width_min`/`viewport_width_max`, CSS px) to isolate a device class. Set `type` to 'click' (default), 'rageclick', 'mousemove', or 'scrolldepth'. For clicks each result is a point — `pointer_relative_x` (0..1 across the viewport), `pointer_y` (absolute pixels down the page), and a `count`; 'scrolldepth' returns reach buckets instead. For the click types the response also includes a `fold` summary — `pct_below_fold` (share of non-fixed interactions that landed below the user's initial viewport, i.e. required scrolling), `below_fold_count`, `total_count`, and the `median_viewport_height` (the typical fold line in CSS px) — so a high `pct_below_fold` flags engaged content sitting off the first screen. `rageclick` hotspots and shallow scroll depth are the strongest signals that something on the page is confusing or buried. Heatmaps only know coordinates, not what was clicked — cross-reference autocapture events on the same URL to name the elements, and use `heatmaps-events` to jump to the sessions behind a hotspot. Click results are returned hottest-first and capped at `limit` (default 500); busy pages have thousands of distinct coordinates, so the default page plus the `fold` summary is usually enough for analysis — raise `limit` or page with `offset` only if you need more, and check `has_more` to know when the list is truncated.","category": "Web analytics","feature": "web_analytics","summary": "List heatmap interactions for a page",diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.jsonindex 6422b05a9df9..25dca73e7e30 100644--- a/services/mcp/schema/tool-definitions-all.json+++ b/services/mcp/schema/tool-definitions-all.json@@ -3651,7 +3651,7 @@"feature_flag": "heatmaps-mcp"},"heatmaps-list": {- "description": "Aggregated heatmap interactions captured on a page. Filter by `url_exact` (one page) or `url_pattern` (regex across pages), a date window (`date_from`/`date_to`, data is retained 90 days), and optionally a viewport range (`viewport_width_min`/`viewport_width_max`, CSS px) to isolate a device class. Set `type` to 'click' (default), 'rageclick', 'mousemove', or 'scrolldepth'. For clicks each result is a point — `pointer_relative_x` (0..1 across the viewport), `pointer_y` (absolute pixels down the page), and a `count`; 'scrolldepth' returns reach buckets instead. For the click types the response also includes a `fold` summary — `pct_below_fold` (share of non-fixed interactions that landed below the user's initial viewport, i.e. required scrolling), `below_fold_count`, `total_count`, and the `median_viewport_height` (the typical fold line in CSS px) — so a high `pct_below_fold` flags engaged content sitting off the first screen. `rageclick` hotspots and shallow scroll depth are the strongest signals that something on the page is confusing or buried. Heatmaps only know coordinates, not what was clicked — cross-reference autocapture events on the same URL to name the elements, and use `heatmaps-events` to jump to the sessions behind a hotspot.",+ "description": "Aggregated heatmap interactions captured on a page. Filter by `url_exact` (one page) or `url_pattern` (regex across pages), a date window (`date_from`/`date_to`, data is retained 90 days), and optionally a viewport range (`viewport_width_min`/`viewport_width_max`, CSS px) to isolate a device class. Set `type` to 'click' (default), 'rageclick', 'mousemove', or 'scrolldepth'. For clicks each result is a point — `pointer_relative_x` (0..1 across the viewport), `pointer_y` (absolute pixels down the page), and a `count`; 'scrolldepth' returns reach buckets instead. For the click types the response also includes a `fold` summary — `pct_below_fold` (share of non-fixed interactions that landed below the user's initial viewport, i.e. required scrolling), `below_fold_count`, `total_count`, and the `median_viewport_height` (the typical fold line in CSS px) — so a high `pct_below_fold` flags engaged content sitting off the first screen. `rageclick` hotspots and shallow scroll depth are the strongest signals that something on the page is confusing or buried. Heatmaps only know coordinates, not what was clicked — cross-reference autocapture events on the same URL to name the elements, and use `heatmaps-events` to jump to the sessions behind a hotspot. Click results are returned hottest-first and capped at `limit` (default 500); busy pages have thousands of distinct coordinates, so the default page plus the `fold` summary is usually enough for analysis — raise `limit` or page with `offset` only if you need more, and check `has_more` to know when the list is truncated.","category": "Web analytics","feature": "web_analytics","summary": "List heatmap interactions for a page",diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex fb9523b81144..059cfb674199 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -21132,6 +21132,8 @@ export namespace Schemas {results: HeatmapResponseItem[];/** Above/below-the-fold summary for the returned interactions. Present for click/rageclick/mousemove; omitted for scrolldepth. */fold?: HeatmapFoldSummary | null;+ /** True when more coordinate points exist beyond the returned page. Raise 'limit' or page with 'offset' to fetch them. Always false for scrolldepth, which returns every bucket. */+ has_more?: boolean;}export type HideViewedRecordings = typeof HideViewedRecordings[keyof typeof HideViewedRecordings];@@ -47473,6 +47475,18 @@ export namespace Schemas {* When true (default), drop interactions recorded at the (0, 0) origin, which are usually noise.*/hide_zero_coordinates?: boolean;+ /**+ * Maximum number of coordinate points to return, ordered hottest-first by count. Defaults to 500. Pass 0 to fetch the full set (every coordinate) needed to render a complete heatmap overlay. Ignored for the 'scrolldepth' type, which always returns every bucket.+ * @minimum 0+ * @maximum 1000000+ */+ limit?: number;+ /**+ * Number of hottest-first points to skip, for paging through cooler coordinates. Ignored for the 'scrolldepth' type.+ * @minimum 0+ * @maximum 1000000+ */+ offset?: number;/*** The interaction type to return. One of: 'click' (default), 'rageclick', 'mousemove', or 'scrolldepth'. Scrolldepth returns scroll buckets instead of x/y coordinates.* @minLength 1@@ -53564,6 +53578,18 @@ export namespace Schemas {* When true (default), drop interactions recorded at the (0, 0) origin, which are usually noise.*/hide_zero_coordinates?: boolean;+ /**+ * Maximum number of coordinate points to return, ordered hottest-first by count. Defaults to 500. Pass 0 to fetch the full set (every coordinate) needed to render a complete heatmap overlay. Ignored for the 'scrolldepth' type, which always returns every bucket.+ * @minimum 0+ * @maximum 1000000+ */+ limit?: number;+ /**+ * Number of hottest-first points to skip, for paging through cooler coordinates. Ignored for the 'scrolldepth' type.+ * @minimum 0+ * @maximum 1000000+ */+ offset?: number;/*** The interaction type to return. One of: 'click' (default), 'rageclick', 'mousemove', or 'scrolldepth'. Scrolldepth returns scroll buckets instead of x/y coordinates.* @minLength 1diff --git a/services/mcp/src/generated/web_analytics/api.ts b/services/mcp/src/generated/web_analytics/api.tsindex 85761b0c8331..5961e7c43086 100644--- a/services/mcp/src/generated/web_analytics/api.ts+++ b/services/mcp/src/generated/web_analytics/api.ts@@ -23,6 +23,14 @@ export const heatmapsListQueryAggregationDefault = `total_count`export const heatmapsListQueryDateFromDefault = `-7d`export const heatmapsListQueryHideZeroCoordinatesDefault = true+export const heatmapsListQueryLimitDefault = 500+export const heatmapsListQueryLimitMin = 0+export const heatmapsListQueryLimitMax = 1000000++export const heatmapsListQueryOffsetDefault = 0+export const heatmapsListQueryOffsetMin = 0+export const heatmapsListQueryOffsetMax = 1000000+export const heatmapsListQueryTypeDefault = `click`export const HeatmapsListQueryParams = /* @__PURE__ */ zod.object({@@ -58,6 +66,22 @@ export const HeatmapsListQueryParams = /* @__PURE__ */ zod.object({.boolean().default(heatmapsListQueryHideZeroCoordinatesDefault).describe('When true (default), drop interactions recorded at the (0, 0) origin, which are usually noise.'),+ limit: zod+ .number()+ .min(heatmapsListQueryLimitMin)+ .max(heatmapsListQueryLimitMax)+ .default(heatmapsListQueryLimitDefault)+ .describe(+ "Maximum number of coordinate points to return, ordered hottest-first by count. Defaults to 500. Pass 0 to fetch the full set (every coordinate) needed to render a complete heatmap overlay. Ignored for the 'scrolldepth' type, which always returns every bucket."+ ),+ offset: zod+ .number()+ .min(heatmapsListQueryOffsetMin)+ .max(heatmapsListQueryOffsetMax)+ .default(heatmapsListQueryOffsetDefault)+ .describe(+ "Number of hottest-first points to skip, for paging through cooler coordinates. Ignored for the 'scrolldepth' type."+ ),type: zod.string().min(1)diff --git a/services/mcp/src/tools/generated/web_analytics.ts b/services/mcp/src/tools/generated/web_analytics.tsindex 62716ecefa6c..7f35c21b6934 100644--- a/services/mcp/src/tools/generated/web_analytics.ts+++ b/services/mcp/src/tools/generated/web_analytics.ts@@ -64,6 +64,8 @@ const heatmapsList = (): ToolBase<typeof HeatmapsListSchema, WithPostHogUrl<Schedate_to: params.date_to,filter_test_accounts: params.filter_test_accounts,hide_zero_coordinates: params.hide_zero_coordinates,+ limit: params.limit,+ offset: params.offset,type: params.type,url_exact: params.url_exact,url_pattern: params.url_pattern,