Skip to content

Commit 61f4dae

Browse files
committed
docs: better event tracking
1 parent ac322a1 commit 61f4dae

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

docs/app/pricing/tiers.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function TierCTAButton({ tier }: { tier: Tier }) {
7676
}
7777

7878
if (session.planType === "free") {
79-
track("Signup", { tier: tier.id });
79+
track("Checkout", { tier: tier.id });
8080
e.preventDefault();
8181
e.stopPropagation();
8282
await authClient.checkout({

docs/components/AuthenticationPage.tsx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
useEffect,
1010
useState,
1111
} from "react";
12+
import { track } from "@vercel/analytics";
1213

1314
import ThemedImage from "@/components/ThemedImage";
1415
import blockNoteLogo from "@/public/img/logos/banner.svg";
@@ -69,6 +70,7 @@ function AuthenticationBox(props: {
6970
setSigningInState({ state: "loading" });
7071

7172
if (props.variant === "password") {
73+
track("Sign In", { type: "password" });
7274
await signIn.email(
7375
{
7476
email,
@@ -88,6 +90,7 @@ function AuthenticationBox(props: {
8890
},
8991
);
9092
} else if (props.variant === "email") {
93+
track("Sign In", { type: "magic-link" });
9194
await signIn.magicLink(
9295
{
9396
email,
@@ -117,6 +120,7 @@ function AuthenticationBox(props: {
117120
},
118121
);
119122
} else {
123+
track("Create Account");
120124
await signUp.email(
121125
{
122126
email,
@@ -318,12 +322,13 @@ function GitHubSignInButton() {
318322
/>
319323
</svg>
320324
}
321-
onClick={async () =>
325+
onClick={async () => {
326+
track("Sign In", { type: "github" });
322327
await signIn.social({
323328
provider: "github",
324329
callbackURL,
325-
})
326-
}
330+
});
331+
}}
327332
/>
328333
);
329334
}

0 commit comments

Comments
 (0)