Skip to content

Add /analytics/events/track endpoint  #537

Description

@phertyameen

Description

Add a controller route POST /analytics/events/track exposing a generic client-side event ingestion endpoint (e.g. frontend UI interactions). Validate query params with a DTO (class-validator), guard the route with AnalyticsAdminGuard where the data is sensitive, and delegate the computation to track-event.provider.ts.

Why this matters

This is the API surface the analytics dashboard (frontend) and any external reporting tools will consume for 'a generic client-side event ingestion endpoint (e.g. frontend UI interactions)'.

Files to touch

  • backend/src/analytics/analytics.controller.ts
  • backend/src/analytics/providers/track-event.provider.ts
  • backend/src/analytics/dtos/analytics-query.dto.ts

Acceptance Criteria

  • POST /analytics/events/track returns a 200 with the documented response shape
  • Invalid query params return a 400 with a clear validation message
  • Route is covered by an e2e test in backend/test/analytics.e2e-spec.ts

Notes

This issue is part of the new analytics module effort (tracking, aggregation,
and reporting on player/game activity). Please keep new code inside
backend/src/analytics/ following the same module/controller/service/provider
layout used by existing modules (e.g. progress, streak, quests).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions