관리자 통계 제외와 콘텐츠 링크 정리
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user