Skip to main content

Get Most Visited Products (v1)

Method & Path

GET /api/v1/workspace/:workspaceId/analytics/storefront/most-visited

Description

Get the most visited product pages for a workspace storefront, sorted by visit count.

Authentication

Required: Workspace authentication. User must be authenticated as Workspace Owner or Staff with workspace.read permission.

Headers

Authorization: Bearer <workspace_token>
Content-Type: application/json

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace identifier

Response 200 OK

{
"products": [
{
"productId": "507f1f77bcf86cd799439011",
"productName": "Product A",
"visitCount": 250
},
{
"productId": "507f1f77bcf86cd799439012",
"productName": "Product B",
"visitCount": 180
}
]
}

Response Fields

products

Array of product objects (top 10), sorted by visitCount:

  • productId (string): Product identifier
  • productName (string): Product name
  • visitCount (number): Number of page views for this product

Common Errors

401 Unauthorized: Missing or invalid authentication token

403 Forbidden: User does not have workspace.read permission

404 Not Found: Workspace or storefront not found

500 Internal Server Error: Server error occurred while processing the request

Notes

  • Returns top 10 most visited products
  • Products are sorted by visit count (descending)
  • Only includes products that have been visited at least once
  • Visit count is based on page views, not unique visitors