---
title: "Track a frontend-only analytics event (profile view, search). Frontend API key + logged-in users only."
method: POST
path: "/v1/analytics.trackEvent"
tags: ["analytics"]
---

# Track a frontend-only analytics event (profile view, search). Frontend API key + logged-in users only.

`POST /v1/analytics.trackEvent`

## Headers

- `X-Forwarded-For` string
- `User-Agent` string
- `X-Visitor-Id` string

## Request body

- AnalyticsTrackEventRequestBody
  - `$schema` string, uri — A URL to the JSON Schema for this object.
  - `payload` object, required — Per-type fields. profile_view: {accountId}. search: {source, query, resultCount}.
  - `type` 'profile_view' | 'search', required — Event class. profile_view is normally emitted server-side; this lets the frontend top it up for client-only flows. search captures account/app searches that bypass the backend.

## Response `200`

OK

- AnalyticsTrackEventResponseBody
  - `$schema` string, uri — A URL to the JSON Schema for this object.
  - `ok` boolean, required

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `422` — Unprocessable Entity
- `500` — Internal Server Error

---

[API](https://skmtc.net/steamsets/apis/steamsets-api.md) · [All operations](https://skmtc.net/steamsets/apis/steamsets-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/steamsets/steamsets-api/revisions/84c030d12df1/schema)
