Track Clicks
The track endpoint allows you to record click events from your portfolio website.
Endpoint
POST /api/track
Request Body
| Parameter | Type | Description |
|---|---|---|
| userId | string | Unique identifier for the user |
| itemId | string | Identifier for the clicked item |
| itemType | string | Type of item (e.g., menu, button, link) |
| timestamp | number | Unix timestamp when the click occurred |
| metadata | object | Optional additional data about the click |
Example Request
{
"userId": "user123",
"itemId": "portfolio-link",
"itemType": "menu",
"timestamp": 1650123456789,
"metadata": {
"page": "home",
"section": "header"
}
}
Response
Success Response
{
"success": true,
"trackingId": "tr_123456789"
}
Error Response
{
"success": false,
"error": "Missing required field: userId"
}