Update link_read call

This commit is contained in:
Jackson Harper
2023-09-13 13:05:16 +08:00
parent 75b981da21
commit 8767e0b71d
2 changed files with 2 additions and 6 deletions

View File

@ -17,10 +17,6 @@ export const useCopyLink = (
const res = await navigator.clipboard.writeText(link)
setIsLinkCopied(true)
window.setTimeout(() => setIsLinkCopied(false), 5000)
window.analytics?.track('link_copied', {
link,
type,
})
}, [link, type])
return { link, copyLink, isLinkCopied }

View File

@ -47,6 +47,7 @@ import { EpubContainerProps } from '../../../components/templates/article/EpubCo
import { useSetPageLabels } from '../../../lib/hooks/useSetPageLabels'
import { updatePageMutation } from '../../../lib/networking/mutations/updatePageMutation'
import { State } from '../../../lib/networking/fragments/articleFragment'
import { posthog } from 'posthog-js'
const PdfArticleContainerNoSSR = dynamic<PdfArticleContainerProps>(
() => import('./../../../components/templates/article/PdfArticleContainer'),
@ -200,11 +201,10 @@ export default function Home(): JSX.Element {
useEffect(() => {
if (article && viewerData?.me) {
window.analytics?.track('link_read', {
posthog.capture('link_read', {
link: article.id,
slug: article.slug,
url: article.originalArticleUrl,
userId: viewerData.me.id,
})
}
}, [article, viewerData])