Back to PostHog in Google Sheets
SheetXAI logo
PostHog logo
PostHog · Google Sheets Guide

Generate PostHog AI Insights From a Google Sheet of Product Questions

2026-05-15
5 min read

The Scenario

A product manager opened a Google Sheet on Thursday with 12 rows in column A — product questions like "what is the 7-day retention for users who complete onboarding?" and "how many users activated the new dashboard feature in the last 30 days?" She wants PostHog AI insights generated for each one automatically and the insight IDs written back so she can link to them from the product review deck. The alternative is clicking through PostHog's AI insight creator 12 times, typing each question manually, waiting for the generation, and copying the short_id by hand.

The bad version:

  • Navigate to PostHog's insights section, click "New insight," select "AI insight," type the first question, wait for generation, copy the insight name and short_id, paste into the spreadsheet — repeat 11 more times
  • Reach question 7 and realize PostHog generated a FunnelsQuery for a question that should have been a RetentionQuery — you accept it, but now your deck links to an insight that doesn't answer the question you asked
  • Finish all 12, check the spreadsheet, discover you accidentally copied the same short_id twice for questions 4 and 5 because you had two PostHog tabs open

Twelve questions, twelve round-trips through the UI. The sheet was the whole plan — the UI was the detour.

The Easy Way: One Prompt in SheetXAI

SheetXAI is an AI agent inside your Google Sheet. It reads the questions from your column, submits each one to PostHog's AI insight endpoint, and writes the returned insight name, ID, and query type back into the sheet.

For each question in column A of the 'Analytics Questions' sheet, create a PostHog AI insight using the question as the query and write the returned insight name and short_id into columns B and C.

What You Get

  • PostHog generates one AI insight per question in column A
  • Columns B and C receive the insight name and short_id for each row
  • The short_id links directly to the generated insight in your PostHog project

What If the Data Is Not Quite Ready

You also want the query type written back

For each question in column A of the 'Analytics Questions' sheet, create a PostHog AI insight and write the insight name, short_id, and generated query type (TrendsQuery, FunnelsQuery, or RetentionQuery) into columns B, C, and D.

You want to skip rows where column A is blank

Read questions from column A of the 'Analytics Questions' sheet. Skip any row where column A is empty. For all other rows, create a PostHog AI insight and write insight name and short_id into columns B and C.

You want to group results by query type in a second tab

Create PostHog AI insights for each question in column A. Write insight name, short_id, and query type into columns B through D. Then create a second tab named 'By Type' that groups the results by query type — one section per type — with each insight's name and short_id listed underneath.

Full batch generation with query type validation and deck-ready output

For each question in column A of this sheet, create a PostHog AI insight. Write insight name, short_id, and query type into columns B through D. In column E, flag any insight where the query type does not seem to match the question intent (e.g. a retention-style question mapped to TrendsQuery). Then create a 'Deck Links' tab with two columns: question text and a PostHog URL constructed from the short_id (format: https://us.posthog.com/insights/[short_id]).

One prompt generates all insights and builds the deck link table.

Try It

Get the 7-day free trial of SheetXAI and open any Google Sheet where you've been drafting product questions, ask it to generate PostHog AI insights for each one, and have short_ids ready to link from your review deck before the meeting. Also see: Export All PostHog Saved Insights Into a Google Sheet and the PostHog hub.

Stop memorizing formulas.
Tell your spreadsheet what to do.

Join 4,000+ professionals saving hours every week with SheetXAI.

Learn more