PostHog
PostHog is an open-source product analytics platform for tracking user behavior, session replays, feature flags, and A/B testing. It supports cookieless tracking, allowing analytics to continue even without cookie consent.
PostHog is an open-source product analytics platform that helps you understand user behavior, track events, and analyze product usage. Unlike traditional analytics tools, PostHog supports both cookieless and cookie-based tracking. This means you can sync c15t with PostHog and continue collecting analytics even when users haven't given consent—PostHog simply operates in cookieless mode until consent is granted.
PostHog SDK Implementation
This is the recommended approach if you're using the Posthog JS SDK, this is commonly used in React projects.
Adding the PostHog SDK to c15t
Initialize Posthog
When you initialize posthog make sure to set cookieless_mode to on_reject.
Adding the script to c15t
PostHog Script Implementation
If you want to load posthog via a script tag it's recommended to use this approach.
By default c15t will always load the script regardless of consent. This is because the script has built-in functionality to opt into and out of tracking based on consent.
Initialize Posthog
This script does not load the Posthog script, it only syncs the consent state with Posthog via the Posthog JS SDK.
This is due to Posthog's use of cookieless tracking. However, you need to set cookieless_mode to on_reject when initializing Posthog.