← Documentation home
POST/hyax-api/v1/track/event

Track page / session event

CORS-enabled. Use `Authorization: Bearer hx_…` or pass `teamId` in the JSON body (for embedded scripts). When using an API key, `teamId` is derived automatically and domain validation is skipped. Without an API key, Origin/Referer host must be in the team's `allowedTrackingDomains`. Returns 200 with `{ success: false }` on validation errors instead of 4xx.

Base URL: https://platform.hyax.com · Replace YOUR_API_KEY with your team API key.

Request body

FieldRequiredDescription
teamIdNoNot required when using Bearer API key auth
visitorIdYesClient / cookie ID
pathNoPage path (max 500 chars)
referrerNoMax 1000 chars
utm_sourceNoMax 200 chars
utm_mediumNoMax 200 chars
utm_campaignNoMax 200 chars
utm_contentNoMax 200 chars
utm_termNoMax 200 chars
emailNoLinks visitor to person if found

Request examples

Same request in cURL, Node.js (fetch), and PHP (ext-curl).

curl -X POST 'https://platform.hyax.com/hyax-api/v1/track/event' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "visitorId": "visitor_cookie_id",
    "path": "/pricing",
    "referrer": "https://google.com",
    "utm_source": "google",
    "utm_medium": "cpc",
    "utm_campaign": "spring-sale",
    "utm_content": "hero-banner",
    "utm_term": "saas tools",
    "email": "[email protected]"
  }'

Example response

Shape varies by data; values are illustrative.

{
  "success": true
}