Skip to main content
Termly → PostHogIntegration guide

Connecting Termly to PostHog

Termly bundles consent management with policy generation, which means small businesses frequently end up with a privacy policy describing data practices they do not actually have. 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 Termly 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

Termly and PostHog: start opted out, opt in on consent

Initialize PostHog with capturing off, call opt_in_capturing on Termly analytics consent and opt_out_capturing on withdrawal, or use memory-only persistence for declined visitors. Mask session replay inputs and disclose recording. Server-side orders need the browser's distinct_id; for declined visitors, use your customer ID only if the policy allows, or don't send.

PostHog's JavaScript library has its own consent switches, and they are what should be wired to Termly rather than relying on the auto-blocker alone. Initialize PostHog with capturing off by default, call opt_in_capturing when Termly reports analytics consent and opt_out_capturing when it is withdrawn. PostHog also has a memory-only persistence mode that avoids cookies if you want anonymous counts for visitors who decline.

Session replay is the part teams forget. A replay records the page, including the Termly banner and form fields, so check that inputs are masked and that the policy says sessions are recorded. A generated policy describing generic analytics does not cover screen recording.

Server-side events, such as a paid order sent to the capture API, need the same distinct_id the browser used, or they land on a new person. For visitors who declined, there is no stable distinct_id, so either send the order under the customer ID you already hold, if your policy allows it, or do not send it. Self-hosting PostHog keeps data on your infrastructure but does not remove the duty to disclose it. Report how many orders came from consented sessions so the funnel numbers are read with the gap in mind.

Termly → PostHog · what breaks

Why this join usually fails — Termly → PostHog

  1. 01

    The distinct_id never reaches Termly

    Default blocking configurations stop capture before consent on the first page view.

  2. 02

    A generated policy that does not match reality

    Generated policies are templates. Adding a new conversion destination without updating the policy means you are disclosing data to a partner your own published statement does not mention, which is a real exposure that no tracking configuration fixes.

  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.

Termly → PostHog · the fix

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

Termly → PostHog · architecture

How Termly and PostHog actually connect

  1. 1

    Termly holds the truth

    The published policy is a statement about what you do. If it says you share data with categories of partner you do not use, or omits ones you do, the mismatch is the compliance exposure — not the banner.

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

Termly → PostHog · normal or broken

Working vs. broken, side by side — Termly → 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 blocking configurations stop capture before consent on the first page view.

  • Sent from the browser

    Generated policies are templates. Adding a new conversion destination without updating the policy means you are disclosing data to a partner your own published statement does not mention, which is a real exposure that no tracking configuration fixes.

  • 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

Termly → PostHog · diagnose

Diagnostic order — Termly → 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 what the policy discloses

    Every platform you send conversions to should appear. This is a five-minute check and it is almost never done after a new integration.

  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.

Termly → PostHog · prove

How it gets proven — Termly → PostHog

Source of truth

Your order system, with consent state attached.

  • 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 destination list verified against the published policy.

Termly → 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 what the policy discloses
  • 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.

Get my free conversion tracking audit

Free30 minutesNo obligation

Termly → PostHog · when not to buy

When you don't need this — Termly → PostHog

  • Measure identifier coverage yourself first — pull your last hundred consent records and count how many carry the distinct_id.
  • Before adding any new conversion destination, update the policy. That order matters, and it 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.

Termly → PostHog · what we deliver

What gets built — Termly → PostHog

  • Identifier capture into Termly

    Capture after consent, and make sure the policy actually describes the destinations you send conversions to.

  • 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.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

Termly → PostHog questions, answered

Start PostHog with capturing off, then call opt_in_capturing when Termly reports analytics consent and opt_out_capturing on withdrawal. Check Termly's docs for the event to listen on.

Free · 30 min

Get Termly and PostHog joined properly

Free30 minutesNo obligation