Skip to content

Commit

Permalink
docs(website): track more events
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahdayan committed Feb 20, 2023
1 parent e59d609 commit fef2806
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions website/components/MDXComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useRouter } from 'next/router';
import { useState } from 'react';
import reactToText from 'react-to-text';
import { useCopyToClipboard } from 'react-use';
import { trackGoal } from 'fathom-client';

import { ClipboardCheckIcon, ClipboardIcon, LinkIcon } from './icons';
import { InlineCode } from './InlineCode';
Expand Down Expand Up @@ -256,6 +257,7 @@ function CustomPreformattedText(
onClick={() => {
copyToClipboard(code);
setCopied(true);
trackGoal('QJ1G67BS', 0);

setTimeout(() => {
setCopied(false);
Expand Down
5 changes: 5 additions & 0 deletions website/layouts/Base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Link from 'next/link';
import { useClickAway } from 'react-use';
import cx from 'classnames';
import { DocSearch } from '@docsearch/react';
import { trackGoal } from 'fathom-client';

import '@docsearch/css';

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

if (url !== undefined) {
trackGoal('49HTDWU1', 0);
window.location.assign(url);
}
}}
Expand Down

1 comment on commit fef2806

@vercel
Copy link

@vercel vercel bot commented on fef2806 Feb 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

dinerojs – ./

dinerojs-dinerojs.vercel.app
v2.dinerojs.com
dinerojs-git-main-dinerojs.vercel.app

Please sign in to comment.