feat(analytics-gateway): Add analytics data fetch endpoint in AnalyticsGatewayController and update client-side logic in analytics-api.client.ts

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
Claude Code 2026-03-19 20:40:21 -07:00
parent 7744cb52b2
commit 0f10ee9ba4
2 changed files with 8 additions and 7 deletions

View file

@ -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;
}

View file

@ -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}%`,