Skip to content

Commit fabaedc

Browse files
committed
docs(cta): align analytics event with website naming scheme
Renames the docs CTA tracking event from `cta_clicked` to `try_for_free_clicked` to match the per-event custom event names used on the marketing website, and uses a single `location` string property in place of the previous `surface` / `variant` / `target` / `page_path` shape. Surface identifiers are normalized to underscored snake_case to match the location values already used on the website. Same change applies to the docs navbar handler that fires when a visitor clicks the Free Developer Access link.
1 parent e03302d commit fabaedc

33 files changed

Lines changed: 37 additions & 55 deletions

File tree

docs/components/layout/navbar.tsx

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import DiscordIcon from "@/components/ui/icons/discord";
1919
import ExternalLinkIcon from "@/components/ui/icons/external-link";
2020
import BurgerMenuIcon from "@/components/ui/icons/burger-menu";
2121
import { BookOpenIcon, ScrollTextIcon } from "lucide-react";
22-
import posthog from "posthog-js";
2322

2423
export interface NavbarLink {
2524
href: string;
@@ -130,17 +129,8 @@ const Navbar = ({ pageTree }: NavbarProps) => {
130129
};
131130
}, [isMobileSidebarOpen]);
132131

133-
const handleIntelligenceCtaClick = (surface: string) => {
134-
try {
135-
posthog.capture("cta_clicked", {
136-
surface,
137-
variant: "navbar",
138-
target: "intelligence",
139-
page_path: pathname,
140-
});
141-
} catch {
142-
// PostHog may be blocked — never let analytics block navigation.
143-
}
132+
const handleTryForFreeClick = (location: string) => {
133+
posthog?.capture("try_for_free_clicked", { location });
144134
};
145135

146136
const handleToggleTheme = () => {
@@ -191,7 +181,7 @@ const Navbar = ({ pageTree }: NavbarProps) => {
191181
onClick={
192182
link.label === "Free Developer Access"
193183
? () =>
194-
handleIntelligenceCtaClick("docs:navbar:left")
184+
handleTryForFreeClick("docs_navbar_left")
195185
: undefined
196186
}
197187
className={`h-full ${
@@ -286,7 +276,7 @@ const Navbar = ({ pageTree }: NavbarProps) => {
286276
target={link.target}
287277
onClick={
288278
link.label === "Free Developer Access"
289-
? () => handleIntelligenceCtaClick("docs:navbar:right")
279+
? () => handleTryForFreeClick("docs_navbar_right")
290280
: undefined
291281
}
292282
className={`${isIconOnlyLink ? "[@media(width>=1028px)]:hidden [@media(width<768px)]:hidden" : "hidden"} justify-center items-center w-11 h-full md:flex`}

docs/components/react/ops-platform-cta.tsx

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import { ArrowRight, Info, Sparkles } from "lucide-react";
44
import posthog from "posthog-js";
5-
import { usePathname } from "next/navigation";
65
import { useCallback } from "react";
76

87
const DEFAULT_SIGNUP_URL = "https://dashboard.operations.copilotkit.ai/";
@@ -44,20 +43,13 @@ export function OpsPlatformCTA({
4443
ctaLabel = "Get Intelligence free",
4544
className,
4645
}: OpsPlatformCTAProps) {
47-
const pathname = usePathname();
48-
4946
const handleClick = useCallback(() => {
5047
try {
51-
posthog.capture("cta_clicked", {
52-
surface,
53-
variant,
54-
target: "intelligence",
55-
page_path: pathname,
56-
});
48+
posthog.capture("try_for_free_clicked", { location: surface });
5749
} catch {
5850
// PostHog may be blocked by ad blockers — never let analytics block navigation.
5951
}
60-
}, [surface, variant, pathname]);
52+
}, [surface]);
6153

6254
const href = buildHref(surface);
6355

docs/content/docs/(root)/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Look below to find right guide for your needs, whether you're starting from noth
5454
variant="tile"
5555
title="Production-ready agents on the free Developer tier"
5656
body="Persistent threads, observability, and the full CopilotKit platform."
57-
surface="docs:home:hero-tile"
57+
surface="docs_home_hero"
5858
className="mb-10"
5959
/>
6060

docs/content/docs/(root)/inspector.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { Callout } from "fumadocs-ui/components/callout";
1313
variant="inline"
1414
title="The threads tab needs Intelligence"
1515
body="When you open the Inspector, threads is the default tab. Sign up for the free Developer tier to see your conversation history."
16-
surface="docs:inspector:inline"
16+
surface="docs_inspector"
1717
/>
1818

1919
<Callout type="info">

docs/content/docs/(root)/prebuilt-components.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ They handle streaming, generative UI, and deep customization — so you can focu
2222
variant="inline"
2323
title="Want users to resume conversations across sessions?"
2424
body="Persistent threads ship with the CopilotKit platform. Try it for free."
25-
surface="docs:prebuilt-components:inline"
25+
surface="docs_prebuilt_components"
2626
/>
2727

2828
## Get started by choosing your AI backend

docs/content/docs/(root)/quickstart.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ npx copilotkit@latest create
1818
variant="inline"
1919
title="Building for production?"
2020
body="Get persistent threads, observability, and the full CopilotKit platform. Try it for free."
21-
surface="docs:quickstart:after-cli"
21+
surface="docs_quickstart_after_cli"
2222
/>
2323

2424
## Start from an AI backend

docs/content/docs/(root)/shared-state.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Use shared state when you want to facilitate collaboration between your agent an
3131
variant="inline"
3232
title="Building stateful agents?"
3333
body="Persistent threads ship with the CopilotKit platform on the free Developer tier."
34-
surface="docs:shared-state:inline"
34+
surface="docs_shared_state"
3535
/>
3636

3737
## Get started by choosing your AI backend

docs/content/docs/(root)/troubleshooting/event-inspector.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Use it when:
1818
variant="inline"
1919
title="The threads tab needs Intelligence"
2020
body="When you open the Inspector, threads is the default tab. Sign up for the free Developer tier to see your conversation history."
21-
surface="docs:troubleshooting/event-inspector:inline"
21+
surface="docs_event_inspector"
2222
/>
2323

2424
## Prerequisites

docs/content/docs/integrations/a2a/quickstart.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import { Tabs, Tab } from "fumadocs-ui/components/tabs";
3333
title="Ship A2A to production"
3434
body="Add persistent threads, observability, and the inspector with the CopilotKit platform."
3535
ctaLabel="Create a free account"
36-
surface="docs:a2a/quickstart:top"
36+
surface="docs_a2a_quickstart"
3737
/>
3838

3939
## Prerequisites

docs/content/docs/integrations/adk/quickstart.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Before you begin, you'll need the following:
6767
The CLI walks you through:
6868

6969
- **Project name**
70-
- **CopilotKit platform** — persistent threads, observability, and the inspector. Choose **Yes** to scaffold a project pre-wired for the platform (the CLI walks you through sign-up, or you can [create an account](https://dashboard.operations.copilotkit.ai/?utm_source=docs&utm_medium=cta&utm_campaign=intelligence&utm_content=docs:cli-prompt) first), or **No** for a standard ADK setup.
70+
- **CopilotKit platform** — persistent threads, observability, and the inspector. Choose **Yes** to scaffold a project pre-wired for the platform (the CLI walks you through sign-up, or you can [create an account](https://dashboard.operations.copilotkit.ai/?utm_source=docs&utm_medium=cta&utm_campaign=intelligence&utm_content=docs_cli_prompt) first), or **No** for a standard ADK setup.
7171
- **Framework** — pick **ADK** when prompted.
7272
</Step>
7373
<Step>

0 commit comments

Comments
 (0)