PostHog
April 8, 2026
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.
Sync settled consent once, then subscribe to real changes
The recommended PostHog SDK approach uses two phases: run one initial sync after c15t has finished resolving consent, then subscribe to future real preference changes with subscribeToConsentChanges().
Info
See the integration overview for how to wrap this in your framework (React or Next.js). Pass the callbacks option to your ConsentManagerProvider the same way you would pass scripts.
Info
Avoid using onConsentSet plus manual deduplication for PostHog. subscribeToConsentChanges() already gives you the exact change-only semantics most analytics SDKs need.
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.
Adding the script to c15t
Info
See the integration overview for how to pass scripts to your framework (JavaScript, React, or Next.js).