본문으로 건너뛰기
Skillpedia
분석 및 스프레드시트41k · #6902

exploring-autocapture-events

하는 일

이 스킬은 웹사이트에서 PostHog가 자동으로 기록하는 클릭, 양식, 페이지 변경 이벤트를 살펴봅니다. 사용자가 무엇을 클릭하는지 알고 싶고, 클릭으로 액션을 만들고 싶은 분석가와 제품 팀을 위한 것입니다.

사용하는 경우

  • ✓사용자가 웹사이트에서 무엇을 클릭하는지 알고 싶을 때.
  • ✓액션을 만들기 위해 버튼이나 링크의 안정적인 CSS 선택자가 필요할 때.
  • ✓코드를 쓰지 않고 클릭으로 액션을 만들고 싶을 때.

스킬 링크

https://github.com/PostHog/posthog/blob/master/products/product_analytics/skills/exploring-autocapture-events/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/PostHog/posthog/blob/master/products/product_analytics/skills/exploring-autocapture-events/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“사용자들이 가격 페이지에서 무엇을 클릭하나요? 가입 버튼의 안정적인 선택자는 어떻게 만들 수 있나요?”

매주 새 스킬 5개. 읽는 데 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_out in PostHog project settings
  • SDK config — the posthog-js init() call can pass autocapture: 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_chain values for a specific page (filtered by properties.$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):

  1. data-attr or other data-* attributes — highest specificity, stable across deploys, developer-intended anchors. Search with match(elements_chain, 'data-attr=') or extractAll.
  2. Element ID (attr_id) — also highly stable, queryable via elements_chain_ids.
  3. Tag + class combination — moderately stable but classes change with CSS refactors.
  4. Text content — fragile (changes with copy edits, i18n) but sometimes the only option.
  5. Tag name alone — too broad on its own, useful as a qualifier.

When a

자주 묻는 질문

자동 캡처는 무엇을 기록하나요?

웹사이트에서 켜져 있으면 클릭, 양식 제출, 페이지 변경을 자동 캡처 이벤트로 기록합니다.

요소 체인이란 무엇인가요?

클릭된 요소와 그 상위 요소의 기록이며, 스킬은 이를 읽어 선택자를 찾습니다.

왜 선택자의 고유성을 확인하나요?

많은 요소에 맞는 선택자는 의도하지 않은 클릭까지 추적하게 되므로, 스킬은 각 선택자를 먼저 확인합니다.

상세 정보

작성자의 원본 설명

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
라이선스
—
업데이트
2026. 11. 2.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬