diff --git a/backend/app/services/analytics.py b/backend/app/services/analytics.py index 3d34804..deb5268 100644 --- a/backend/app/services/analytics.py +++ b/backend/app/services/analytics.py @@ -39,7 +39,9 @@ async def track(event: str, properties: dict[str, Any] | None = None, profile_id return # OpenPanel's Track API takes {type, payload:{…}} (same envelope the browser SDK # sends) — a flat body is rejected with 400, which this module swallows by design. - inner: dict[str, Any] = {"event": event, "properties": properties or {}} + # The payload field is "name" (ITrackPayload in packages/validation) — "event" is + # rejected with a 400 that this module swallows. + inner: dict[str, Any] = {"name": event, "properties": properties or {}} if profile_id: inner["profileId"] = profile_id body = {"type": "track", "payload": inner}