mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Disable web posthog
This commit is contained in:
parent
09fad9764a
commit
d24059dc0f
6 changed files with 2 additions and 52 deletions
|
|
@ -1,6 +1,5 @@
|
|||
import { UserBasicData } from './networking/queries/useGetViewerQuery'
|
||||
import { intercomAppID, posthogApiKey, webBaseURL } from './appConfig'
|
||||
import posthog from 'posthog-js'
|
||||
import { intercomAppID } from './appConfig'
|
||||
|
||||
const userInfo = (
|
||||
user: UserBasicData
|
||||
|
|
@ -19,17 +18,6 @@ const initAnalytics = (user?: UserBasicData): void => {
|
|||
vertical_padding: 120,
|
||||
custom_launcher_selector: '.custom-intercom-launcher',
|
||||
}
|
||||
if (posthogApiKey) {
|
||||
posthog.init(posthogApiKey, {
|
||||
api_host: `${webBaseURL}/collect`,
|
||||
autocapture: false,
|
||||
person_profiles: 'identified_only',
|
||||
disable_session_recording: false,
|
||||
advanced_disable_decide: true,
|
||||
advanced_disable_feature_flags: true,
|
||||
advanced_disable_toolbar_metrics: true,
|
||||
})
|
||||
}
|
||||
if (user) {
|
||||
window.Intercom('boot', userInfo(user))
|
||||
}
|
||||
|
|
@ -46,15 +34,7 @@ export const setupAnalytics = (user?: UserBasicData): void => {
|
|||
|
||||
if (user) {
|
||||
window.Intercom('update', userInfo(user))
|
||||
posthog.identify(user.id, {
|
||||
name: user.name,
|
||||
username: user.profile.username,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export const deinitAnalytics = (): void => {
|
||||
if (posthog && posthogApiKey) {
|
||||
posthog.reset(true)
|
||||
}
|
||||
}
|
||||
export const deinitAnalytics = (): void => {}
|
||||
|
|
|
|||
|
|
@ -70,8 +70,6 @@ export const appleAuthRedirectURI =
|
|||
|
||||
export const intercomAppID = process.env.NEXT_PUBLIC_INTERCOM_APP_ID
|
||||
|
||||
export const posthogApiKey = process.env.NEXT_PUBLIC_POSTHOG_API_KEY
|
||||
|
||||
export const googleID =
|
||||
appEnv == 'prod'
|
||||
? process.env.NEXT_PUBLIC_GOOGLE_ID
|
||||
|
|
|
|||
|
|
@ -45,10 +45,6 @@ const moduleExports = {
|
|||
}
|
||||
)
|
||||
}
|
||||
rewrites.push({
|
||||
source: '/collect/:match*',
|
||||
destination: 'https://app.posthog.com/:match*',
|
||||
})
|
||||
rewrites.push({
|
||||
source: '/home',
|
||||
destination: '/l/home',
|
||||
|
|
|
|||
|
|
@ -52,7 +52,6 @@
|
|||
"next": "^13.5.6",
|
||||
"node-html-markdown": "^1.3.0",
|
||||
"papaparse": "^5.4.1",
|
||||
"posthog-js": "^1.158.3",
|
||||
"pspdfkit": "^2023.4.6",
|
||||
"re-resizable": "^6.9.11",
|
||||
"react": "^18.2.0",
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ import { VerticalArticleActionsMenu } from '../../../components/templates/articl
|
|||
import { PdfHeaderSpacer } from '../../../components/templates/article/PdfHeaderSpacer'
|
||||
import { EpubContainerProps } from '../../../components/templates/article/EpubContainer'
|
||||
import { useSetPageLabels } from '../../../lib/hooks/useSetPageLabels'
|
||||
import { posthog } from 'posthog-js'
|
||||
import { PDFDisplaySettingsModal } from '../../../components/templates/article/PDFDisplaySettingsModal'
|
||||
import {
|
||||
ArticleReadingProgressMutationInput,
|
||||
|
|
@ -270,17 +269,6 @@ export default function Reader(): JSX.Element {
|
|||
}
|
||||
}, [actionHandler, goNextOrHome, goPreviousOrHome])
|
||||
|
||||
useEffect(() => {
|
||||
if (libraryItem && viewerData) {
|
||||
posthog.capture('link_read', {
|
||||
link: libraryItem.id,
|
||||
slug: libraryItem.slug,
|
||||
reader: libraryItem.contentReader,
|
||||
url: libraryItem.originalArticleUrl,
|
||||
})
|
||||
}
|
||||
}, [libraryItem, viewerData])
|
||||
|
||||
useRegisterActions(
|
||||
[
|
||||
{
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ import {
|
|||
} from '../components/elements/KBar'
|
||||
import { updateTheme } from '../lib/themeUpdater'
|
||||
import { ThemeId } from '../components/tokens/stitches.config'
|
||||
import { posthog } from 'posthog-js'
|
||||
import { GoogleReCaptchaProvider } from '@google-recaptcha/react'
|
||||
import AsyncStorage from '@react-native-async-storage/async-storage'
|
||||
import { QueryClient } from '@tanstack/react-query'
|
||||
|
|
@ -96,16 +95,6 @@ const ConditionalCaptchaProvider = (props: {
|
|||
export function OmnivoreApp({ Component, pageProps }: AppProps): JSX.Element {
|
||||
const router = useRouter()
|
||||
|
||||
useEffect(() => {
|
||||
const handleRouteChange = (url: string) => {
|
||||
posthog.capture('$pageview')
|
||||
}
|
||||
router.events.on('routeChangeComplete', handleRouteChange)
|
||||
return () => {
|
||||
router.events.off('routeChangeComplete', handleRouteChange)
|
||||
}
|
||||
}, [router.events])
|
||||
|
||||
return (
|
||||
<ConditionalCaptchaProvider>
|
||||
<Toaster />
|
||||
|
|
|
|||
Loading…
Reference in a new issue