Skip to content

Commit

Permalink
undo
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhattin committed Feb 10, 2025
1 parent 4dfb96a commit 41b5286
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/tags/PostHogInit.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@
import { browser } from '$app/environment';
onMount(() => {
if (browser && import.meta.env.PROD && import.meta.env.VITE_POSTHOG_KEY) {
if (
browser &&
import.meta.env.PROD &&
import.meta.env.VITE_POSTHOG_KEY &&
(import.meta.env.VITE_POSTHOG_URL || import.meta.env.VITE_SITE_URL)
) {
import('posthog-js').then((posthog) => {
posthog.default.init(import.meta.env.VITE_POSTHOG_KEY, {
api_host: `${import.meta.env.VITE_SITE_URL}/ingest`,
api_host: `${import.meta.env.VITE_POSTHOG_URL ?? import.meta.env.VITE_SITE_URL}/ingest`,
person_profiles: 'identified_only',
ui_host: 'https://us.posthog.com'
});
Expand Down

0 comments on commit 41b5286

Please sign in to comment.