Skip to main content
Complianz → PostHogIntegration guide

Connecting Complianz to PostHog

Complianz is a WordPress consent plugin that blocks scripts by category automatically, which means a plugin update can change what fires on your site without anyone deciding to. 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 Complianz 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

PostHog behind Complianz: memory-only until consent

Put PostHog in Complianz's statistics category, start it cookieless in memory-only mode, and switch persistence on consent; treat session replay as a separate consent question. Server-side purchases need a distinct_id from PostHog's cookie stored at checkout, or your own customer ID for logged-in buyers. Self-hosted PostHog evades blockers, so the gate must be real.

PostHog's browser library can start without writing cookies, keeping its identifier in memory only, and switch to persistent storage once a visitor accepts. That fits Complianz well: put PostHog in the statistics category, start it cookieless, and change persistence on Complianz's consent change. The thing to decide separately is session replay. Replay records what happens on the page, including form fields unless masked, which is a much bigger consent question than counting pageviews.

Server-side events are where it goes wrong. Your order system sends a purchase to the capture API with a distinct_id. For a consented visitor, that ID can be read from PostHog's cookie at checkout and stored on the order. For a visitor running in memory-only mode there is no cookie, so the server event creates a new person with a single purchase and no funnel before it. Use your own customer ID for logged-in buyers, and accept that anonymous unconsented orders sit outside your funnels.

If you self-host PostHog on a subdomain of your site, ad blockers will not stop it, which is exactly why the consent gate has to be real rather than accidental. On this pair the banner, not the blocker, decides who is tracked, so test it with the page cache on.

Complianz → PostHog · what breaks

Why this join usually fails — Complianz → PostHog

  1. 01

    The distinct_id never reaches Complianz

    Scripts are blocked before execution, and WordPress caching can serve a page with the wrong consent state entirely.

  2. 02

    Caching serving the wrong consent state

    A full-page cache does not know who is asking. A page cached for a consented visitor and served to one who declined runs scripts that should not have run, which is a compliance problem rather than a measurement one.

  3. 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.

  4. 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.

Complianz → PostHog · the fix

What working looks like — Complianz → 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

Complianz → PostHog · architecture

How Complianz and PostHog actually connect

  1. 1

    Complianz holds the truth

    Automatic script blocking on WordPress interacts with every other plugin. A caching plugin, a tag manager and a consent plugin all touching the same page produce ordering problems nobody planned.

  2. 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. 3

    The identifier is the bridge

    The distinct_id, captured at the visit and carried into the Complianz consent record.

  4. 4

    The event source decides reliability

    Send consented conversions with the consent rate stated.

  5. 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.

Complianz → PostHog · normal or broken

Working vs. broken, side by side — Complianz → 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

    Scripts are blocked before execution, and WordPress caching can serve a page with the wrong consent state entirely.

  • Sent from the browser

    A full-page cache does not know who is asking. A page cached for a consented visitor and served to one who declined runs scripts that should not have run, which is a compliance problem rather than a measurement one.

  • 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

Complianz → PostHog · diagnose

Diagnostic order — Complianz → PostHog

  1. 01

    Count consent records carrying the distinct_id

  2. 02

    Follow one real conversion end to end

  3. 03

    Test consent behaviour with caching enabled, not disabled

    Most consent testing is done with cache off, which is the one configuration that never runs in production.

  4. 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.

  5. 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.

Complianz → PostHog · prove

How it gets proven — Complianz → PostHog

Source of truth

Your order or CRM system, with consent state recorded at the time of 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, verified with production caching active.

Complianz → PostHog · free audit

What we check in the free audit

  • Count consent records carrying the distinct_id
  • Follow one real conversion end to end
  • Test consent behaviour with caching enabled, not disabled
  • Check ingestion health and disk before debugging any missing event
  • Read the match rate, not the success message

Checked against

Your order or CRM system, with consent state recorded at the time of the event.

Get my free conversion tracking audit

Free30 minutesNo obligation

Complianz → PostHog · when not to buy

When you don't need this — Complianz → PostHog

  • Measure identifier coverage yourself first — pull your last hundred consent records and count how many carry the distinct_id.
  • Sites without full-page caching avoid the interaction, though the category classification still matters.
  • 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.

Complianz → PostHog · what we deliver

What gets built — Complianz → PostHog

  • Identifier capture into Complianz

    Verify which category your capture script sits in, and check that caching does not serve a consented page to a non-consented visitor.

  • 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 or CRM system, with consent state recorded at the time of the event.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

Complianz → PostHog questions, answered

Load PostHog in the statistics category with memory-only persistence and switch to cookie persistence, or opt the visitor in to capturing, when Complianz reports consent. Test with the banner declined and caching active.

Free · 30 min

Get Complianz and PostHog joined properly

Free30 minutesNo obligation