Add website view analytics for dashboard traffic charts.
Track storefront views via POST /tenants/{domain}/analytics/views, expose business activity API, and add product/website/portfolio/blog 30-day chart types for super-admin selection.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
b8f60c5141
commit
3f266a2dcb
@@ -430,6 +430,61 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/tenants/{domain}/analytics/views": {
|
||||
"post": {
|
||||
"tags": ["Analytics"],
|
||||
"summary": "Record a storefront page view",
|
||||
"description": "Fire-and-forget view counter for business dashboard charts. Call once per page impression from the website (product detail, portfolio, blog post, or general site page). No auth required.",
|
||||
"parameters": [
|
||||
{
|
||||
"$ref": "#/components/parameters/domain"
|
||||
}
|
||||
],
|
||||
"requestBody": {
|
||||
"required": true,
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"required": ["kind"],
|
||||
"properties": {
|
||||
"kind": {
|
||||
"type": "string",
|
||||
"enum": ["website", "product", "portfolio", "blog"]
|
||||
},
|
||||
"entityId": {
|
||||
"type": "string",
|
||||
"description": "Required when kind is product, portfolio, or blog."
|
||||
},
|
||||
"path": {
|
||||
"type": "string",
|
||||
"description": "Optional page path for website visits (e.g. `/`, `/about`)."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "View recorded",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"ok": { "type": "boolean", "enum": [true] }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"404": {
|
||||
"description": "Unknown domain or entity"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/tenants/{domain}/website/sliders": {
|
||||
"get": {
|
||||
"tags": [
|
||||
|
||||
Reference in New Issue
Block a user