---
name: summarizing-posthog-analytics
description: Summarise PostHog product analytics into a per-metric team pulse. Use for PostHog usage overviews, per-metric summaries, product-analytics digests, or "what happened this week" reporting.
tools:
  - list_posthog_tools
  - call_posthog_tool
title: summarizing-posthog-analytics
canonical_url: https://skilld.dev/gh/tracer-cloud/opensre/summarizing-posthog-analytics
last_updated: 2026-11-20T14:16:11.000Z
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> If the user asked to install this Skill, run `npx skilld install tracer-cloud/opensre/summarizing-posthog-analytics`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/summarizing-posthog-analytics`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/tracer-cloud/opensre/summarizing-posthog-analytics) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/summarizing-posthog-analytics`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/summarizing-posthog-analytics --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/summarizing-posthog-analytics --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# PostHog Summary

PostHog product-analytics reporting for chat delivery. Produce a per-metric
pulse over a window — what moved, why it matters — not a raw dashboard export.
Single source (PostHog MCP); finish here, then optionally suggest a multi-source
follow-up.

Requires the **PostHog MCP** integration (`posthog_mcp`). The REST-only
`posthog` integration cannot serve this skill.

## 1. Discover

`list_posthog_tools` once with `name_filter: "insights dashboard sql events"` to
find the query surface. Then call `read-data-schema` (or the equivalent schema
tool) BEFORE any aggregation query and only reference events and properties it
confirms exist. Do not reference a property (e.g. `properties.$mcp_error`)
without seeing it in the schema first — HogQL rejects queries against unknown
properties. To pull metric data, use `call_posthog_tool` with
`tool_name: "execute-sql"` and **SQL as a top-level string**:

```json
{
  "tool_name": "execute-sql",
  "arguments": { "query": "SELECT count() FROM events WHERE event = '$pageview'" }
}
```

Never nest the SQL (`{"query": {"query": "SELECT …"}}`) — PostHog rejects that
with `parameter "query" must be of type string`. Use insight/dashboard tools
when the user names a specific dashboard.

## 2. Fetch metrics

Map user words to windows:

- **24h** — "today", "overnight", morning report
- **7d** — "this week", default weekly report
- **30d** — "this month", monthly rollup

Run **one small HogQL query per metric** — do NOT combine multiple metrics into a
single aggregated statement, and never cross-join events against synthetic
"window" rows. That combined shape is the most common cause of PostHog's
`unknown error running this query`. Return **only aggregate numbers** (two
columns: current / previous) — never event-level rows. Compute the two windows
with an explicit conditional aggregate over a single time filter, e.g.:

```sql
SELECT
  countIf(timestamp >= now() - INTERVAL 7 DAY) AS current,
  countIf(timestamp >= now() - INTERVAL 14 DAY
          AND timestamp < now() - INTERVAL 7 DAY) AS previous
FROM events
WHERE event = '$pageview'
```

Swap `event = '...'` (or `count(DISTINCT person_id)` for active users) per
metric. If a query still fails, retry that single metric once with a simpler
`SELECT count() ... WHERE timestamp >= now() - INTERVAL 7 DAY`, then report the
metric as failed rather than aborting the whole report.

Default metric set when the user does not name specific metrics (restrict to
events confirmed present in the schema):

- Active users (`count(DISTINCT person_id)`)
- Key events (`$pageview`, sessions, or the project's top custom events)
- New signups / new users **only** when schema confirms a signup event
  (`user_signed_up`, `signed_up`, `signup`, …). Never substitute
  `user_signed_in` / login / `$identify` for signup or for “signed up”
  retention cohorts — if signup is unverified, skip the metric and say so.
- Notable custom events surfaced by the schema

## 3. Compute per-metric deltas

For each metric: current value, previous value, absolute change, percent change,
and direction (up / down / flat). Flag a metric as notable when the percent
change exceeds ~15% in either direction, or when a value hits zero unexpectedly.

## 4. Summarise (team pulse)

Open with **I found:** a one-line scope summary (window + project + metric
count). Then a per-metric table:

Metric | Current | Previous | Change | % | Trend

- Trend: use up / down / flat words, never rely on colour alone.
- After the table, call out the 1-3 most notable movers with a short "why it
  matters" line and one clear next action when the data supports it.
- When a window returns no data, say so explicitly for that metric — never
  silently widen the window or invent numbers.

## Traps

- HogQL time ranges are relative; state the absolute window in the report.
- Distinguish "metric returned zero" (real) from "query failed" (report the
  failure, do not present it as zero).
- `execute-sql` arguments must be `{"query": "<sql string>"}`. Nested
  `{"query": {"query": "…"}}` fails before any data is read — unwrap and retry
  once, then mark the metric failed if it still errors.
- The MCP server exposes 240+ tools; narrow with `name_filter` before calling —
  never dump the full listing.
- One bounded query per metric group; event-level scans are expensive.
- `unknown error running this query` almost always means the statement was too
  complex (multiple metrics combined, cross-joins, or an unverified property).
  Recover by splitting into one simple per-metric query, not by giving up.
