Skip to main content
LiveChat → PostHogIntegration guide

Connecting LiveChat to PostHog

LiveChat is agent-operated chat for mid-market companies, and its built-in goal tracking makes it unusually easy to create a conversion action that measures agent activity instead of revenue. 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 LiveChat goal 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

LiveChat to PostHog: measure what chats do to the product funnel

Capture chat started and pre-chat submitted from the LiveChat widget API under the PostHog distinct_id, and set that ID as a session variable so the server-side settled order lands on the same person, with a UUID from the order ID. Alias anonymous IDs at signup, compare agent goals with settled orders, and mask chat in replay.

PostHog is the right place to answer the question this source raises: do chats actually lead to revenue, or do agents just mark goals? Capture chat started and pre-chat form submitted from the LiveChat widget's JavaScript API callbacks on your page, under the visitor's PostHog distinct_id. Set that distinct_id as a LiveChat session variable too, so when the sale closes server-side, the order event carries the same ID and lands on the same person.

Multi-session conversations are where profiles fragment. A visitor chats anonymously on a laptop, returns on a phone, and signs up. Call identify at signup with your user ID and alias the earlier anonymous ID, or the chat and the purchase sit on two people and your funnel shows chats that never convert. Send the settled order with a stable event UUID derived from the order ID, so a retried webhook does not create a second purchase.

Be careful with the comparison PostHog will make easy. People who open chats are already more engaged, so a higher conversion rate among chatters is not proof chat caused it. Compare agent-marked goals against settled orders for the same people instead. If you use session replay, mask the chat frame and any field where customers type payment or account details.

LiveChat → PostHog · what breaks

Why this join usually fails — LiveChat → PostHog

  1. 01

    The distinct_id never reaches LiveChat

    The chat window is a third-party frame, and chats frequently continue across sessions and devices while the ticket stays open.

  2. 02

    Agent-reported sales as a bidding signal

    Agents mark goals inconsistently, under time pressure, and sometimes according to how they are compensated. That is a reasonable management metric and a terrible thing to hand an automated bidding algorithm.

  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.

LiveChat → PostHog · the fix

What working looks like — LiveChat → PostHog

  • The distinct_id on every goal

  • Conversions arriving in PostHog

    The event lands on the person profile and becomes available in insights, funnels and session replay.

  • Reconciled against the source

LiveChat → PostHog · architecture

How LiveChat and PostHog actually connect

  1. 1

    LiveChat holds the truth

    LiveChat's own goal and sales-tracking features are agent-reported. They are useful for coaching and unsuitable as an advertising conversion source, because a human decides whether they fire.

  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 LiveChat goal.

  4. 4

    The event source decides reliability

    Send the settled commercial outcome, not the agent-marked goal.

  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.

LiveChat → PostHog · normal or broken

Working vs. broken, side by side — LiveChat → PostHog

Normal, not a fault

  • The distinct_id present on the goal

  • Sent from your order or CRM record

  • 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

    The chat window is a third-party frame, and chats frequently continue across sessions and devices while the ticket stays open.

  • Sent from the browser

    Agents mark goals inconsistently, under time pressure, and sometimes according to how they are compensated. That is a reasonable management metric and a terrible thing to hand an automated bidding algorithm.

  • 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

LiveChat → PostHog · diagnose

Diagnostic order — LiveChat → PostHog

  1. 01

    Count goals carrying the distinct_id

  2. 02

    Follow one real conversion end to end

  3. 03

    Compare agent-marked goals against settled revenue

    The gap is usually wide enough to settle the argument about which one should be the conversion.

  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.

LiveChat → PostHog · prove

How it gets proven — LiveChat → PostHog

Source of truth

Your order or CRM system, joined to the chat session by the agent-recorded identifier or the customer's email.

  • The distinct_id confirmed present on a live goal.
  • Purchase events reconciled per transaction against your billing system, with ingestion lag checked over the same window.
  • Settled orders reconciled against imported conversions; agent-marked goals excluded.

LiveChat → PostHog · free audit

What we check in the free audit

  • Count goals carrying the distinct_id
  • Follow one real conversion end to end
  • Compare agent-marked goals against settled revenue
  • 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, joined to the chat session by the agent-recorded identifier or the customer's email.

Get my free conversion tracking audit

Free30 minutesNo obligation

LiveChat → PostHog · when not to buy

When you don't need this — LiveChat → PostHog

  • Measure identifier coverage yourself first — pull your last hundred goals and count how many carry the distinct_id.
  • If LiveChat is purely a support channel, no integration is warranted.
  • 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.

LiveChat → PostHog · what we deliver

What gets built — LiveChat → PostHog

  • Identifier capture into LiveChat

    Push the identifier in as a custom variable at load. Expect multi-session conversations, and persist against the customer rather than the session.

  • Event source: your order or CRM record

    Send the settled commercial outcome, not the agent-marked goal.

  • 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

    Refunds and cancelled deals reverse.

Written guarantee

95%+ tracking accuracy

Measured against Your order or CRM system, joined to the chat session by the agent-recorded identifier or the customer's email.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

LiveChat → PostHog questions, answered

Listen to the LiveChat widget's JavaScript API callbacks on your page and capture them as PostHog events under the current distinct_id. Pass the distinct_id into LiveChat as a session variable so server-side events can reuse it.

Free · 30 min

Get LiveChat and PostHog joined properly

Free30 minutesNo obligation