Connecting CookieYes to PostHog
CookieYes serves smaller sites that adopted a consent banner because a plugin suggested it, which frequently means the banner is stricter than the business's legal position requires. PostHog can be self-hosted, which changes the calculus entirely: the data stays on infrastructure you control, and so does the responsibility for everything that goes wrong with it. The join between them succeeds or fails on one thing: whether the distinct_id reaches the CookieYes consent record before the conversion happens, because PostHog can only match a conversion it can tie back to a click it recognizes.
Free30 minutesNo obligation
Specific to this pair
CookieYes and PostHog: memory-only until analytics is accepted
Initialise posthog-js with memory-only persistence and call opt_in_capturing when CookieYes reports the analytics category accepted, reading the cookieyes-consent cookie and the consent-update event. Decide session replay separately. Send backend events to PostHog's capture API with your own user ID as distinct_id, and alias the anonymous browser ID to it only for visitors who accepted analytics.
Blocking posthog-js with CookieYes under default-deny removes decliners from your product analytics entirely, including the funnels you built to understand signup. PostHog has a gentler option: initialise it with memory-only persistence, so nothing is written to cookies or local storage, and switch to cookie persistence by calling opt_in_capturing when CookieYes reports the analytics category accepted. Read the choice from the cookieyes-consent cookie on load and from CookieYes's consent-update event when it changes; check the current event name in CookieYes's docs.
Whether memory-only capture before consent is acceptable depends on your markets; for many US-only sites it is, but confirm with counsel. Session replay deserves its own decision regardless, since it records far more than events. If you also route PostHog through your own domain to avoid ad blockers, it still has to follow the CookieYes choice; a proxy changes who can block it, not whether consent applies.
Server-side events from your backend to the capture API, keyed on your own user ID as distinct_id, are separate from the banner: a subscription started in your database is your record. Only alias the anonymous browser ID to that user ID when the visitor accepted analytics, or decliners' browsing gets attached to them after all.
CookieYes → PostHog · what breaks
Why this join usually fails — CookieYes → PostHog
- 01
The distinct_id never reaches CookieYes
Default configurations frequently block before consent, so identifier capture is lost on the first page for every visitor.
- 02
A banner stricter than the law requires
Plugins default to the strictest setting because that is safest for the plugin vendor. For a business whose customers are all in a market with different rules, that default costs a large share of measurable conversions and buys no protection that was needed.
- 03
Self-hosting the analytics and the outage together
The advantage of owning the pipeline is that nothing blocks it. The cost is that when the ingestion instance fills its disk on a Saturday, the events are gone and nobody is paged. Hosted tools fail differently and more visibly.
- 04
Nothing reconciles afterwards
PostHog shows events in the activity view within moments. On a self-hosted instance, check the ingestion lag as well — events that are queued are not events that are lost, and the two need different responses.
CookieYes → PostHog · the fix
What working looks like — CookieYes → PostHog
The distinct_id on every consent record
Conversions arriving in PostHog
The event lands on the person profile and becomes available in insights, funnels and session replay.
Reconciled against the source
CookieYes → PostHog · architecture
How CookieYes and PostHog actually connect
- 1
CookieYes holds the truth
For a small business the practical question is often whether the banner configuration matches the obligation. A default-deny banner in a market with no such requirement is data thrown away for nothing.
- 2
PostHog needs a click to match
PostHog needs a distinct_id, an event name and its properties. Self-hosted instances additionally need the ingestion endpoint reachable and the project API key correct, which is a class of failure hosted tools do not have.
- 3
The identifier is the bridge
The distinct_id, captured at the visit and carried into the CookieYes consent record.
- 4
The event source decides reliability
Send consented conversions with the consent rate stated.
- 5
Deduplication at the destination
PostHog deduplicates on the event UUID where supplied. Without one, a retried batch duplicates, and on a self-hosted instance there is no vendor support desk to notice it for you.
CookieYes → PostHog · normal or broken
Working vs. broken, side by side — CookieYes → PostHog
Normal, not a fault
The distinct_id present on the consent record
Sent from your order system, gated on consent
Deduplicated correctly
PostHog deduplicates on the event UUID where supplied. Without one, a retried batch duplicates, and on a self-hosted instance there is no vendor support desk to notice it for you.
Reconciles with the source
Actually broken
The distinct_id missing on most records
Default configurations frequently block before consent, so identifier capture is lost on the first page for every visitor.
Sent from the browser
Plugins default to the strictest setting because that is safest for the plugin vendor. For a business whose customers are all in a market with different rules, that default costs a large share of measurable conversions and buys no protection that was needed.
Counted twice, or not at all
The advantage of owning the pipeline is that nothing blocks it. The cost is that when the ingestion instance fills its disk on a Saturday, the events are gone and nobody is paged. Hosted tools fail differently and more visibly.
Nobody has reconciled it
CookieYes → PostHog · diagnose
Diagnostic order — CookieYes → PostHog
- 01
Count consent records carrying the distinct_id
- 02
Follow one real conversion end to end
- 03
Confirm which regulations actually apply to your customer base
A legal question, not a technical one, and worth answering before accepting a default that costs you a third of your data.
- 04
Check ingestion health and disk before debugging any missing event
On self-hosted instances the answer is infrastructure far more often than it is instrumentation.
- 05
Read the match rate, not the success message
PostHog shows events in the activity view within moments. On a self-hosted instance, check the ingestion lag as well — events that are queued are not events that are lost, and the two need different responses.
CookieYes → PostHog · prove
How it gets proven — CookieYes → PostHog
Source of truth
Your order system, with consent state attached to the event.
- The distinct_id confirmed present on a live consent record.
- Purchase events reconciled per transaction against your billing system, with ingestion lag checked over the same window.
- Consented conversions reconciled against imported figures, with the configuration checked against the obligation.
CookieYes → PostHog · free audit
What we check in the free audit
- Count consent records carrying the distinct_id
- Follow one real conversion end to end
- Confirm which regulations actually apply to your customer base
- Check ingestion health and disk before debugging any missing event
- Read the match rate, not the success message
Checked against
Your order system, with consent state attached to the event.
Free30 minutesNo obligation
CookieYes → PostHog · when not to buy
When you don't need this — CookieYes → PostHog
- Measure identifier coverage yourself first — pull your last hundred consent records and count how many carry the distinct_id.
- This is the common case for small sites: get the legal position confirmed first. The right banner may be considerably lighter than the one installed.
- If you have no reason to keep the data on your own infrastructure and no team to run it, the hosted product removes the only real downside of this one.
CookieYes → PostHog · what we deliver
What gets built — CookieYes → PostHog
Identifier capture into CookieYes
Check the default blocking behaviour against your actual legal obligation, then capture accordingly.
Event source: your order system, gated on consent
Send consented conversions with the consent rate stated.
Dispatch to PostHog
The PostHog capture API, posted server-side from your backend to your own instance or to PostHog Cloud.
Reversals where they exist
Withdrawal stops future sends.
Written guarantee
95%+ tracking accuracy
Measured against Your order system, with consent state attached to the event.. Miss it and we keep working at no cost.
From $400 · See packages
FAQ
CookieYes → PostHog questions, answered
Start PostHog with memory-only persistence and call opt_in_capturing when CookieYes reports the analytics category accepted; opt out on decline.
Not necessarily. Memory-only capture before consent may be acceptable in your markets. Confirm with counsel, and decide on session replay separately.
Almost always because the distinct_id never reached the CookieYes consent record. Default configurations frequently block before consent, so identifier capture is lost on the first page for every visitor. Measure coverage before debugging the dispatch.
PostHog identifies by distinct_id with an alias call to merge anonymous and identified users. On a self-hosted instance you also control the ingestion endpoint, which means the identifier survives ad blockers that would kill a third-party pixel — one of the few genuine technical advantages available to a first-party setup.
Your order system, gated on consent. Send consented conversions with the consent rate stated.
PostHog shows events in the activity view within moments. On a self-hosted instance, check the ingestion lag as well — events that are queued are not events that are lost, and the two need different responses.
More on CookieYes → PostHog
- Stripe → PostHogConnecting Stripe to PostHog
- PayPal → PostHogConnecting PayPal to PostHog
- Shopify → PostHogConnecting Shopify to PostHog
RELATED GUIDES
Where CookieYes → PostHog fits in the rest of your tracking
- OneTrust → PostHogConnecting OneTrust to PostHog
- Termly → PostHogConnecting Termly to PostHog
- Osano → PostHogConnecting Osano to PostHog
- CookieYes → GA4Connecting CookieYes to GA4
- CookieYes → AmplitudeConnecting CookieYes to Amplitude
- Financial servicesConversion tracking for financial services, built for the compliance review
- iubenda → PostHogConnecting iubenda to PostHog
- Cookiebot → PostHogConnecting Cookiebot to PostHog
Free · 30 min
Get CookieYes and PostHog joined properly
Free30 minutesNo obligation
