fix: only send content_fetch_failure event to analytics

This commit is contained in:
Hongbo Wu 2024-05-31 12:44:01 +08:00
parent a802bab1c3
commit f2ff4b7b0a

View file

@ -17,7 +17,7 @@ class PostHogClient implements AnalyticClient {
}
capture(userIds: string[], { properties, result }: AnalyticEvent) {
if (process.env.SEND_ANALYTICS) {
if (process.env.SEND_ANALYTICS && result === 'failure') {
userIds.forEach((userId) => {
this.client.capture({
distinctId: userId,