API Reference

Track Events

Low-level HTTP API for tracking events from any environment.

POSThttps://phi.llc/api/phi/track

Request Body

FieldTypeDescription
website_idstringYour unique project identifier. * Required
event_namestringDefaults to pageview.
session_idstringUsed to track unique visitors during a session.
metadataobjectCustom JSON properties for the event.

Example

cURL
curl -X POST https://phi.llc/api/phi/track \
  -H "Content-Type: application/json" \
  -d '{
    "website_id": "your-id",
    "event_name": "ButtonClicked",
    "metadata": { "btn_id": "hero_cta" }
  }'

Auto-Extracted Data

The following fields are automatically populated server-side:

LocationCountry & City via IP-API
DeviceType, OS, and Browser
ReferrerSource parsing (Google, etc)
TimeISO 8601 Timestamp