Skip to content

Commit fe787d2

Browse files
teallarsonclaude
andauthored
feat(analytics): add UTMs to docs signup links (GRO-86) (#924)
* feat(analytics): add UTMs to docs signup links (GRO-86) So Growth can attribute new Arcade account creations back to docs — per-page campaigns for the three QuickStarts, generic `docs` elsewhere. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * refactor(analytics): prefix docs campaigns so startsWith("docs") catches all - Default utm_campaign=docs (generic docs pages) - QuickStarts use utm_campaign=docs-quickstart-<slug> - Drop default utm_medium (most SignupLinks are inline prose, not CTAs) - Navbar uses utm_medium=navbar (matches marketing site convention) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * refactor(analytics): use URL constructor for SignupLink UTM assembly Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent a0fe256 commit fe787d2

5 files changed

Lines changed: 22 additions & 5 deletions

File tree

app/_components/analytics.tsx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,29 @@ export type LinkClickedProps = {
88
linkLocation: string;
99
children?: React.ReactNode;
1010
className?: string;
11+
utmCampaign?: string;
12+
utmMedium?: string;
13+
};
14+
15+
const UTM_SOURCE = "docs";
16+
const DEFAULT_UTM_CAMPAIGN = "docs";
17+
18+
const buildRegisterHref = (utmCampaign: string, utmMedium?: string): string => {
19+
const url = new URL(getDashboardUrl("register"));
20+
url.searchParams.set("utm_source", UTM_SOURCE);
21+
url.searchParams.set("utm_campaign", utmCampaign);
22+
if (utmMedium) {
23+
url.searchParams.set("utm_medium", utmMedium);
24+
}
25+
return url.toString();
1126
};
1227

1328
export const SignupLink = ({
1429
linkLocation,
1530
children,
1631
className,
32+
utmCampaign = DEFAULT_UTM_CAMPAIGN,
33+
utmMedium,
1734
}: LinkClickedProps) => {
1835
const trackSignupClick = (source: string) => {
1936
posthog.capture("Signup clicked", {
@@ -24,7 +41,7 @@ export const SignupLink = ({
2441
return (
2542
<Link
2643
className={cn("text-primary", className)}
27-
href={getDashboardUrl("register")}
44+
href={buildRegisterHref(utmCampaign, utmMedium)}
2845
onClick={() => trackSignupClick(linkLocation)}
2946
>
3047
{children}

app/en/get-started/quickstarts/call-tool-agent/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Install and use the Arcade client to call Arcade Hosted Tools.
2020

2121
<GuideOverview.Prerequisites>
2222

23-
- An <SignupLink linkLocation="docs:call-tools-directly">Arcade account</SignupLink>
23+
- An <SignupLink linkLocation="docs:call-tools-directly" utmCampaign="docs-quickstart-call-tool-agent">Arcade account</SignupLink>
2424
- An [Arcade API key](/get-started/setup/api-keys)
2525
- The [`uv` package manager](https://docs.astral.sh/uv/getting-started/installation/) if you are using Python
2626
- The [`bun` runtime](https://bun.com/) if you are using TypeScript

app/en/get-started/quickstarts/call-tool-client/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Create a coding agent using an MCP Gateway to call tools from multiple MCP serve
3535

3636
<GuideOverview.Prerequisites>
3737

38-
- An <SignupLink linkLocation="docs:call-tools-directly">Arcade account</SignupLink>
38+
- An <SignupLink linkLocation="docs:call-tools-directly" utmCampaign="docs-quickstart-call-tool-client">Arcade account</SignupLink>
3939

4040
</GuideOverview.Prerequisites>
4141

app/en/get-started/quickstarts/mcp-server-quickstart/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ $env:MY_SECRET_KEY="my-secret-value"
158158

159159
## Connect to Arcade to unlock authorized tool calling
160160

161-
Since the Reddit tool accesses information only available to your Reddit account, you'll need to authorize it. For this, you'll need to create an Arcade account and connect from the terminal, run:
161+
Since the Reddit tool accesses information only available to your Reddit account, you'll need to authorize it. For this, you'll need to create an <SignupLink linkLocation="docs:mcp-server-quickstart" utmCampaign="docs-quickstart-mcp-server">Arcade account</SignupLink> and connect from the terminal, run:
162162

163163
```bash
164164
arcade login

app/layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export default async function RootLayout({
160160
}
161161
projectLink="https://github.com/ArcadeAI/arcade-mcp"
162162
>
163-
<SignupLink linkLocation="docs:navbar">
163+
<SignupLink linkLocation="docs:navbar" utmMedium="navbar">
164164
<NavBarButton
165165
hideOnPath={[
166166
"/guides/create-tools/add-tools-to-arcade-catalog",

0 commit comments

Comments
 (0)