From 0f10ee9ba448df0e38f2935c2b648d8c764d17ee Mon Sep 17 00:00:00 2001 From: Claude Code Date: Thu, 19 Mar 2026 20:40:21 -0700 Subject: [PATCH] =?UTF-8?q?feat(analytics-gateway):=20=E2=9C=A8=20Add=20an?= =?UTF-8?q?alytics=20data=20fetch=20endpoint=20in=20AnalyticsGatewayContro?= =?UTF-8?q?ller=20and=20update=20client-side=20logic=20in=20analytics-api.?= =?UTF-8?q?client.ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- .../src/modules/analytics-gateway/analytics-api.client.ts | 7 ++++--- .../analytics-gateway/analytics-gateway.controller.ts | 8 ++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/features/platform-analytics/backend-api/src/modules/analytics-gateway/analytics-api.client.ts b/features/platform-analytics/backend-api/src/modules/analytics-gateway/analytics-api.client.ts index 3060115a1..719eda42a 100644 --- a/features/platform-analytics/backend-api/src/modules/analytics-gateway/analytics-api.client.ts +++ b/features/platform-analytics/backend-api/src/modules/analytics-gateway/analytics-api.client.ts @@ -73,10 +73,11 @@ export interface PageMetrics { * Event metrics */ export interface EventMetrics { - eventName: string; + eventType: string; category: string; - totalEvents: number; - uniqueEvents: number; + count: number; + uniqueUsers: number; + avgValue: number; eventsPerSession: number; } diff --git a/features/platform-analytics/backend-api/src/modules/analytics-gateway/analytics-gateway.controller.ts b/features/platform-analytics/backend-api/src/modules/analytics-gateway/analytics-gateway.controller.ts index 7fe5fe5eb..f1c3c4f39 100644 --- a/features/platform-analytics/backend-api/src/modules/analytics-gateway/analytics-gateway.controller.ts +++ b/features/platform-analytics/backend-api/src/modules/analytics-gateway/analytics-gateway.controller.ts @@ -262,10 +262,10 @@ export class AnalyticsGatewayController { }, trend: [], topEvents: events.slice(0, 10).map((e) => ({ - action: e.eventName, - count: e.totalEvents, - uniqueUsers: e.uniqueEvents, - avgValue: 0, + action: e.eventType, + count: e.count, + uniqueUsers: e.uniqueUsers, + avgValue: e.avgValue, })), scrollDepth: scrollDepth.map((s) => ({ depth: `${s.depth}%`,