API Reference
Track Events
Low-level HTTP API for tracking events from any environment.
POST
https://phi.llc/api/phi/trackRequest Body
| Field | Type | Description |
|---|---|---|
| website_id | string | Your unique project identifier. * Required |
| event_name | string | Defaults to pageview. |
| session_id | string | Used to track unique visitors during a session. |
| metadata | object | Custom 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