मुख्य सामग्री पर जाएँ
Skillpedia
एनालिसिस और स्प्रेडशीट41k · #6897

querying-posthog-data

यह क्या करती है

यह स्किल बताती है कि PostHog से अपने डेटा के बारे में सवाल कैसे पूछें, ट्रेंड और फ़नल से लेकर लोगों और दूसरे PostHog आइटम तक। यह उन सबके लिए है जिन्हें बिना तरीका अंदाज़े से चुने PostHog से सटीक आँकड़े चाहिए।

कब इस्तेमाल करें

  • ✓जब आपको PostHog से ट्रेंड, फ़नल, रिटेंशन या लाइफ़साइकल के आँकड़े चाहिए।
  • ✓जब आप इनसाइट, डैशबोर्ड, कोहॉर्ट, फ़ीचर फ़्लैग या प्रयोग खोजना या गिनना चाहें।
  • ✓जब आपको कोई कस्टम गणना चाहिए जिसे केवल SQL व्यक्त कर सके।

Skill का लिंक

https://github.com/PostHog/posthog/blob/master/products/posthog_ai/skills/querying-posthog-data/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/PostHog/posthog/blob/master/products/posthog_ai/skills/querying-posthog-data/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“पिछले महीने हर हफ़्ते कितने अलग उपयोगकर्ताओं ने साइनअप किया, और यह पिछले महीने से कैसे तुलना करता है?”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

यह आपके सवाल से मेल खाने वाला टाइप्ड क्वेरी टूल सुझाती है, क्योंकि वे PostHog की मानक परिभाषाएँ फ़ॉलो करते हैं। SQL केवल तब इस्तेमाल होता है जब टाइप्ड टूल वह गणना व्यक्त न कर सकें।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Querying data in PostHog

The guidelines explain SQL syntax and schema discovery. Read them when you choose posthog:execute-sql. You do not need them for typed queries.

Choose the query path

Default to typed query tools for new product-analytics questions and dashboard insights when their schemas support the requested calculation. This includes simple event counts, unique users, property sums, breakdowns, and time series. Choose SQL only when the task needs SQL capabilities or explicitly requests SQL.

For governed measures, follow the semantic-layer workflow below before deriving a query. Reuse a matching approved metric or saved query when it defines the requested measure.

Typed query tools

Use the matching typed query tool for supported product analytics:

  • posthog:query-trends for native trends with series, breakdowns, formulas, and period comparisons.
  • posthog:query-funnel for conversion rates, drop-off, and step completion.
  • posthog:query-retention for users returning over time.
  • posthog:query-stickiness for engagement frequency.
  • posthog:query-paths for navigation flows.
  • posthog:query-lifecycle for new, returning, resurrecting, and dormant users.

Do not approximate these analyses with SQL when the user expects PostHog's standard definitions. Confirm that the selected tool supports the required calculation and output.

SQL queries

Use posthog:execute-sql when:

  • The request searches system.* tables for PostHog entities.
  • The user requests SQL, record inspection, or changes to an existing SQL query.
  • The analysis needs custom joins, CTEs, window functions, or warehouse SQL.
  • You need to inspect records or discover entities before constructing a later typed query. Use those findings to select events, properties, and filters; typed query tools cannot accept SQL result rows as input.

When either method fits

When both methods fit a new event-analytics query, use the typed runner. SQL being familiar, an example being written in SQL, or an earlier discovery call using SQL is not a reason to choose SQL for the final analysis. Use SQL directly when the task needs its capabilities; a failed typed-query attempt is not required.

Keep a valid existing query when it fits the task. Choose the method again when the task changes. For each new dashboard tile, run the matching typed query and save its native query node (such as TrendsQuery or FunnelsQuery) with insight-create; do not wrap an equivalent SQL query in HogQLQuery. Use SQL-backed insights only for tiles that need SQL. Both methods support visualizations, so a chart or table request alone does not justify SQL.

Render query results

Choose the presentation path from the harness's capabilities, independently of the query method. A query tool having a UI resource does not mean every harness displays it, especially when the call runs inside exec.

  • Already displayed: direct tool calls and some exec harnesses render query results inline. When the harness says the interactive view is visible (for example, the response says "The user already sees this result as an interactive view"), summarize the conclusion without rendering the same chart again.
  • Exec returned data without a chart: if the harness exposes the top-level posthog:render-ui tool and the query tool is in its tool_name enum, call it after the query succeeds. Pass the same tool name and validated input (for example, tool_name: "query-trends" with the successful trends input as tool_input). Call render-ui directly, not through exec. The widget fetches its own data; pass query inputs, not result rows or a new SQL query.
  • No supported UI tool: follow the harness's rendering instructions or provide a written summary. Keep the typed query; lack of an inline chart is not a reason to switch to SQL.

Keep a concise written conclusion alongside the visualization.

When to use this skill

Finding a specific PostHog entity

When the user wants to find a specific entity created in PostHog (insights, dashboards, cohorts, feature flags, experiments, surveys, hog flows, data warehouse items, etc.), or when a list/search tool returns too many results to narrow down:

  1. Read the appropriate schema reference under Data Schema to understand the entity's table and columns.
  2. Use posthog:execute-sql to query the system table and find the matching entity (typically returning its ID).
  3. Use the dedicat
अक्सर पूछे जाने वाले सवाल

हमेशा SQL क्यों न इस्तेमाल करें?

टाइप्ड टूल PostHog की मानक परिभाषाएँ फ़ॉलो करते हैं, इसलिए आँकड़े वही होते हैं जो आप प्रोडक्ट में देखते हैं।

क्या यह पहले स्वीकृत मेट्रिक जाँचती है?

हाँ। अगर कोई स्वीकृत मेट्रिक उस माप को पहले से परिभाषित करता है, तो स्किल उसे दोबारा इस्तेमाल करती है।

SQL के नियम कहाँ रखे हैं?

वे एक दिशानिर्देश फ़ाइल में हैं, जिसे SQL की ज़रूरत होने पर पढ़ा जाता है।

जानकारी

लेखक का मूल विवरण

Explains how to query PostHog data, defaulting to typed runners for supported product analytics. Read it before you write HogQL/SQL. Also read it before you call execute-sql against PostHog. Use it to find or aggregate PostHog entities. These entities include insights, dashboards, cohorts, feature flags, experiments, surveys, hog flows, warehouse data, and persons. Use it for trends, funnels, retention, lifecycle, paths, stickiness, web analytics, error tracking, logs, sessions, and LLM traces. Before you calculate a governed business or telemetry measure, check system.information_schema.metri

repo: PostHog/posthog

लोकप्रियता

GitHub स्टार
41k
रैंकिंग में स्थान
#6897
लाइसेंस
—
अपडेट की गई
2/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

depot-ci

41k

यह आपके एजेंट को Depot CI वर्कफ़्लो सेट अप करने, चलाने और माइग्रेट करने में मदद करती है, साथ ही रन के लॉग पढ़ने में।

कोडिंगडिप्लॉय और क्लाउड (DevOps)

depot-container-builds

41k

यह आपके एजेंट को Depot के रिमोट बिल्डर पर Docker इमेज बनाने में मदद करती है, जिसमें मल्टी-प्लेटफ़ॉर्म इमेज और बिल्ड सुधार शामिल हैं।

कोडिंगडिप्लॉय और क्लाउड (DevOps)

depot-github-runners

41k

यह आपके एजेंट को GitHub Actions जॉब Depot के मैनेज्ड रनर पर ले जाने, रनर का साइज़ और लेबल चुनने, और रनर सेटअप की समस्याएँ ठीक करने में मदद करती है।

कोडिंगडिप्लॉय और क्लाउड (DevOps)

editing-agents-md

41k

यह आपके एजेंट को तय करने में मदद करती है कि कोई नियम AGENTS.md या CLAUDE.md में जाए या नहीं, और उसे ऐसे लिखे कि फ़ाइल भारी न हो।

AI और एजेंटएजेंट

मिलती-जुलती skills