Skip to main content
CJ → PostHogIntegration guide

Connecting CJ Affiliate to PostHog

CJ operates at enterprise scale with sophisticated commissioning rules, which means the same publisher can be paid differently by product, by customer status or by placement — and getting those inputs wrong pays real money incorrectly. 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 CJ transaction 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

Using PostHog to find the checkout paths that drop CJ

PostHog isn't a destination for CJ Affiliate commissions; use it to find where CJ tracking leaks. Capture cjevent as an event and person property on the landing pageview, then funnel CJ-referred sessions to completed order by checkout path, with the same order ID as the CJ transaction, to spot orders CJ never received.

PostHog is not a destination for CJ commissions, but it is a good place to find out where your CJ tracking leaks. Enterprise stores usually have several checkout paths: standard checkout, express wallet buttons, buy now pay later flows, a mobile web checkout on a different stack, sometimes a separate subdomain for subscriptions. CJ only sees the orders where the identifier survived, and it never tells you about the ones it missed.

Capture cjevent as an event property on the landing pageview and as a person property, alongside the publisher ID if your link settings pass it. Then build a funnel from CJ-referred sessions to completed order, broken down by checkout path and payment method. A path where CJ-referred sessions complete orders in PostHog but the matching orders never appear in CJ is the leak. That comparison needs the same order ID on the PostHog order event and the CJ transaction.

Use the same data to check the commissioning inputs. Record the customer status you sent CJ on the order event, and compare it with whether the person had an earlier order in PostHog. If you self-host, keep the instance on your own domain so ad blockers do not also drop the very sessions you are trying to audit, which would make every path look leaky.

CJ → PostHog · what breaks

Why this join usually fails — CJ → PostHog

  1. 01

    The distinct_id never reaches CJ

    The publisher click identifier must survive to checkout, and enterprise stores frequently have several checkout paths.

  2. 02

    Commissioning rules fed the wrong inputs

    A new-customer rate applied to returning customers because the status flag was never wired is a direct overpayment on every affected order, compounding quietly until somebody audits the programme.

  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.

CJ → PostHog · the fix

What working looks like — CJ → PostHog

  • The distinct_id on every conversion

  • Conversions arriving in PostHog

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

  • Reconciled against the source

    CJ Affiliate's own records are the reference, not either dashboard.

CJ → PostHog · architecture

How CJ and PostHog actually connect

  1. 1

    CJ Affiliate holds the truth

    Rules commonly commission new customers differently from returning ones. If your order does not carry customer status correctly, publishers are paid the wrong rate systematically and neither side notices for months.

  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 CJ transaction.

  4. 4

    The event source decides reliability

    Send orders net of commission, carrying the fields the commissioning rules depend on.

  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.

CJ → PostHog · normal or broken

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

Normal, not a fault

  • The distinct_id present on the conversion

    Visible on the record itself in CJ Affiliate, not merely captured somewhere on the site.

  • Sent from your order record with CJ attribution

  • 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

    PostHog's count and CJ Affiliate's records agree within a few percent over a closed window.

Actually broken

  • The distinct_id missing on most records

    The publisher click identifier must survive to checkout, and enterprise stores frequently have several checkout paths.

  • Sent from the browser

    A new-customer rate applied to returning customers because the status flag was never wired is a direct overpayment on every affected order, compounding quietly until somebody audits the programme.

  • 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

    The dashboard shows a number and no one has compared it to CJ Affiliate.

CJ → PostHog · diagnose

Diagnostic order — CJ → PostHog

  1. 01

    Count conversions carrying the distinct_id

  2. 02

    Follow one real conversion end to end

    From the ad click through CJ and into PostHog.

  3. 03

    Verify that new-versus-returning status reaches CJ correctly

    Sample recent transactions and compare against your own customer records. Mismatches are money.

  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.

CJ → PostHog · prove

How it gets proven — CJ → PostHog

Against CJ Affiliate's own records, not against either platform's dashboard.

Source of truth

Orders flagged by publisher, with the commissioning inputs recorded on the order.

  • The distinct_id confirmed present on a live conversion.
  • A real conversion followed from click through CJ to PostHog.
  • Purchase events reconciled per transaction against your billing system, with ingestion lag checked over the same window.
  • Transactions reconciled per order with commissioning inputs verified against your own customer data.

CJ → PostHog · free audit

What we check in the free audit

  • Count conversions carrying the distinct_id
  • Follow one real conversion end to end
  • Verify that new-versus-returning status reaches CJ correctly
  • Check ingestion health and disk before debugging any missing event
  • Read the match rate, not the success message

Checked against

Orders flagged by publisher, with the commissioning inputs recorded on the order.

Get my free conversion tracking audit

Free30 minutesNo obligation

CJ → PostHog · when not to buy

When you don't need this — CJ → PostHog

  • If PostHog already reports conversions that reconcile against CJ Affiliate's records within a few percent, this join is working and there is nothing to buy.
  • Measure identifier coverage yourself first — pull your last hundred conversions and count how many carry the distinct_id.
  • Simple flat-rate programmes have no commissioning inputs to get wrong.
  • 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.

CJ → PostHog · what we deliver

What gets built — CJ → PostHog

  • Identifier capture into CJ

    Capture the identifier and the customer status on the order, and verify both across every checkout path you operate.

  • Event source: your order record with CJ attribution

    Send orders net of commission, carrying the fields the commissioning rules depend on.

  • 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 reverse and reverse the commission.

Written guarantee

95%+ tracking accuracy

Measured against Orders flagged by publisher, with the commissioning inputs recorded on the order.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

CJ → PostHog questions, answered

Record cjevent on the landing session in PostHog, build a funnel to order completed broken down by checkout path, and compare those orders against CJ transactions by order ID.

Free · 30 min

Get CJ and PostHog joined properly

Free30 minutesNo obligation