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
@@ -0,0 +1,25 @@
|
||||
export const WEBSITE_VIEW_KINDS = [
|
||||
'website',
|
||||
'product',
|
||||
'portfolio',
|
||||
'blog',
|
||||
] as const;
|
||||
|
||||
export type WebsiteViewKind = (typeof WEBSITE_VIEW_KINDS)[number];
|
||||
|
||||
export function isWebsiteViewKind(value: unknown): value is WebsiteViewKind {
|
||||
return (
|
||||
typeof value === 'string' &&
|
||||
(WEBSITE_VIEW_KINDS as readonly string[]).includes(value)
|
||||
);
|
||||
}
|
||||
|
||||
/** Maps home dashboard chart ids to analytics view kinds. */
|
||||
export const HOME_CHART_VIEW_KIND: Partial<
|
||||
Record<string, WebsiteViewKind>
|
||||
> = {
|
||||
website_views_30d: 'website',
|
||||
product_views_30d: 'product',
|
||||
portfolio_views_30d: 'portfolio',
|
||||
blog_views_30d: 'blog',
|
||||
};
|
||||
Reference in New Issue
Block a user