Skip to main content

Record Page View (v1)

Method + Path

POST /v1/public/tracking/page-view

Actual backend path: /v1/public/tracking/page-view

Description

Record a page view within a visit session. This endpoint tracks user navigation within a vCard or storefront.

Authentication

Not required - This is a public endpoint

Headers

HeaderTypeRequiredDescription
Content-TypestringYesapplication/json

Request Body

{
"visitSessionId": "session-123",
"pagePath": "/products",
"pageTitle": "Products",
"referer": "https://example.com/home",
"timeOnPage": 45
}

Body Parameters

ParameterTypeRequiredDescription
visitSessionIdstringYesVisit session identifier
pagePathstringYesPage path (1-500 characters)
pageTitlestringNoPage title (max 200 characters)
refererstringNoReferrer URL (max 1000 characters)
timeOnPagenumberNoTime spent on page in seconds (minimum 0)

Response (200)

{
"pageView": {
"id": "507f1f77bcf86cd799439011",
"visitSessionId": "session-123",
"pagePath": "/products",
"pageTitle": "Products",
"createdAt": "2024-01-15T10:00:00Z"
}
}

Common Errors

  • 400 Bad Request: Invalid request body
  • 404 Not Found: Visit session not found
  • 422 Unprocessable Entity: Validation errors
  • 500 Internal Server Error: Server error