Count page views once per load and skip known bots.
Stop auto-counting list APIs and homepage sliders, track static pages via pageKey, and add store-specials AI list matching. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
6517877bed
commit
b7ca306097
@@ -3,6 +3,7 @@ import {
|
||||
Controller,
|
||||
Delete,
|
||||
Get,
|
||||
Headers,
|
||||
Param,
|
||||
Patch,
|
||||
Post,
|
||||
@@ -34,11 +35,23 @@ export class PublicWebsiteStaticImagesController {
|
||||
async list(
|
||||
@Param('host') host: string,
|
||||
@Query() query: PublicWebsiteStaticImagesQueryDto,
|
||||
@Headers('user-agent') userAgent?: string,
|
||||
) {
|
||||
const result = await this.service.listPublic(host, query.pageKey);
|
||||
const pageKey = query.pageKey?.trim() || 'home';
|
||||
if (pageKey === 'home') {
|
||||
this.analytics.trackPublicPage(host, 'home');
|
||||
const pageKey = query.pageKey?.trim();
|
||||
// Only count when the storefront loads a specific page's slots (home / about / contact / …).
|
||||
if (pageKey) {
|
||||
if (pageKey === 'home') {
|
||||
this.analytics.trackPublicPage(host, 'home', null, undefined, userAgent);
|
||||
} else {
|
||||
this.analytics.trackPublicPage(
|
||||
host,
|
||||
'static_page',
|
||||
null,
|
||||
`/${pageKey}`,
|
||||
userAgent,
|
||||
);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user