From 0a717bb974e98fd90f59148cefb024958f81722e Mon Sep 17 00:00:00 2001 From: Alexandre Marques Date: Tue, 8 Apr 2025 18:03:12 +0100 Subject: [PATCH] feat: implement cookieless persistence and distinct ID configuration for PostHog analytics --- packages/analytics/src/client/providers.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/analytics/src/client/providers.tsx b/packages/analytics/src/client/providers.tsx index b56c305..7ca2f8a 100644 --- a/packages/analytics/src/client/providers.tsx +++ b/packages/analytics/src/client/providers.tsx @@ -20,6 +20,11 @@ export function PostHogProvider({ children }: { children: React.ReactNode }) { process.env.NEXT_PUBLIC_POSTHOG_HOST || "https://eu.i.posthog.com", person_profiles: "identified_only", // or 'always' to create profiles for anonymous users as well capture_pageview: false, // Disable automatic pageview capture, as we capture manually + // cookieless approach + persistence: "memory", + bootstrap: { + distinctID: "user distinct id", + }, }); }, []);