Skip to main content
iubenda → PostHogIntegration guide

Connecting iubenda to PostHog

iubenda bundles consent management with generated privacy policies and cookie declarations, which means the published document and the actual behaviour can drift apart silently. 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 iubenda 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 with iubenda: opt-in capture without losing the funnel

Start PostHog's JavaScript library opted out and opt visitors in from iubenda's preference callback when measurement is granted; memory-only persistence can count decliners anonymously. Gate session replay on consent separately and mask form inputs. Check stored consent before backend capture API events, sending decliners anonymously, and describe self-hosted PostHog as first-party.

PostHog's JavaScript library can start in an opted-out state and begin capturing only when told to, which maps directly onto iubenda's preference callback: opt the visitor in when the measurement purpose is granted, opt out on withdrawal. PostHog can also keep persistence in memory only for decliners, counting anonymous page views without a cookie; check the current option names in PostHog's docs and decide per region.

Session replay needs its own decision. Recording a session is heavier processing than counting a page view, and one analytics consent may not cover it under your policy. If replay is on, gate it on consent separately and mask form inputs regardless, since replays of checkout and signup pages are where personal data ends up stored.

Server-side events through the capture API bypass the browser opt-out entirely. Store the consent state on the person and check it before your backend sends identified purchase events; for decliners, send anonymous events without a distinct_id that links to a profile. Self-hosting PostHog on your own domain also changes what the declaration should say: first-party, with no third-party recipient.

iubenda → PostHog · what breaks

Why this join usually fails — iubenda → PostHog

  1. 01

    The distinct_id never reaches iubenda

    Blocking runs before scripts execute, and the declaration is generated from a scan that may be months old.

  2. 02

    A cookie declaration that no longer matches the site

    Every new conversion destination is a new data-sharing relationship. If the declaration was generated before it was added, the site is disclosing to a partner its own published document does not name.

  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.

iubenda → PostHog · the fix

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

iubenda → PostHog · architecture

How iubenda and PostHog actually connect

  1. 1

    iubenda holds the truth

    The cookie declaration lists what the site sets. Adding a new conversion destination adds cookies and data sharing the declaration does not mention until somebody updates it.

  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 iubenda consent record.

  4. 4

    The event source decides reliability

    Send consented conversions, with the destination list matching the published declaration.

  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.

iubenda → PostHog · normal or broken

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

    Blocking runs before scripts execute, and the declaration is generated from a scan that may be months old.

  • Sent from the browser

    Every new conversion destination is a new data-sharing relationship. If the declaration was generated before it was added, the site is disclosing to a partner its own published document does not name.

  • 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

iubenda → PostHog · diagnose

Diagnostic order — iubenda → PostHog

  1. 01

    Count consent records carrying the distinct_id

  2. 02

    Follow one real conversion end to end

  3. 03

    Compare your destination list against the published declaration

    Five minutes, and it is almost never done after a new integration goes live.

  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.

iubenda → PostHog · prove

How it gets proven — iubenda → 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, with the declaration verified against the live destination list.

iubenda → PostHog · free audit

What we check in the free audit

  • Count consent records carrying the distinct_id
  • Follow one real conversion end to end
  • Compare your destination list against the published declaration
  • 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.

Get my free conversion tracking audit

Free30 minutesNo obligation

iubenda → PostHog · when not to buy

When you don't need this — iubenda → PostHog

  • Measure identifier coverage yourself first — pull your last hundred consent records and count how many carry the distinct_id.
  • Update the declaration before adding a destination, not after. That order is cheaper than the alternative.
  • 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.

iubenda → PostHog · what we deliver

What gets built — iubenda → PostHog

  • Identifier capture into iubenda

    Capture after consent, and re-run the scan whenever a destination is added.

  • Event source: your order system, gated on consent

    Send consented conversions, with the destination list matching the published declaration.

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

Get my free conversion tracking audit

From $400 · See packages

FAQ

iubenda → PostHog questions, answered

Initialize PostHog opted out, opt in from iubenda's preference callback when measurement consent is granted, and opt out on withdrawal. Server-side events need their own consent check.

Free · 30 min

Get iubenda and PostHog joined properly

Free30 minutesNo obligation