diff --git a/apps/website/src/lib/tracking.ts b/apps/website/src/lib/tracking.ts index 08e2b4c..3d06cd7 100644 --- a/apps/website/src/lib/tracking.ts +++ b/apps/website/src/lib/tracking.ts @@ -25,5 +25,13 @@ export const track = ( : [event: TEventKey, data: TrackingEvents[TEventKey]] ) => { const [event, data] = args; - splitbee.track(event, data); + if (process.env.NEXT_PUBLIC_VERCEL_ENV === "production") { + splitbee.track(event, data); + } + if (process.env.NODE_ENV === "development") { + console.info("Tracking event:", { + event, + data, + }); + } }; diff --git a/turbo.json b/turbo.json index 6b8c7fe..88b47e7 100644 --- a/turbo.json +++ b/turbo.json @@ -4,7 +4,13 @@ "build": { "dependsOn": ["^build"], "outputs": ["dist/**", ".next/**"], - "env": ["SANITY_PROJECT_ID", "SANITY_AUTH_TOKEN", "DRAFT_MODE_SECRET"] + "env": [ + "SANITY_PROJECT_ID", + "SANITY_AUTH_TOKEN", + "DRAFT_MODE_SECRET", + "NEXT_PUBLIC_VERCEL_ENV", + "NODE_ENV" + ] }, "lint": { "outputs": []