From 3d2c18fb5d63ca738cb6cc668f4c286c8f288d5e Mon Sep 17 00:00:00 2001 From: Nick the Sick Date: Mon, 22 Sep 2025 11:03:39 +0200 Subject: [PATCH 1/9] docs: update analytics event tracking --- docs/app/pricing/tiers.tsx | 34 ++++++++++++++++++++++++-- docs/components/AuthenticationPage.tsx | 26 ++++++++++++-------- 2 files changed, 48 insertions(+), 12 deletions(-) diff --git a/docs/app/pricing/tiers.tsx b/docs/app/pricing/tiers.tsx index 8b24b7107d..74e7f6154c 100644 --- a/docs/app/pricing/tiers.tsx +++ b/docs/app/pricing/tiers.tsx @@ -72,25 +72,55 @@ function TierCTAButton({ tier }: { tier: Tier }) { return ( { + // This event is deprecated, but we keep it to use as a baseline for analytics + track("Signup", { tier: tier.id }); + if (!session) { + Sentry.captureEvent({ + message: "click-pricing-signup", + level: "info", + extra: { + tier: tier.id, + }, + }); + track("click-pricing-signup", { tier: tier.id }); return; } if (session.planType === "free") { Sentry.captureEvent({ - message: "Checkout", + message: "click-pricing-buy-now", level: "info", extra: { tier: tier.id, }, }); - track("Checkout", { tier: tier.id }); + track("click-pricing-buy-now", { tier: tier.id }); e.preventDefault(); e.stopPropagation(); await authClient.checkout({ slug: tier.id, }); } else { + if (session.planType === tier.id) { + Sentry.captureEvent({ + message: "click-pricing-manage-subscription", + level: "info", + extra: { + tier: tier.id, + }, + }); + track("click-pricing-manage-subscription", { tier: tier.id }); + } else { + Sentry.captureEvent({ + message: "click-pricing-update-subscription", + level: "info", + extra: { + tier: tier.id, + }, + }); + track("click-pricing-update-subscription", { tier: tier.id }); + } e.preventDefault(); e.stopPropagation(); await authClient.customer.portal(); diff --git a/docs/components/AuthenticationPage.tsx b/docs/components/AuthenticationPage.tsx index e9518cd0aa..c2bfad8252 100644 --- a/docs/components/AuthenticationPage.tsx +++ b/docs/components/AuthenticationPage.tsx @@ -71,9 +71,9 @@ function AuthenticationBox(props: { setSigningInState({ state: "loading" }); if (props.variant === "password") { - track("Sign In", { type: "password" }); + track("click-sign-in", { type: "password" }); Sentry.captureEvent({ - message: "Sign In", + message: "click-sign-in", level: "info", extra: { type: "password", @@ -98,9 +98,9 @@ function AuthenticationBox(props: { }, ); } else if (props.variant === "email") { - track("Sign In", { type: "magic-link" }); + track("click-sign-in", { type: "magic-link" }); Sentry.captureEvent({ - message: "Sign In", + message: "click-sign-in", level: "info", extra: { type: "magic-link", @@ -135,9 +135,9 @@ function AuthenticationBox(props: { }, ); } else { - track("Create Account"); + track("click-sign-up", { type: "email" }); Sentry.captureEvent({ - message: "Sign Up", + message: "click-sign-up", level: "info", extra: { type: "email", @@ -323,7 +323,9 @@ function PasswordSignInButton() { ); } -function GitHubSignInButton() { +function GitHubSignInButton(props: { + variant: "password" | "register" | "email"; +}) { const searchParams = useSearchParams(); const callbackURL = searchParams?.get("redirect") || "/"; @@ -345,9 +347,13 @@ function GitHubSignInButton() { } onClick={async () => { - track("Sign In", { type: "github" }); + track( + props.variant === "register" ? "click-sign-up" : "click-sign-in", + { type: "github" }, + ); Sentry.captureEvent({ - message: "Sign In", + message: + props.variant === "register" ? "click-sign-up" : "click-sign-in", level: "info", extra: { type: "github", @@ -380,7 +386,7 @@ function AlternativeSignInBox(props: {
{props.variant === "email" && } {props.variant === "password" && } - +
); From 2b25ca50ed54984864f0b679a3ea4f3d87d5a4c8 Mon Sep 17 00:00:00 2001 From: Nick the Sick Date: Mon, 22 Sep 2025 15:27:51 +0200 Subject: [PATCH 2/9] fix(docs): add error boundaries for better UX --- docs/app/(home)/layout.tsx | 21 +++++++++++++- docs/app/about/layout.tsx | 21 +++++++++++++- docs/app/docs/layout.tsx | 19 +++++++++++- docs/app/examples/layout.tsx | 19 +++++++++++- docs/app/global-error.tsx | 10 +++++-- docs/app/layout.tsx | 18 +++++++++++- .../layout.tsx | 21 +++++++++++++- docs/app/legal/privacy-policy/layout.tsx | 21 +++++++++++++- .../legal/service-level-agreement/layout.tsx | 21 +++++++++++++- .../app/legal/terms-and-conditions/layout.tsx | 21 +++++++++++++- docs/app/pricing/layout.tsx | 21 +++++++++++++- docs/app/signin/layout.tsx | 23 ++++++++++++++- docs/app/signup/layout.tsx | 23 ++++++++++++++- docs/app/thanks/layout.tsx | 21 +++++++++++++- docs/components/Example.tsx | 29 ++++++++++++++----- 15 files changed, 285 insertions(+), 24 deletions(-) diff --git a/docs/app/(home)/layout.tsx b/docs/app/(home)/layout.tsx index 235258e8c5..1cdb476017 100644 --- a/docs/app/(home)/layout.tsx +++ b/docs/app/(home)/layout.tsx @@ -2,11 +2,30 @@ import type { ReactNode } from "react"; import { HomeLayout } from "fumadocs-ui/layouts/home"; import { baseOptions } from "@/app/layout.config"; import { Footer } from "@/components/Footer"; +import * as Sentry from "@sentry/nextjs"; export default function Layout({ children }: { children: ReactNode }) { return ( <> - {children} + + + We encountered an error trying to show this page. Please report + this to us on GitHub at{" "} +
+ https://github.com/TypeCellOS/BlockNote/issues + + + } + beforeCapture={(scope) => { + scope.setTag("type", "react-render"); + scope.setTag("page", "home"); + }} + > + {children} + +