Skip to content

Commit fef2806

Browse files
committed
docs(website): track more events
1 parent e59d609 commit fef2806

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

website/components/MDXComponents.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { useRouter } from 'next/router';
55
import { useState } from 'react';
66
import reactToText from 'react-to-text';
77
import { useCopyToClipboard } from 'react-use';
8+
import { trackGoal } from 'fathom-client';
89

910
import { ClipboardCheckIcon, ClipboardIcon, LinkIcon } from './icons';
1011
import { InlineCode } from './InlineCode';
@@ -256,6 +257,7 @@ function CustomPreformattedText(
256257
onClick={() => {
257258
copyToClipboard(code);
258259
setCopied(true);
260+
trackGoal('QJ1G67BS', 0);
259261

260262
setTimeout(() => {
261263
setCopied(false);

website/layouts/Base.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Link from 'next/link';
44
import { useClickAway } from 'react-use';
55
import cx from 'classnames';
66
import { DocSearch } from '@docsearch/react';
7+
import { trackGoal } from 'fathom-client';
78

89
import '@docsearch/css';
910

@@ -284,6 +285,9 @@ export function Base({ children, headings }: BaseProps) {
284285
<ExternalLink
285286
href="https://v1.dinerojs.com/"
286287
className="font-semibold text-white hover:underline"
288+
onClick={() => {
289+
trackGoal('QHN9GSLE', 0);
290+
}}
287291
>
288292
Click here for v1.x documentation
289293
</ExternalLink>
@@ -305,6 +309,7 @@ export function Base({ children, headings }: BaseProps) {
305309
const { url } = sites[event.target.value as 'v1' | 'v2'];
306310

307311
if (url !== undefined) {
312+
trackGoal('49HTDWU1', 0);
308313
window.location.assign(url);
309314
}
310315
}}

0 commit comments

Comments
 (0)