Analytics & data
PostHog setup guide
Product analytics and feature flags. Agents query events with SQL, run funnels and retention, read saved insights, look up people, annotate charts, and turn feature flags on or off.
Agents read your numbers and run reports.
Ways to connect
Company admins connect apps, on the Integrations page in Everdeck: open PostHog, choose one of the ways below, follow its steps and fill in its fields. Everdeck checks what you enter before it saves anything, and asks you to confirm it’s you (your second factor) before you type any secret. How connecting works.
Personal API key
API key.
- In PostHog, open Settings > Personal API keys (https://us.posthog.com/settings/user-api-keys, or the same page on eu.posthog.com) and click + Create a personal API key.
- Name it "Everdeck", limit it to this project, and select only the scopes listed below. Leave out feature_flag:write if agents must not switch flags.
- Copy the key (it starts with phx_) right away; PostHog shows it only once.
- Copy the project ID from your project settings (https://us.posthog.com/settings/project#variables) and enter your PostHog address.
| Field | What to enter |
|---|---|
| PostHog address: https://us.posthog.com (US Cloud), https://eu.posthog.com (EU Cloud) or your self-hosted URL (optional) | Web address. Starts as https://us.posthog.com. For example https://us.posthog.com. |
| Personal API key | A secret: Everdeck saves it encrypted and never shows it again. Where to find it. |
| Project ID | Text. For example 12345. Where to find it. |
The scopes Everdeck asks for:
query:readinsight:readperson:readevent_definition:readannotation:readannotation:writefeature_flag:readfeature_flag:write
Disconnecting deletes the credentials Everdeck saved, but Everdeck can't revoke them: the key, token or password itself keeps working at PostHog until you delete or rotate it there.
What agents can do
An agent uses an action only when its charter grants it, on the agent’s Tools tab, where you choose whether each one runs by itself (Auto), asks first or never runs. Each action has a risk tier: tier 3 actions, which customers or the public see, ask first unless you choose otherwise, and tier 4 actions (money, deleting things, access) always need a person. How tools and tiers work.
Actions marked Reads outside content return things people outside your company may have written. Agents treat what they read as information, never as instructions, and their riskier actions later in the same session need approval.
-
Query with SQLTier 0 · ReadReads outside content
posthog_run_sqlRun a read-only SQL query (PostHog SQL, also called HogQL) on events, persons, sessions and connected warehouse tables. Example: SELECT event, count() FROM events WHERE timestamp > now() - INTERVAL 7 DAY GROUP BY event ORDER BY count() DESC LIMIT 20. Event properties are properties.$current_url or properties.plan; person properties person.properties.email. Always filter on timestamp and add a LIMIT (100 rows by default, 50,000 at most); OFFSET is refused, so page with WHERE timestamp > the last value seen.
-
Run a funnelTier 0 · ReadReads outside content
posthog_run_funnelHow many people completed each step of an ordered sequence of events within a conversion window, for example sign up, create project, start subscription. Returns per step: count and average and median seconds from the previous step. Conversion rates are count divided by the first or previous step's count.
-
Run retentionTier 0 · ReadReads outside content
posthog_run_retentionHow many people from each starting cohort came back in later periods. Each cohort row has a start date and counts per period; values[0] is the cohort size, so retention is values[n].count / values[0].count.
-
Find saved insightsTier 0 · ReadReads outside content
posthog_list_insightsSearch the project's saved insights (charts) by name, description or tag. Returns IDs, short IDs and names; read one with get_insight.
-
Read an insightTier 0 · ReadReads outside content
posthog_get_insightGet a saved insight's results (trend values, funnel steps, retention table or SQL rows), recalculated if stale. id is the numeric ID or the 8-character short ID from its URL.
-
Find peopleTier 0 · ReadReads outside content
posthog_find_personsLook up people by email, name, person ID or distinct ID (partial matches allowed), with their properties and when they were created and last seen.
-
List event namesTier 0 · ReadReads outside content
posthog_list_event_definitionsThe project's event names with descriptions and when each was last seen, to use in SQL, funnels and retention. Search narrows by name.
-
List annotationsTier 0 · ReadReads outside content
posthog_list_annotationsNotes on the project's charts (releases, campaigns, incidents) with their dates. Use them to explain changes.
-
Annotate a dateTier 2 · ReversibleReads outside content
posthog_create_annotationAdd a note at a point in time to the project's charts, for example "v2.3 released" or "Checkout outage". Everyone in the project sees it.
-
List feature flagsTier 0 · ReadReads outside content
posthog_list_feature_flagsFeature flags with key, name, whether each is on (active), rollout percentages and when it was last evaluated. Search matches key or name.
-
Turn a feature flag on or offTier 3 · ExternalReads outside content
posthog_set_feature_flag_activeEnable or disable a feature flag for everyone it targets. This changes what users see in the product immediately, so use it for kill switches and agreed rollouts.
Testing, problems and disconnecting
Everdeck checks the connection when you save it. On the connection’s page in Integrations, Test checks it again at any time.
If PostHog later refuses the connection, for example because a key was deleted or a sign-in expired, the connection shows Needs attention on the Integrations page and the people who manage connections are told. Agents can’t use it until a company admin fixes it with Edit.
To stop agents using PostHog, open the connection and select Disconnect. Agents stop using it at once and its saved credentials are deleted. What else happens depends on how it was connected: each way above says.
Still stuck?
Email [email protected] and say what you were trying to do. Or browse every guide.