Skip to main content
AEM → PostHogIntegration guide

Connecting Adobe Experience Manager to PostHog

AEM sits inside the wider Adobe stack, which usually means Adobe Analytics is already in place and answering a different question from your ad platforms. 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 commerce order behind AEM 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

AEM to PostHog: one distinct_id from marketing site to product

PostHog on AEM pays off when a product sits behind the marketing site. Use one PostHog project for both, persist the cookie across subdomains, and merge the anonymous distinct_id into the signed-in user; don't use the Adobe ECID. Send server-side conversions from the product or billing backend with the distinct_id and an event UUID.

PostHog on an AEM site makes sense when there is a product behind the marketing pages, such as a portal, an app or a signup, and you want one funnel from the first article to in-product behavior. Adobe Analytics already reports content performance, so PostHog on AEM alone mostly duplicates it. Its value is the identify step: the anonymous distinct_id from the AEM pages has to be the same one that is merged into the signed-in user in the product.

That needs PostHog's cookie persisted across subdomains, and a single PostHog project for both the AEM site and the product. Two projects, which is what usually happens when the web team and the product team each install PostHog, means the funnel can never cross the signup. Don't use the Adobe ECID as the distinct_id either; it belongs to Adobe's identity service and resets on a different schedule.

Server-side conversions come from the product or billing backend with the user's distinct_id and an event UUID so retries do not duplicate. If you want PostHog to keep its edge against ad blockers, route ingestion through a path on your own domain. On AEM as a Cloud Service that is a CDN configuration change, so confirm with whoever owns it that the path will not be cached.

AEM → PostHog · what breaks

Why this join usually fails — AEM → PostHog

  1. 01

    The distinct_id never reaches AEM

    Dispatcher caching in front of AEM serves stored output, the Adobe data layer has its own conventions that may not carry your identifier, and enterprise release cycles slow every iteration.

  2. 02

    Three systems that will never agree

    Adobe Analytics, your commerce system and your ad platforms each measure differently. The useful work is deciding which answers which question, not forcing them to match.

  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.

AEM → PostHog · the fix

What working looks like — AEM → PostHog

  • The distinct_id on every order

  • Conversions arriving in PostHog

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

  • Reconciled against the source

    Adobe Experience Manager's own records are the reference, not either dashboard.

AEM → PostHog · architecture

How AEM and PostHog actually connect

  1. 1

    Adobe Experience Manager holds the truth

    In most AEM deployments the commerce engine is separate, and Adobe Analytics reports on its own model with its own attribution. None of those three will agree by default and that is expected rather than broken.

  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 commerce order behind AEM.

  4. 4

    The event source decides reliability

    Send from the commerce layer, server-side. Dispatcher caching makes any per-request template logic unreliable.

  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.

AEM → PostHog · normal or broken

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

Normal, not a fault

  • The distinct_id present on the order

    Visible on the record itself in Adobe Experience Manager, not merely captured somewhere on the site.

  • Sent from your commerce system's order event

  • 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 Adobe Experience Manager's records agree within a few percent over a closed window.

Actually broken

  • The distinct_id missing on most records

    Dispatcher caching in front of AEM serves stored output, the Adobe data layer has its own conventions that may not carry your identifier, and enterprise release cycles slow every iteration.

  • Sent from the browser

    Adobe Analytics, your commerce system and your ad platforms each measure differently. The useful work is deciding which answers which question, not forcing them to match.

  • 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 Adobe Experience Manager.

AEM → PostHog · diagnose

Diagnostic order — AEM → PostHog

  1. 01

    Count orders carrying the distinct_id

  2. 02

    Follow one real conversion end to end

  3. 03

    Map which system answers which question before building

    In an Adobe stack this framing saves more time than any implementation detail.

  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.

AEM → PostHog · prove

How it gets proven — AEM → PostHog

Against Adobe Experience Manager's own records, not against either platform's dashboard.

Source of truth

Your commerce system — AEM manages experiences, not transactions.

  • The distinct_id confirmed present on a live order.
  • Purchase events reconciled per transaction against your billing system, with ingestion lag checked over the same window.
  • Conversions confirmed sourced from the commerce system, with the Adobe Analytics difference explained rather than reconciled.

AEM → PostHog · free audit

What we check in the free audit

  • Count orders carrying the distinct_id
  • Follow one real conversion end to end
  • Map which system answers which question before building
  • Check ingestion health and disk before debugging any missing event
  • Read the match rate, not the success message

Checked against

Your commerce system — AEM manages experiences, not transactions.

Get my free conversion tracking audit

Free30 minutesNo obligation

AEM → PostHog · when not to buy

When you don't need this — AEM → PostHog

  • If PostHog already reports conversions that reconcile against Adobe Experience Manager'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 orders and count how many carry the distinct_id.
  • If Adobe Analytics already answers your reporting needs, the remaining work is only feeding ad platforms — a much smaller scope.
  • 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.

AEM → PostHog · what we deliver

What gets built — AEM → PostHog

  • Identifier capture into AEM

    Capture the identifier server-side and persist it to the commerce order, and if you use the Adobe client data layer, add the identifier explicitly rather than assuming it propagates.

  • Event source: your commerce system's order event

    Send from the commerce layer, server-side. Dispatcher caching makes any per-request template logic unreliable.

  • 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

    Handled at the commerce layer.

Written guarantee

95%+ tracking accuracy

Measured against Your commerce system — AEM manages experiences, not transactions.. Miss it and we keep working at no cost.

Get my free conversion tracking audit

From $400 · See packages

FAQ

AEM → PostHog questions, answered

Usually not. Adobe Analytics answers content and campaign reporting; PostHog adds value when it follows the same visitor from the AEM pages into a product after signup.

Free · 30 min

Get AEM and PostHog joined properly

Free30 minutesNo obligation