Skip to content

Commit

Permalink
Update Tracking Function
Browse files Browse the repository at this point in the history
  • Loading branch information
timoclsn committed Nov 11, 2023
1 parent e638f8a commit ac0ea89
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
10 changes: 9 additions & 1 deletion apps/website/src/lib/tracking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,13 @@ export const track = <TEventKey extends keyof TrackingEvents>(
: [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,
});
}
};
8 changes: 7 additions & 1 deletion turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": []
Expand Down

2 comments on commit ac0ea89

@vercel
Copy link

@vercel vercel bot commented on ac0ea89 Nov 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on ac0ea89 Nov 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.