Skip to content

Commit 097bcac

Browse files
committed
analytics event
1 parent c8308d2 commit 097bcac

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

common/src/constants/analytics-events.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ export enum AnalyticsEvent {
119119
DOCS_SEARCH_INSUFFICIENT_CREDITS = 'api.docs_search_insufficient_credits',
120120
DOCS_SEARCH_ERROR = 'api.docs_search_error',
121121

122+
// Web - Ads API
123+
ADS_API_AUTH_ERROR = 'api.ads_auth_error',
124+
122125
// Common
123126
FLUSH_FAILED = 'common.flush_failed',
124127
}

web/src/app/api/v1/ads/_post.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Note: Using existing analytics events as placeholders since ads-specific events don't exist yet
1+
import { AnalyticsEvent } from '@codebuff/common/constants/analytics-events'
22
import db from '@codebuff/internal/db'
33
import * as schema from '@codebuff/internal/db/schema'
44
import { NextResponse } from 'next/server'
@@ -78,7 +78,7 @@ export async function postAds(params: {
7878
logger: baseLogger,
7979
loggerWithContext,
8080
trackEvent,
81-
authErrorEvent: 'api.ads_auth_error' as any, // TODO: Add proper analytics event
81+
authErrorEvent: AnalyticsEvent.ADS_API_AUTH_ERROR,
8282
})
8383
if (!authed.ok) return authed.response
8484

0 commit comments

Comments
 (0)