관리자 통계 제외와 콘텐츠 링크 정리

This commit is contained in:
2026-06-30 12:32:18 +09:00
parent 901463e5f3
commit 4e2ec3d7a2
23 changed files with 209 additions and 64 deletions

View File

@@ -5,6 +5,7 @@ import {
recordAnalyticsPageview
} from '../repositories/analytics-repository'
import { getPageBySlug } from '../repositories/content-repository'
import { shouldExcludeAdminAnalytics } from '../utils/analytics-admin-exclusion'
/**
* 공개 페이지가 HTML 문서 모드일 때 Nuxt 렌더링 대신 원문 HTML을 응답한다.
@@ -32,7 +33,11 @@ export default defineEventHandler(async (event) => {
return
}
if (method === 'GET' && !isBotUserAgent(String(getRequestHeader(event, 'user-agent') || ''))) {
if (
method === 'GET'
&& !isBotUserAgent(String(getRequestHeader(event, 'user-agent') || ''))
&& !shouldExcludeAdminAnalytics(event)
) {
await recordAnalyticsPageview({
visitorHash: createVisitorHashFromEvent(event),
pageId: page.id,