Skip to main content

Track Clicks

The track endpoint allows you to record click events from your portfolio website.

Endpoint​

POST /api/track

Request Body​

ParameterTypeDescription
userIdstringUnique identifier for the user
itemIdstringIdentifier for the clicked item
itemTypestringType of item (e.g., menu, button, link)
timestampnumberUnix timestamp when the click occurred
metadataobjectOptional 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"
}