exploring-autocapture-events
यह क्या करती है
यह स्किल आपकी वेबसाइट से PostHog द्वारा दर्ज होने वाले ऑटोमैटिक क्लिक, फ़ॉर्म और पेज बदलाव के इवेंट की जाँच करती है। यह उन एनालिस्ट और प्रोडक्ट टीमों के लिए है जो जानना चाहती हैं कि उपयोगकर्ता किस पर क्लिक करते हैं, और उन क्लिक से एक्शन बनाना चाहती हैं।
कब इस्तेमाल करें
- ✓जब आप जानना चाहें कि उपयोगकर्ता आपकी वेबसाइट पर किस चीज़ पर क्लिक करते हैं।
- ✓जब आपको एक्शन बनाने के लिए किसी बटन या लिंक का भरोसेमंद CSS सेलेक्टर चाहिए।
- ✓जब आप बिना कोड लिखे किसी क्लिक से एक्शन बनाना चाहें।
Skill का लिंक
https://github.com/PostHog/posthog/blob/master/products/product_analytics/skills/exploring-autocapture-events/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“हमारे प्राइसिंग पेज पर उपयोगकर्ता किस चीज़ पर क्लिक करते हैं, और साइनअप बटन के लिए भरोसेमंद सेलेक्टर कैसे बनाऊँ?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
यह हर इवेंट के साथ दर्ज क्लिक किए गए एलिमेंट पढ़ती है, जाँचती है कि कोई सेलेक्टर केवल एक एलिमेंट से मेल खाता है या नहीं, और मेल खाने वाले क्लिक पर क्वेरी चलाती है। फिर यह एक्शन बनाने में मदद कर सकती है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Exploring autocapture events
if users opt in then posthog-js automatically captures clicks, form submissions, and page changes as $autocapture events.
Each event records the clicked DOM element and its ancestors in the elements_chain column.
$autocapture is intentionally excluded from the posthog:read-data-schema taxonomy
because it is only useful with autocapture-specific filters (selector, tag, text, href).
This skill fills that gap.
Materialized columns
The events table provides fast access to common element fields without parsing the full chain string.
| Column | Type | Description |
|---|---|---|
elements_chain |
String | Full semicolon-separated element chain (see format reference) |
elements_chain_href |
String | Last href value from the chain |
elements_chain_texts |
Array(String) | All text values from elements |
elements_chain_ids |
Array(String) | All id attribute values |
elements_chain_elements |
Array(String) | Useful tag names: a, button, input, select, textarea, label |
Use materialized columns for exploration queries whenever possible — they avoid regex parsing.
Canonical autocapture properties
Every $autocapture event from posthog-js ships with a fixed set of properties.
Do not query the schema to "look them up" — they are these:
| Property | Examples | Notes |
|---|---|---|
$event_type |
click, submit, change |
the kind of interaction |
$el_text |
Sign up, Submit |
text of the clicked element |
$current_url |
https://app.example.com/pricing |
page the interaction happened on |
$elements_chain |
semicolon-separated chain | parsed via the elements_chain* materialized columns above |
Standard event properties ($browser, $os, $device_type, etc.) are also present.
Workflow
1. Confirm autocapture data exists
Run a count query before doing anything else. If the count is zero, autocapture may be disabled. There are two ways this happens:
- Project settings — the team can set
autocapture_opt_outin PostHog project settings - SDK config — the posthog-js
init()call can passautocapture: false
Tell the user if no data is found so they can check both settings.
SELECT count() as cnt
FROM events
WHERE event = '$autocapture'
AND timestamp > now() - INTERVAL 7 DAY
2. Explore what users are interacting with
Start broad using the materialized columns. The goal is to understand what users are clicking before narrowing down.
Useful explorations:
- Top clicked tag names (via
elements_chain_elements) - Top clicked text values (via
elements_chain_texts) - Top clicked hrefs (via
elements_chain_href) - Raw
elements_chainvalues for a specific page (filtered byproperties.$current_url)
See example queries for all patterns.
3. Find candidate selectors
Once the user identifies an interaction they care about, find a CSS selector that identifies it.
Priority order for selector attributes (best first):
data-attror otherdata-*attributes — highest specificity, stable across deploys, developer-intended anchors. Search withmatch(elements_chain, 'data-attr=')orextractAll.- Element ID (
attr_id) — also highly stable, queryable viaelements_chain_ids. - Tag + class combination — moderately stable but classes change with CSS refactors.
- Text content — fragile (changes with copy edits, i18n) but sometimes the only option.
- Tag name alone — too broad on its own, useful as a qualifier.
When a
अक्सर पूछे जाने वाले सवाल
ऑटोकैप्चर क्या रिकॉर्ड करता है?
जब वेबसाइट पर यह चालू हो, तो यह क्लिक, फ़ॉर्म सबमिशन और पेज बदलाव को ऑटोकैप्चर इवेंट के रूप में दर्ज करता है।
elements chain क्या है?
यह क्लिक किए गए एलिमेंट और उसके पैरेंट का रिकॉर्ड है, जिसे स्किल सेलेक्टर खोजने के लिए पढ़ती है।
स्किल सेलेक्टर की यूनिकनेस क्यों जाँचती है?
जो सेलेक्टर बहुत सारे एलिमेंट से मेल खाए, वह ऐसे क्लिक भी गिन लेगा जिन्हें आप ट्रैक नहीं करना चाहते, इसलिए स्किल पहले हर सेलेक्टर जाँचती है।
जानकारी
लेखक का मूल विवरण
Guides exploration of $autocapture events captured by posthog-js to understand user interactions, find CSS selectors (especially data-attr attributes), evaluate selector uniqueness, query matching clicks ad-hoc, and create actions. Use when the user asks about autocapture data, wants to find what users are clicking, needs to build actions from click events, asks about elements_chain, wants to build a trend or funnel filtered by clicks or other autocapture interactions, asks which properties autocapture sends, or asks how to filter $autocapture events. Only applies to projects using posthog-js
repo: PostHog/posthog
लोकप्रियता
- GitHub स्टार
- 41k
- रैंकिंग में स्थान
- #6902
- लाइसेंस
- —
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
depot-ci
41kयह आपके एजेंट को Depot CI वर्कफ़्लो सेट अप करने, चलाने और माइग्रेट करने में मदद करती है, साथ ही रन के लॉग पढ़ने में।
depot-container-builds
41kयह आपके एजेंट को Depot के रिमोट बिल्डर पर Docker इमेज बनाने में मदद करती है, जिसमें मल्टी-प्लेटफ़ॉर्म इमेज और बिल्ड सुधार शामिल हैं।
depot-github-runners
41kयह आपके एजेंट को GitHub Actions जॉब Depot के मैनेज्ड रनर पर ले जाने, रनर का साइज़ और लेबल चुनने, और रनर सेटअप की समस्याएँ ठीक करने में मदद करती है।
editing-agents-md
41kयह आपके एजेंट को तय करने में मदद करती है कि कोई नियम AGENTS.md या CLAUDE.md में जाए या नहीं, और उसे ऐसे लिखे कि फ़ाइल भारी न हो।
मिलती-जुलती skills
gitcrawl
394kयह आपके एजेंट को GitHub issues और pull requests के सेव आर्काइव में खोजने, मिलते-जुलते मामलों को समूह में रखने और लाइव स्थिति जांचने देती है।
slacrawl
394kयह आपके एजेंट को स्थानीय Slack आर्काइव में संदेश खोजने और गिनने, उसकी ताज़गी जांचने और ज़रूरत पड़ने पर उसे ताज़ा करने देती है।
goplaces
394kयह आपके एजेंट को Google Places से जगहें खोजने, उनका विवरण और समीक्षाएं पाने, और जगह के नाम हल करने में मदद करती है, स्क्रिप्ट के लिए JSON आउटपुट के साथ।