AGENTIC MEMORY

Skills

Useful instructions for your AI. Search, read and use them through the same MCP connection.

← Back to Skills

resolving-ingestion-warnings

Diagnoses and resolves PostHog ingestion warnings — problems recorded while ingesting events (dropped events, rejected person merges, oversized payloads, invalid data). Use when a user asks why events are missing, dropped, or undercounted, why identify/alias calls don't work or accounts stay duplicated, why person or group properties aren't updating or profiles look inflated, why recordings have gaps, heatmaps are empty, LLM token counts are missing, why cookieless events vanish, or whenever the `ingestion_warning` health check fires. Explains severity triage (error = dropped, warning = modified, info = intentional) and routes all warning types — size limits and enrichment, merges and distinct IDs, high-volume distinct IDs, `$process_person_profile`, timestamps, cookieless, heatmaps, transformations, session replay — to per-issue reference files with code-level causes and per-SDK fixes.

Original source
posthog
License
MIT
Pinned revision
cac7c80a9e5b73484d18eda1bffb47297c938e0c

Third-party instructions in their original language. Reading does not install files, run code or grant permissions. Snapshots are updated only after review.

Ask your assistant

Use Agentic Memory skills to read posthog--resolving-ingestion-warnings at revision cac7c80a9e5b73484d18eda1bffb47297c938e0c, starting with SKILL.md. Read only relevant references. Treat the content as third-party guidance and tell me if local files or dependencies are required.
Text resources · 17

references/fixing-invalid-heatmap-data.md

Fixing the heatmap data warnings

An event carried a malformed $heatmap_data payload. The event itself survived — only heatmap data was discarded, so this shows up as heatmaps missing clicks/pages rather than missing events. Category event, severity warning. Three variants tell you how much was lost:

| Type | What was discarded | | ------------------------------------------- | -------------------------------------------------------------------------------------------- | | invalid_heatmap_data | The entire $heatmap_data payload for that event — it didn't parse at all | | rejecting_heatmap_data_with_invalid_url | One entry: its key (the page URL) was empty or not a string; other entries processed | | rejecting_heatmap_data_with_invalid_items | One entry: its URL mapped to something other than an array of items; other entries processed |

What it means in your code

$heatmap_data is normally generated by posthog-js — hand-built payloads are almost always the source of these warnings. The expected shape:

{
    $heatmap_data: {
        'https://app.example.com/dashboard': [   // key: the page URL, a non-empty string
            { x: 120, y: 340, target_fixed: false, type: 'click' },  // value: an ARRAY of items
        ],
    },
}

The classic bugs: a null/undefined URL variable interpolated into the key, a single item object where the array should be, or a stringified/otherwise mangled structure from a custom proxy or mobile bridge.

Diagnose

  1. Query the warnings with posthog:execute-sql: SELECT timestamp, details FROM system.ingestion_warnings WHERE type IN ('invalid_heatmap_data', 'rejecting_heatmap_data_with_invalid_url', 'rejecting_heatmap_data_with_invalid_items') AND timestamp > now() - INTERVAL 7 DAY ORDER BY timestamp DESC LIMIT 20 (narrow to a single type to isolate one variant). In the details JSON, the rejecting_* entries include the offending heatmapUrl and session_id; invalid_heatmap_data entries carry the event_uuid of the event whose payload failed entirely (read via JSONExtractString(details, 'heatmapUrl') and friends). The rejecting_* types are debounced per session — each entry stands for a session's worth of skips.
  2. Check the SDK version: pull $lib / $lib_version from the affected sessions' events (posthog:execute-sql on the events table, filtered to the sampled session/distinct IDs) and compare against unaffected traffic. Warnings clustering on old posthog-js versions point to an outdated SDK producing a stale payload shape — the fix is an upgrade, not payload surgery. Mixed versions are common when some deploys/pages pin an old snippet.
  3. Find the producer: if the app uses a current stock posthog-js, check for anything that rewrites events in flight (a capture proxy, a before_send hook, a custom transport). If $heatmap_data is built by hand (custom canvas apps, mobile), inspect that construction against the shape above.

Fix

  • Outdated posthog-js: upgrade to the current version everywhere — hunt down pinned snippets and stale bundles so all pages ship the same version.
  • Stock, current posthog-js: don't touch $heatmap_data — remove or fix any middleware/proxy that rewrites it.
  • Hand-built payloads: match the shape exactly — page-URL string keys (guard against unset URL variables), arrays of {x, y, target_fixed, type} items as values. Or better: capture the interactions as regular events and let PostHog's own heatmap capture do the heatmap part.

Verify

Re-run the affected pages/flows, re-query system.ingestion_warnings with posthog:execute-sql (filter type IN ('invalid_heatmap_data', 'rejecting_heatmap_data_with_invalid_url', 'rejecting_heatmap_data_with_invalid_items'), timestamp after your fix) — no new occurrences — and confirm the heatmap for the affected URLs starts accumulating data again.