# Ask an Agent about your PostHog analytics

> Add the PostHog Agent, sign it in to PostHog, and ask it about users, events, funnels and errors, to build insights and dashboards, or to change feature flags.

Source: https://air.build/docs/connect/read-posthog-analytics-with-an-agent/

The PostHog Agent is a specialist for PostHog. Its name is simply PostHog. It signs in to PostHog with a Connection of its own, then answers questions from your data and works in your PostHog when you ask. In the **New Agent** sheet it's listed as "like a PostHog Analyst", with the line "Runs your PostHog: product analytics, errors and feature flags."

Its bio, shown on its profile: "The Team's PostHog: answers questions about users, events, funnels and errors, builds insights and dashboards, and changes feature flags. Deletes and changes that reach live users wait for a person's yes."

## Add the PostHog Agent and sign it in

1. Tap **+** (on the Mac, click it) and choose **New Agent**. Under **Specialists**, tap **Add** on **PostHog**'s row. It joins your Team as **@posthog**.
2. Open your chat with the PostHog Agent. It has posted a card asking you to sign in. Tap **Connect PostHog**.
3. An AirBuild page opens first, titled "Connect PostHog to this Agent?". Check that the **Agent** and **Workspace** are yours, then tap **Continue to PostHog**.
4. If PostHog asks where your account is, choose US Cloud or EU Cloud: the one your PostHog account is on.
5. Sign in to PostHog and allow access.

When it's done, the card shows **Connected**. Where the sign-in opens on each device is in [Connect an Agent to outside services](https://air.build/docs/agents/connect-outside-services/#sign-in-from-a-card). If your Team already has an Agent with the ID posthog, see [Add an Agent to your Team](https://air.build/docs/team/add-an-agent/#when-the-id-is-taken).

> [!WARNING]
> The PostHog Agent works in the PostHog account of whoever signs in, for everyone in the Team: anyone can ask it about that account's data and have it make changes there. Sign in with an account you're happy for the Team's Agent to use.

## Ask the PostHog Agent for something

Mention **@posthog** in a chat it's in, or write in your own chat with it. See [Work with your Agents in chat](https://air.build/docs/projects/work-with-agents-in-chat/#mention-an-agent). If your PostHog has more than one project, say which one.

Things to ask, going by its bio:

- "@posthog, how many people signed up last week, and how many came back?"
- "@posthog, where do people drop out of the onboarding funnel?"
- "@posthog, what are the top errors in the iOS app this week?"
- "@posthog, make a dashboard with daily active users and sign-ups."
- "@posthog, turn on the new-paywall flag for 10% of users."

To get the numbers on a regular day and time, give the Agent a Schedule. See [Schedule work for an Agent](https://air.build/docs/agents/schedule-agent-work/).

## What waits for your yes

The PostHog Agent's bio says deletes and changes that reach live users wait for a person's yes. When it asks, answer it in the chat.

That's how the Agent works, not a setting on the Connection: the Connection can do what the PostHog account allows.

## Questions

Sign-in errors, **Needs Reauthorization**, **Disconnect** and sign-in links from someone else are covered in [Connect an Agent to outside services](https://air.build/docs/agents/connect-outside-services/).

**I don't see the sign-in card**

It goes to the chat between the PostHog Agent and whoever added it. Anyone in the Team can also open the Agent's profile and tap **Connect** on the **PostHog** row under **Connections**. See [Edit an Agent's profile](https://air.build/docs/agents/edit-an-agent/#open-an-agents-profile).

**It signed in with the wrong PostHog account**

If you're already signed in to PostHog in your browser (on iPhone and iPad, in Safari), PostHog's page may use that account. Sign out of PostHog there, or switch accounts, then on the Agent's profile tap **⋯** on the **PostHog** row and choose **Reconnect**.

**Is this the same as AirTraffic?**

No. The PostHog Agent reads the data your app sends to PostHog. AirTraffic is AirBuild's own app analytics, with its own tab in the Project. See [Measure app usage (AirTraffic)](https://air.build/docs/services/measure-usage/). For crashes and in-app feedback, see [Collect feedback and crashes (AirFeedback)](https://air.build/docs/services/collect-feedback-and-crashes/).
