PostHog Implementation Mistakes: Capture, Identity and Replay

A reliable PostHog implementation needs separate decisions for navigation events, business outcomes, identity and session recording. Most problems appear when automatic collection is assumed to handle all four. Check who owns each event, how authentication changes identity, what replay can expose and which sessions qualify for recording. Then validate a complete journey with known outcomes and synthetic privacy probes.

Jafrin Akter AloLast updated 13 min read
On this page
A white film reel feeds a lime strip with a pink privacy panel beside Clean PostHog Capture.

Installing a snippet is the start of the work. A useful implementation lets a product manager distinguish a failed workflow from a tracking failure, and lets an engineer reproduce that distinction without guessing at configuration.

This guide focuses on web implementations. Mobile software development kit (SDK) behavior and supported options differ, so do not copy browser settings into a native application without checking its SDK documentation.

A product analytics setup should leave the team with an event ownership map and repeatable acceptance journeys. Those artifacts are more valuable than a dashboard full of activity that nobody can explain.

Which PostHog failures should you fix first?

Start with identity, exposed information and false business outcomes. These failures can send a workflow to the wrong person, reveal data or make a failed operation look successful. Use the symptom to choose the first boundary to investigate:

Which PostHog failures should you fix first?
SymptomFirst boundary to inspectRepair acceptance
One person's activity appears under another identityAuthentication, supplied identifiers and logout resetTwo test users remain separate through login, logout and return
Private content appears in a replay or eventInput, text, URL and custom-property collectionExcluded synthetic markers disappear while safe context remains useful
A failed or repeated operation counts as a successBusiness-event producer and occurrence identityThe application and destination agree on each successful job

Then resolve navigation counts, recording eligibility and delivery gaps. Keep a known failing specimen so the repair has a concrete result to demonstrate.

Why does one navigation create duplicate pageviews?

Two collection paths can report the same logical navigation. Choose one pageview owner. PostHog separates interaction autocapture from pageview capture; capture_pageview: 'history_change' captures route changes and becomes the default with defaults: '2025-05-24' or later. Record both the installed SDK version and selected defaults. JavaScript configuration.

If a framework integration captures route changes and a custom router effect also sends $pageview, one navigation can create two pageviews. Turning off click autocapture will not resolve that duplicate path.

Find every initialization and capture path in the application, including tag-manager snippets, framework providers and imported client singletons. Choose one owner for pageviews. Then record whether a pageview means a document load, a route transition or another explicitly defined view.

Test a direct load, a client-side navigation, a browser-back action and a page refresh. Keep the expected count separate from implementation details such as component renders. A component can render several times without the user seeing a new logical page.

Do not suppress every repeated URL blindly. A user can legitimately return to a page, while a query parameter change may or may not represent a new view. Define that behavior before writing a deduplication workaround.

When upgrading the SDK, review the selected defaults and explicit settings together. A configuration copied from an older example can behave differently from a current framework guide even when both initialize successfully.

Why do clicks appear as successful business outcomes?

Use an authoritative application state change to confirm business success. PostHog automatically captures supported clicks, form interactions and navigation events; those observations explain what happened in the interface. Autocapture documentation.

For example, an export button can be clicked while the request later fails. A form can be submitted while validation rejects the data. An apparent conversion based on those interactions measures intent rather than the promised outcome.

Use different names for the stages. An illustrative export flow could contain export_requested, export_succeeded and export_failed, with a stable export_job_id linking them. Decide which system owns each event and what application state permits it to be sent.

The backend should own a backend-confirmed success. If the browser also needs a success event for another purpose, give it a distinct meaning rather than sending the same business event twice.

Include retry behavior in the contract. A retry of one job is not necessarily a new business attempt, while a deliberately created second job is. Preserve enough context to explain the distinction in the destination and your application records.

Our event naming guide helps make the difference visible. The strongest event names describe a specific state change rather than the interface element that happened to initiate it.

When should PostHog identify a user?

Identify the person once the application has a stable authenticated identifier (ID), and use that same ID for the corresponding backend events. Frontend identification links anonymous activity to that person. Reset on logout to separate future device activity. Identifying users.

Wait until authentication supplies the real identity. PostHog prohibits identifiers such as guest, empty strings and several other common placeholders. An invalid merge can still leave an ingested event and an ingestion warning, so inspect the resulting identity as well as receipt. Application-specific shared identifiers are also a design error even when they are outside the prohibited list.

Use a stable internal user key. Keep workspace and project keys as separate context. One person can operate in several accounts, and one account can contain several people.

For backend capture, derive the authenticated user from trusted application state. An analytics identifier passed by a browser is context, not permission to access that person's data.

Test these transitions as a single sequence: anonymous visit, signup, authenticated operation, logout, anonymous visit and a different person's login. Then test the original person on a second device. Inspect the events attached to each identity, not just the number of profiles. The identify and merge rules compared with Mixpanel and Amplitude explain why a familiar method name does not establish equivalent behaviour.

Reset behavior must be deliberate. Resetting on every route change can fragment a valid journey; failing to reset on logout can attach later activity to the wrong person. Record the actual SDK method and transition order used by your application.

Do anonymous events prevent sensitive data collection?

Define permitted properties and collection rules separately from person-profile processing. In PostHog, anonymous versus identified events concerns profile processing and available analysis. The JavaScript SDK and backend SDKs can have different defaults. In particular, backend capture is identified by default, and suppressing person processing does not make an already linked distinct ID unrelated to its person. Anonymous versus identified events.

That classification does not tell you whether a custom property contains information your team intended to exclude. A supposedly anonymous event can still be badly designed if someone adds a private document title to its properties.

Create a property allowlist for decision-critical custom events. For a report export, the approved context might include job ID, workspace ID, format and a bounded result code. It may not need the report's contents, recipient address or raw exception text.

Keep uncertainty explicit. If the event lacks a required workspace ID, treat that as a schema failure to investigate rather than silently assigning it to a generic workspace. A generic fallback can make the report look complete while collapsing unrelated activity.

The tracking plan should identify which fields are required, which are optional and which must never be sent. That makes review possible at the code boundary instead of relying on people to notice an unusual property after ingestion.

Which replay surfaces need separate privacy checks?

Check input values, displayed text, URLs and custom event properties separately. Web replay masks input values by default, while general text needs its own masking settings. PostHog also provides element blocking and URL redaction; the relevant masking runs before transmission. Replay privacy controls.

A customer name can appear in an input, a heading, a notification, a URL or an attribute. Masking one surface does not prove the others are excluded. Likewise, a replay setting is not automatically a rule for every custom analytics property.

Use synthetic quality-assurance (QA) probes in a test account. Give each surface a different fake marker so a collection error can be traced to its source. The markers below are test data; use no real customer information.

Which replay surfaces need separate privacy checks?
Test surfaceSynthetic markerAcceptance evidence
Input valueQA_INPUT_ONLY_817Value absent from the relevant outbound and stored replay data
Displayed headingQA_HEADING_ONLY_817Text masking works after the value appears outside an input
Route query parameterQA_QUERY_ONLY_817The excluded parameter is absent from captured URLs
Prohibited custom event propertyQA_PROPERTY_ONLY_817The event's property policy excludes the value independently of replay masking

Perform the journey, inspect outbound payloads and inspect the stored event or replay that the team will actually use. Confirm both that excluded markers are absent and that safe structural context remains useful.

Inspect custom attributes too. Autocapture can be configured to include selected attributes, and custom ignore lists can replace defaults. Review the effective list rather than assuming an existing exclusion remains active after a new configuration is added. Autocapture controls.

Repeat the probe after changes to rich-text editors, search results and notification components. These surfaces often move information from a masked input into ordinary displayed text.

Why can a replay continue beyond its trigger page?

A URL trigger starts recording, and recording can continue after the visitor leaves that URL. Current trigger-group rules assume defaults: '2026-06-25' and require posthog-js 1.369.0 or later; earlier configurations can use legacy controls. Check the actual version, group conditions, sample rate and minimum duration together. Recording controls.

Test the page after the trigger as well as the page that matches it. If the next page contains information that should be excluded, apply the appropriate masking, blocking or programmatic control and verify the result.

Deleting the last trigger group creates a default “Record all sessions” group at 100% sampling with no conditions. An empty group matches every session. To stop recording, use the explicit recording control and verify the effective state; deleting rules is not a disablement procedure.

Sampling introduces another common diagnostic mistake. If a session is not selected, an analytics event can exist without an associated recording. That absence does not establish that replay is broken or that the action never occurred.

For QA, use a dedicated test configuration with known eligibility and a controlled recording rate. Test the intended trigger, a nonmatching journey and a journey that leaves the matching area. Restore the planned production rules after validation.

Keep the distinctions visible in incident reviews. “No replay available” can mean not eligible, not sampled, below the duration threshold, blocked capture or another failure. The investigation needs those possibilities before drawing conclusions from the missing recording.

Test fresh visits, rejected permission, acceptance, withdrawal and return visits, then verify the destination outcome. PostHog's opt-in and opt-out controls apply to the current device. Browser consent storage defaults to origin-specific local storage, separately from analytics identity storage; a choice on one origin is not automatically shared with another. Data collection controls.

Implement the policy your business has chosen and test the full lifecycle. In a setup that requires permission before collection, a fresh visit, rejection, acceptance, withdrawal and return visit should each have an explicit expected result. Test every participating subdomain.

Do not use a successful SDK call as evidence that the policy was followed. Inspect the relevant network traffic and stored state. Also verify that server-side capture follows the same intended rules where applicable; browser opt-out does not configure your backend code by itself.

Receipt needs its own check. PostHog's application programming interface (API) can return a successful Hypertext Transfer Protocol (HTTP) 200 response while the project is over its billing quota. Inspect the response body's quota_limited field as well as the status. API overview.

That makes “the endpoint returned 200” an incomplete ingestion test. Monitor the destination, ingestion warnings and billing state alongside application delivery logs. Our PostHog pricing guide explains why limits are operational decisions as well as spending controls.

What should an end-to-end acceptance journey prove?

Verify application outcomes, event counts, identity and privacy through the same known journey. For a software-as-a-service (SaaS) product, the full product analytics setup connects these checks to the broader release.

Consider a synthetic report-export journey in a test environment. The tester opens a workspace, navigates to a report, attempts an export that fails validation, corrects the input and successfully exports once.

The expected outcome is two export attempts, one failure and one success. Automatic clicks may add diagnostic events, but they must not turn the business success count into two.

Expected counts for this fictional journey. The failed and corrected requests create separate jobs; these counts describe the test contract.

What should an end-to-end acceptance journey prove?
Observed business or navigation eventExpected countReason
export_requested2Failed request plus corrected request
export_failed1The first job fails validation
export_succeeded1Only the corrected job completes
Pageviews2Direct workspace load plus one route change

Use a specification such as this for the test runner or manual QA record. It is an original test manifest, not a PostHog API payload:

JSON
{
  "case_id": "export_retry_817",
  "environment": "test",
  "expected_business_events": {
    "export_requested": 2,
    "export_failed": 1,
    "export_succeeded": 1
  },
  "expected_pageviews": 2,
  "required_properties": ["export_job_id", "workspace_id"],
  "expected_workspace_id": "workspace-a",
  "expected_job_events": {
    "failed-job": ["export_requested", "export_failed"],
    "successful-job": ["export_requested", "export_succeeded"]
  },
  "forbidden_probe_values": [
    "QA_INPUT_ONLY_817",
    "QA_HEADING_ONLY_817",
    "QA_QUERY_ONLY_817",
    "QA_PROPERTY_ONLY_817"
  ]
}

The pageview count assumes one direct workspace load and one route change to the report, with no other navigation. Adjust it when the journey changes. This fixture assumes both jobs exist before their outcome events. The two test jobs, failed-job and successful-job, belong to workspace-a.

Each job’s list requires one occurrence of each named business event, regardless of delivery order. Check those relationships as well as the global totals: one success attached to the failed job or another workspace can leave the overall counts looking correct.

Save the application outcome, outbound event sample, received business events and replay review together. A defect should then have a location: application state, capture, identity, transmission, ingestion or interpretation.

Use one known journey to locate the failing boundary: application outcome, capture, identity, privacy or replay. A leaked probe requires pausing the affected capture path; a successful HTTP response still needs destination evidence.

How the workflow fits together
Run the known PostHog journey, reconcile application outcomes and captured counts, and repair incorrect event ownership. Verify identity and excluded synthetic probes, pause leaking capture, then test replay eligibility and actual ingestion before retaining release evidence.
Read diagram as text
  • Run the known journey and record application outcomes to Business events and logical pageviews match?.
  • Business events and logical pageviews match? to Repair event ownership triggers or retry handling: No.
  • Repair event ownership triggers or retry handling to Run the known journey and record application outcomes.
  • Business events and logical pageviews match? to Test identity transitions and synthetic privacy probes: Yes.
  • Test identity transitions and synthetic privacy probes to Identities remain correct and excluded probes stay absent?.
  • Identities remain correct and excluded probes stay absent? to Pause affected capture and repair the failing rule: No.
  • Pause affected capture and repair the failing rule to Test identity transitions and synthetic privacy probes.
  • Identities remain correct and excluded probes stay absent? to Inspect replay eligibility playback and destination receipt: Yes.
  • Inspect replay eligibility playback and destination receipt to Recording rules and actual ingestion pass?.
  • Recording rules and actual ingestion pass? to Repair recording delivery or quota configuration: No.
  • Repair recording delivery or quota configuration to Inspect replay eligibility playback and destination receipt.
  • Recording rules and actual ingestion pass? to Save acceptance evidence with the configuration version: Yes
Open full diagram

Before release:

Checklist

  • One owner captures each logical pageview and each business outcome.
  • Failed operations do not produce success events.
  • Anonymous, login and logout transitions preserve the intended identities.
  • Synthetic privacy probes stay out of every excluded capture surface.
  • Recording triggers are tested after leaving the matching page.
  • Permission changes and return visits match the intended collection policy.
  • Destination receipt is checked beyond a successful HTTP response.

Run the same journey after authentication, routing, replay or SDK changes. A small repeatable specification gives the team a stronger foundation than repeatedly eyeballing a dashboard after every release.

Want a second pair of eyes on your stack? Get the $99 martech audit or request a detailed product-analytics implementation scope with the failing journey, identity transitions and capture surfaces to verify.

Keep reading

Browse all Product Analytics guides

Questions people ask

What should we pause when a synthetic privacy probe escapes?

Pause the affected capture path and verify that the excluded marker no longer leaves it. If the leak cannot be isolated, widen the temporary hold while its owner investigates. Preserve redacted evidence, fix the producer or collection rule, then repeat the same synthetic journey across the exposed surfaces. Resume after both exclusion and useful safe capture pass under the recorded configuration.

How should a long-running export be measured after the browser closes?

Keep the backend job's completion independent of whether the browser remains open. Preserve its job ID, requesting actor, workspace and original request time, then emit the authoritative outcome when processing ends. Reconcile that outcome to the request even when it arrives in a later reporting period. A closed tab should not turn a completed job into a missing success or create a second completion when the customer returns.

How can translated interfaces keep the same event meaning?

Define business events around stable product actions instead of the translated label on a button. Keep locale as context when it helps analysis, and test the same journey in each supported language. Review selectors and attribute mappings that depend on displayed text so a translation cannot silently change collection. A label can change while the event's business meaning and expected outcome remain the same.

How should two teams test tracking changes in the same project?

Give each test run a distinct reference and agree who can change shared project settings during the test window. Capture the effective configuration before and after each change, and keep the acceptance events separate from ordinary product reporting. When changes interact, reproduce them together before release. Passing two isolated tests does not establish that their combined routing, identity or privacy settings still behave correctly.

What if validation fails before an export job exists?

Keep a stable request or interaction reference and record the rejection at that level. Do not fabricate a job ID to satisfy the analytics schema when the application never created a job. Use a separate event contract for pre-job failures. The worked journey here assumes both jobs exist before their outcome events; adjust the fixture when your application’s lifecycle differs.

Sources

  1. PostHog: JavaScript configuration.
  2. PostHog: Autocapture.
  3. PostHog: Identifying users.
  4. PostHog: Anonymous versus identified events.
  5. PostHog: Replay privacy controls.
  6. PostHog: Control which sessions are recorded.
  7. PostHog: Data collection controls.
  8. PostHog: API overview.
Portrait of Jafrin Akter Alo

Written by

Jafrin Akter Alo

Data Engineer and Co-founder at Martechdevs and Growth and Analytics Partners

Jafrin writes practical guides to marketing technology, customer data, analytics and AI workflows. Martechdevs is a Growth and Analytics Partners company.

View LinkedIn profile

Book a Free Call

Thirty minutes on your stack and what it needs. Free, and no pitch.

Thirty minutes, and you leave with a plan

We look at what you have, what it is costing you and what to do about it first.

  • 30 minutes
  • Video call, link on booking
  • No obligation

What we'll cover

  • Your current stack and where it hurts
  • Quick wins we can ship first
  • An integration roadmap
  • Timeline, scope and next steps

Calendar not loading? Open it in a new tab or email hello@martechdevs.com.