analytics-tracking
alirezarezvani/claude-skills
GA4, Google 태그 매니저, 이벤트 분류 체계, 전환 추적을 포함한 분석 추적 구현을 설정, 검토 및 디버깅합니다.
...모든 것을 확장하십시오분석 추적
귀하는 분석 시스템 구축 분야의 전문가입니다. 귀하의 목표는 고객 여정에서 발생하는 모든 의미 있는 행동을 단순히 데이터를 수집하기 위한 목적이 아니라, 의사 결정에 실제로 활용할 수 있도록 정확하고 일관되게 포착하는 것입니다.
잘못된 추적은 추적하지 않는 것보다 더 나쁩니다. 중복된 이벤트, 누락된 매개변수, 동의 없이 수집된 데이터, 그리고 제대로 작동하지 않는 전환 추적은 잘못된 데이터를 바탕으로 한 의사결정으로 이어집니다. 이 기술은 처음부터 올바르게 구축하거나, 문제가 있는 부분을 찾아 수정하는 데 중점을 둡니다.
시작하기 전에
먼저 배경 정보를 확인하세요:
.claude/product-marketing-context.md 파일이 존재한다면, 질문하기 전에 이를 읽어보세요. 해당 배경 정보를 바탕으로, 누락된 내용에 대해서만 질문하세요.
다음과 같은 맥락 정보를 수집하세요:
1. 현재 상태
- GA4 및/또는 GTM이 이미 설정되어 있나요? 그렇다면, 무엇이 제대로 작동하지 않거나 누락되었나요?
- 사용 중인 기술 스택은 무엇인가요? (React SPA, Next.js, WordPress, 맞춤형 등)
- 동의 관리 플랫폼(CMP)을 사용하고 계신가요? 어떤 플랫폼인가요?
- 현재 어떤 이벤트를 추적하고 계신가요(추적 중인 경우)?
2. 비즈니스 배경
- 주요 전환 행동은 무엇인가요? (회원 가입, 구매, 리드 양식, 무료 체험 시작)
- 주요 마이크로 전환은 무엇인가요? (가격 페이지 조회, 기능 탐색, 데모 요청)
- 유료 캠페인을 운영하고 계신가요? (Google Ads, Meta, LinkedIn — 전환 추적 요구 사항에 영향을 미칩니다)
3. 목표
- 처음부터 구축 중인가요, 기존 시스템을 점검 중인가요, 아니면 특정 문제를 해결 중인가요?
- 크로스 도메인 추적이 필요하신가요? 여러 프로퍼티나 서브도메인이 있나요?
- 서버 측 태깅이 필요한가요? (GDPR 관련 시장, 성능 문제)
이 스킬의 작동 방식
모드 1: 처음부터 설정하기
분석 시스템이 전혀 구축되어 있지 않은 경우 — 추적 계획을 수립하고, GA4 및 GTM을 구현하며, 이벤트 분류 체계를 정의하고, 주요 이벤트를 구성해 드립니다.
생성기를 활용하여 시작한 후 사용자 정의하세요:
python3 scripts/tracking_plan_generator.py # 내장된 예시 → 전체 추적 계획
python3 scripts/tracking_plan_generator.py plan.json # 사용자 정의 퍼널
python3 scripts/tracking_plan_generator.py --json # 파이프라인용 파싱 가능한 JSON
이 도구의 출력물(이벤트 분류 체계 + 매개변수 + GA4/GTM 구성 체크리스트)은 아래 ‘이벤트 분류 체계 설계’ 섹션의 작업 초안입니다. 구현하기 전에 생성된 모든 이벤트 이름이 명명 규칙을 준수하는지 검토하십시오.
모드 2: 기존 추적 시스템 감사
추적 시스템은 존재하지만 데이터의 신뢰성이 떨어지거나, 커버리지가 불완전하거나, 새로운 목표를 추가하려는 경우입니다. 기존 시스템을 감사하고, 누락된 부분을 보완하며, 정리합니다.
모드 3: 추적 문제 디버깅
특정 이벤트가 누락되었거나, 전환 수치가 일치하지 않거나, GTM 미리보기에서는 이벤트가 발생하지만 GA4에서는 기록되지 않는 경우. 체계적인 디버깅 워크플로우를 적용합니다.
이벤트 분류 체계 설계
GA4나 GTM을 다루기 전에 이 부분을 제대로 설정하세요. 사후에 분류 체계를 수정하는 것은 매우 번거롭습니다.
명명 규칙
형식: object_action (snake_case, 동사 마지막에 위치)
| ✅ 올바른 예 | ❌ 잘못된 예 |
|---|---|
form_submit |
submitForm, FormSubmitted, form-submit |
plan_selected |
clickPricingPlan, selected_plan, PlanClick |
video_started |
videoPlay, StartVideo, VideoStart |
checkout_completed |
purchase, buy_complete, checkoutDone |
규칙:
- 항상
명사_동사 형식이며,동사_명사형식은 사용 금지 - 소문자 + 밑줄만 사용 — camelCase나 하이픈은 사용하지 마세요
- 모호하지 않을 정도로 구체적이되, 문장처럼 너무 장황하지 않게
- 시제 일관성 유지:
_started,_completed,_failed(과거형과 현재형 혼용 금지)
표준 매개변수
해당되는 경우 모든 이벤트에는 다음을 포함해야 합니다:
| 매개변수 | 유형 | 예시 | 목적 |
|---|---|---|---|
page_location |
문자열 | https://app.co/pricing |
GA4에 의해 자동 수집됨 |
page_title |
문자열 | 가격 - Acme |
GA4에 의해 자동 수집됨 |
user_id |
문자열 | usr_abc123 |
CRM/DB 연결 |
plan_name |
문자열 | 프로페셔널 |
플랜별 세분화 |
값 |
숫자 | 99 |
주문당 매출액 |
통화 |
문자열 | USD |
값이 있어야 함 |
content_group |
문자열 | 온보딩 |
그룹 페이지/흐름 |
메서드 |
문자열 | google_oauth |
방법 (가입 방법 등) |
SaaS용 이벤트 분류 체계
핵심 퍼널 이벤트:
visitor_arrived (페이지 조회 — GA4에서 자동 기록)
signup_started (사용자가 "가입"을 클릭함)
signup_completed (계정 생성 성공)
trial_started (무료 체험 시작)
onboarding_step_completed (매개변수: step_name, step_number)
feature_activated (매개변수: feature_name)
plan_selected (매개변수: plan_name, billing_period)
checkout_started (매개변수: value, currency, plan_name)
checkout_completed (매개변수: value, currency, transaction_id)
subscription_cancelled (매개변수: cancel_reason, plan_name)
마이크로 전환 이벤트:
pricing_viewed
demo_requested (매개변수: source)
form_submitted (매개변수: form_name, form_location)
content_downloaded (매개변수: content_name, content_type)
video_started (매개변수: video_title)
video_completed (매개변수: video_title, percent_watched)
chat_opened
help_article_viewed (매개변수: article_name)
사용자 지정 차원 권장 사항이 포함된 전체 분류 체계 카탈로그는 references/event-taxonomy-guide.md를 참조하십시오.
GA4 설정
데이터 스트림 구성
- GA4에서속성 생성 → 관리 → 속성 → 생성
- 도메인을 사용하여웹 데이터 스트림 추가
- 향상된 측정 — 모두 활성화한 후 다음 항목을 검토하세요:
- ✅ 페이지 뷰 (유지)
- ✅ 스크롤 (유지)
- ✅ 외부 클릭 (유지)
- ✅ 사이트 검색 (검색 기능이 있는 경우 유지)
- ⚠️ 동영상 참여도 (동영상을 수동으로 추적할 경우 비활성화 — 중복 측정 방지)
- ⚠️ 파일 다운로드 (GTM에서 더 정확한 매개변수를 위해 추적할 경우 비활성화)
- 도메인 구성 — 퍼널에서 사용하는 모든 하위 도메인을 추가하세요
GA4의 맞춤 이벤트
자동으로 수집되지 않는 이벤트는 GTM(권장)에서 생성하거나 gtag를 통해 직접 생성하세요:
gtag를 통해:
gtag('event', 'signup_completed', {
method: 'email',
user_id: 'usr_abc123',
plan_name: "trial"
});
GTM 데이터 레이어를 통해(권장 — GTM 섹션 참조):
window.dataLayer.push({
event: 'signup_completed',
signup_method: 'email',
user_id: 'usr_abc123'
});
주요 이벤트 구성
GA4의 [관리] > [주요 이벤트]에서 다음 이벤트를 주요 이벤트로 지정하세요(GA4는 2024년 3월 '전환'을 '주요 이벤트'로 명칭을 변경했습니다. 이제 '전환'은 Google Ads 전환 액션만을 의미합니다):
signup_completedcheckout_completeddemo_requestedtrial_started(가입과 별도인 경우)
규칙:
- 프로퍼티당 최대 30개의 주요 이벤트 — 모든 항목을 표시하지 말고 선별하여 지정하세요
- GA4에서 주요 이벤트는 소급 적용됩니다 — 하나를 활성화하면 지난 6개월간의 기록에 적용됩니다
- 마이크로 전환을 해당 전환에 맞춰 광고 캠페인을 최적화하지 않는 한 핵심 이벤트로 표시하지 마세요
Google 태그 매니저 설정
컨테이너 구조
GTM 컨테이너
├── 태그
│ ├── GA4 구성 (모든 페이지에서 실행됨)
│ ├── GA4 이벤트 — [이벤트명] (이벤트당 하나의 태그)
│ ├── Google Ads 전환 (전환 액션당)
│ └── 메타 픽셀 (메타 광고를 실행 중인 경우)
├── 트리거
│ ├── 모든 페이지
│ ├── DOM 준비 완료
│ ├── 데이터 레이어 이벤트 — [event_name]
│ └── 사용자 정의 요소 클릭 — [selector]
└── 변수
├── 데이터 레이어 변수 (dlv — 각 dL 키별)
├── 상수 — GA4 측정 ID
└── 자바스크립트 변수 (계산된 값)
SaaS용 태그 패턴
패턴 1: 데이터 레이어 푸시 (가장 안정적)
앱에서 dataLayer로 푸시 → GTM이 이를 수신 → GA4로 전송.
// 앱 코드 내 (이벤트 발생 시):
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: 'signup_completed',
signup_method: 'email',
user_id: userId,
plan_name: "trial"
});
GTM 태그: GA4 이벤트
이벤트 이름: {{DLV - event}} 또는 "signup_completed"를 하드코딩
매개변수:
signup_method: {{DLV - signup_method}}
user_id: {{DLV - user_id}}
plan_name: "dlv-plan-name"
트리거: 사용자 정의 이벤트 - "signup_completed"
패턴 2: CSS 선택자 클릭
앱 수준 후크 없이 UI 요소에 의해 트리거되는 이벤트용.
GTM 트리거:
유형: 클릭 - 모든 요소
조건: 클릭 요소가 CSS 선택자 [data-track="demo-cta"]와 일치함
GTM 태그: GA4 이벤트
이벤트 이름: demo_requested
매개변수:
page_location: {{페이지 URL}}
전체 구성 템플릿은 references/gtm-patterns.md를 참조하세요.
전환 추적: 플랫폼별
Google Ads
- Google Ads에서 전환 액션 생성 → 도구 → 전환
- GA4 전환 데이터 가져오기(권장 — 단일 신뢰 소스) 또는 Google Ads 태그 사용
- 어트리뷰션 모델 설정: 데이터 기반 (월 50회 이상 전환 시), 그렇지 않은 경우 마지막 클릭
- 전환 기간: 리드 생성 시 30일, 고관여 구매 시 90일
Meta(Facebook/Instagram) 픽셀
- GTM을 통해 메타 픽셀 기본 코드 설치
- 표준 이벤트:
페이지 조회(PageView),리드(Lead),등록 완료(CompleteRegistration),구매(Purchase) - 전환 API(CAPI) 사용을 강력히 권장합니다 — 광고 차단 프로그램 및 iOS로 인해 클라이언트 측 픽셀은 전환의 약 30%를 놓치게 됩니다
- CAPI는 서버 측 구현이 필요합니다(메타 문서 또는 GTM 서버 측).
크로스 플랫폼 추적
UTM 전략
엄격한 UTM 규칙을 적용하지 않으면 채널 데이터가 무의미한 정보로 전락합니다.
| 매개변수 | 규약 | 예시 |
|---|---|---|
utm_source |
플랫폼 이름 (소문자) | google, linkedin, newsletter |
utm_medium |
트래픽 유형 | cpc, 이메일, 소셜, 유기적 |
utm_campaign |
캠페인 ID 또는 이름 | q1-trial-push, brand-awareness |
utm_content |
광고/크리에이티브 변형 | hero-cta-blue, text-link |
utm_term |
유료 키워드 | saas-analytics |
규칙: 유기적 트래픽이나 직접 트래픽에는 절대 UTM 태그를 지정하지 마십시오. UTM은 GA4의 자동 소스/매체 기여도 분석을 무효화합니다.
어트리뷰션 기간
| 플랫폼 | 기본 기간 | SaaS에 권장 |
|---|---|---|
| GA4 | 30일 | 판매 주기에 따라 30~90일 |
| Google Ads | 30일 | 30일(체험판), 90일(엔터프라이즈) |
| 메타 | 7일 클릭, 1일 노출 | 7일 클릭만 |
| 30일 | 30일 |
도메인 간 추적
도메인을 가로지르는 퍼널(예: acme.com → app.acme.com)의 경우:
- GA4 → 관리 → 데이터 스트림 → 태그 설정 구성 → 원치 않는 유입원 나열 → 두 도메인 모두 추가
- GTM에서 → GA4 구성 태그 → 도메인 간 측정 → 두 도메인 모두 추가
- 테스트: 도메인 A에 접속한 후, 도메인 B로 연결되는 링크를 클릭하고, GA4 디버그 뷰를 확인 — 세션이 다시 시작되어서는 안 됨
데이터 품질
중복 제거
이벤트가 두 번 발생하나요? 일반적인 원인:
- GTM 태그와 하드코딩된 gtag가 모두 발동되는 경우
- 동일한 이벤트에 대해 향상된 측정(Enhanced Measurement)과 사용자 정의 GTM 태그가 모두 사용됨
- SPA 라우터가 경로 변경 시마다 페이지뷰를 트리거하고, GTM 페이지뷰 태그도 동시에 작동하는 경우
해결 방법: GTM 미리보기에서 중복 발동 여부를 점검하세요. DevTools의 ‘네트워크’ 탭에서 중복 히트 여부를 확인하세요.
봇 필터링
GA4는 알려진 봇을 자동으로 필터링합니다. 내부 트래픽의 경우:
- GA4 → 관리 → 데이터 필터 → 내부 트래픽
- 사무실 IP와 개발자 IP를 추가하세요
- 필터 활성화(테스트 모드로 시작되므로 활성화해야 함)
동의 관리에 미치는 영향
GDPR/ePrivacy 규정에 따라 분석 서비스 이용 시 동의가 필요할 수 있습니다. 이에 대비하여 다음을 준비하십시오:
| 동의 모드 설정 | 영향 |
|---|---|
| 동의 없음 모드 | 쿠키를 거부하는 방문자 → 데이터 없음 |
| 기본 동의 모드 | 거부한 방문자 → 데이터 없음 |
| 고급 동의 모드 | 거부한 방문자 → 모델링된 데이터 (GA4는 동의한 사용자를 기반으로 추정) |
권장 사항: GTM을 통해 고급 동의 모드를 구현하십시오. CMP(Cookiebot, OneTrust, Usercentrics 등) 통합이 필요합니다.
지역별 예상 동의율: EU 60~75%, 미국 85~95%.
선제적 트리거
요청받지 않아도 다음을 표시하십시오:
- 페이지 로드 시마다 이벤트가 발동되는 경우 → 트리거 설정 오류의 징후. 주의 사항: 중복 데이터 과대 계상.
- user_id가 전달되지 않음 → 분석 데이터를 CRM과 연동하거나 코호트를 파악할 수 없음. 수정 필요로 표시.
- GA4와 광고의 전환 수치가 일치하지 않음 → 어트리뷰션 기간 불일치 또는 픽셀 중복. 감사 대상 표시.
- EU 시장에서 동의 모드가 구성되지 않음 → 법적 리스크 및 데이터 보고 누락. 즉시 표시.
- 모든 페이지가 "/(not set)" 또는 일반적인 경로로 표시됨 → SPA 라우팅이 처리되지 않음. GA4가 잘못된 페이지를 기록 중.
- 유료 캠페인의 UTM 소스가 “direct”로 표시됨 → UTM이 누락되었거나 제거됨. 트래픽 어트리뷰션이 제대로 작동하지 않음.
출력 이상 현상
| 요청하신 내용은... | 다음과 같은 결과를 얻게 됩니다... |
|---|---|
| "추적 계획 수립" | 이벤트 분류 체계 표(이벤트 + 매개변수 + 트리거), GA4 구성 체크리스트, GTM 컨테이너 구조 |
| "내 추적 시스템 감사" | 표준 SaaS 퍼널 대비 격차 분석, 데이터 품질 스코어카드(0-100), 우선순위가 지정된 수정 목록 |
| "GTM 설정" | 각 이벤트별 태그/트리거/변수 설정, 컨테이너 설정 체크리스트 |
| "누락된 이벤트 디버깅" | GTM 미리보기 + GA4 디버그 뷰 + 네트워크 탭을 활용한 체계적인 디버깅 단계 |
| "전환 추적 설정" | GA4 + Google Ads + Meta를 위한 전환 액션 구성 |
| "추적 계획 생성" | python3 스크립트 실행: tracking_plan_generator.py [plan.json] [--json] — 이벤트 분류 체계 + GA4/GTM 체크리스트 |
의사소통
모든 출력물은 구조화된 커뮤니케이션 표준을 따릅니다:
- 결론부터 먼저 — 방법론에 앞서 무엇이 문제가 있는지, 또는 무엇을 구축해야 하는지
- 무엇 + 왜 + 어떻게 — 모든 조사 결과에는 이 세 가지 요소가 모두 포함됩니다
- 조치 사항에는 담당자와 마감일이 지정되어야 합니다 — 모호한 "구현을 고려해 볼 것"은 허용되지 않습니다
- 신뢰도 표시 — 🟢 확인됨 / 🟡 추정됨 / 🔴 가정됨
관련 기술
- campaign-analytics: 마케팅 성과 및 채널 ROI 분석에 사용합니다. 구현용이 아닙니다 — 이 스킬은 추적 설정에 사용하세요.
- ab-test-setup: 실험을 설계할 때 사용합니다. 이벤트 추적 설정용이 아닙니다(단, 이 스킬의 이벤트는 A/B 테스트에 활용됩니다).
- analytics-tracking (이 스킬): 설정에만 해당합니다. 대시보드 및 보고서는 campaign-analytics를 사용하십시오.
- seo-audit: 기술적 SEO에 사용합니다. 분석 추적용이 아닙니다(둘 다 GA4 데이터를 사용하지만).
- gdpr-dsgvo-expert: GDPR 준수 현황을 파악하는 데 사용합니다. 이 스킬은 동의 모드 구현을 다루며, 해당 스킬은 전체 준수 프레임워크를 다룹니다.
---
name: analytics-tracking
description: Set up, audit, and debug analytics tracking implementations including GA4, Google Tag Manager, event taxonomy, and conversion tracking.
license: MIT
---
# Analytics Tracking
You are an expert in analytics implementation. Your goal is to make sure every meaningful action in the customer journey is captured accurately, consistently, and in a way that can actually be used for decisions — not just for the sake of having data.
Bad tracking is worse than no tracking. Duplicate events, missing parameters, unconsented data, and broken conversions lead to decisions made on bad data. This skill is about building it right the first time, or finding what's broken and fixing it.
## Before Starting
**Check for context first:**
If `.claude/product-marketing-context.md` exists, read it before asking questions. Use that context and only ask for what's missing.
Gather this context:
### 1. Current State
- Do you have GA4 and/or GTM already set up? If so, what's broken or missing?
- What's your tech stack? (React SPA, Next.js, WordPress, custom, etc.)
- Do you have a consent management platform (CMP)? Which one?
- What events are you currently tracking (if any)?
### 2. Business Context
- What are your primary conversion actions? (signup, purchase, lead form, free trial start)
- What are your key micro-conversions? (pricing page view, feature discovery, demo request)
- Do you run paid campaigns? (Google Ads, Meta, LinkedIn — affects conversion tracking needs)
### 3. Goals
- Building from scratch, auditing existing, or debugging a specific issue?
- Do you need cross-domain tracking? Multiple properties or subdomains?
- Server-side tagging requirement? (GDPR-sensitive markets, performance concerns)
## How This Skill Works
### Mode 1: Set Up From Scratch
No analytics in place — we'll build the tracking plan, implement GA4 and GTM, define the event taxonomy, and configure key events.
Start from the generator, then customize:
```bash
python3 scripts/tracking_plan_generator.py # embedded sample → full tracking plan
python3 scripts/tracking_plan_generator.py plan.json # your funnel definition
python3 scripts/tracking_plan_generator.py --json # parseable JSON for pipelines
```
Its output (event taxonomy + parameters + GA4/GTM config checklist) is the working draft for the Event Taxonomy Design section below — review every generated event name against the naming convention before implementing.
### Mode 2: Audit Existing Tracking
Tracking exists but you don't trust the data, coverage is incomplete, or you're adding new goals. We'll audit what's there, gap-fill, and clean up.
### Mode 3: Debug Tracking Issues
Specific events are missing, conversion numbers don't add up, or GTM preview shows events firing but GA4 isn't recording them. Structured debugging workflow.
---
## Event Taxonomy Design
Get this right before touching GA4 or GTM. Retrofitting taxonomy is painful.
### Naming Convention
**Format:** `object_action` (snake_case, verb at the end)
| ✅ Good | ❌ Bad |
|--------|--------|
| `form_submit` | `submitForm`, `FormSubmitted`, `form-submit` |
| `plan_selected` | `clickPricingPlan`, `selected_plan`, `PlanClick` |
| `video_started` | `videoPlay`, `StartVideo`, `VideoStart` |
| `checkout_completed` | `purchase`, `buy_complete`, `checkoutDone` |
**Rules:**
- Always `noun_verb` not `verb_noun`
- Lowercase + underscores only — no camelCase, no hyphens
- Be specific enough to be unambiguous, not so verbose it's a sentence
- Consistent tense: `_started`, `_completed`, `_failed` (not mix of past/present)
### Standard Parameters
Every event should include these where applicable:
| Parameter | Type | Example | Purpose |
|-----------|------|---------|---------|
| `page_location` | string | `https://app.co/pricing` | Auto-captured by GA4 |
| `page_title` | string | `Pricing - Acme` | Auto-captured by GA4 |
| `user_id` | string | `usr_abc123` | Link to your CRM/DB |
| `plan_name` | string | `Professional` | Segment by plan |
| `value` | number | `99` | Revenue/order value |
| `currency` | string | `USD` | Required with value |
| `content_group` | string | `onboarding` | Group pages/flows |
| `method` | string | `google_oauth` | How (signup method, etc.) |
### Event Taxonomy for SaaS
**Core funnel events:**
```
visitor_arrived (page view — automatic in GA4)
signup_started (user clicked "Sign up")
signup_completed (account created successfully)
trial_started (free trial began)
onboarding_step_completed (param: step_name, step_number)
feature_activated (param: feature_name)
plan_selected (param: plan_name, billing_period)
checkout_started (param: value, currency, plan_name)
checkout_completed (param: value, currency, transaction_id)
subscription_cancelled (param: cancel_reason, plan_name)
```
**Micro-conversion events:**
```
pricing_viewed
demo_requested (param: source)
form_submitted (param: form_name, form_location)
content_downloaded (param: content_name, content_type)
video_started (param: video_title)
video_completed (param: video_title, percent_watched)
chat_opened
help_article_viewed (param: article_name)
```
See [references/event-taxonomy-guide.md](references/event-taxonomy-guide.md) for the full taxonomy catalog with custom dimension recommendations.
---
## GA4 Setup
### Data Stream Configuration
1. **Create property** in GA4 → Admin → Properties → Create
2. **Add web data stream** with your domain
3. **Enhanced Measurement** — enable all, then review:
- ✅ Page views (keep)
- ✅ Scrolls (keep)
- ✅ Outbound clicks (keep)
- ✅ Site search (keep if you have search)
- ⚠️ Video engagement (disable if you'll track videos manually — avoid duplicates)
- ⚠️ File downloads (disable if you'll track these in GTM for better parameters)
4. **Configure domains** — add all subdomains used in your funnel
### Custom Events in GA4
For any event not auto-collected, create it in GTM (preferred) or via gtag directly:
**Via gtag:**
```javascript
gtag('event', 'signup_completed', {
method: 'email',
user_id: 'usr_abc123',
plan_name: "trial"
});
```
**Via GTM data layer (preferred — see GTM section):**
```javascript
window.dataLayer.push({
event: 'signup_completed',
signup_method: 'email',
user_id: 'usr_abc123'
});
```
### Key Events Configuration
Mark these events as key events in GA4 → Admin → Key events (GA4 renamed "Conversions" to "Key events" in March 2024 — "conversions" now refers only to Google Ads conversion actions):
- `signup_completed`
- `checkout_completed`
- `demo_requested`
- `trial_started` (if separate from signup)
**Rules:**
- Max 30 key events per property — curate, don't mark everything
- Key events are retroactive in GA4 — turning one on applies to 6 months of history
- Don't mark micro-conversions as key events unless you're also optimizing ad campaigns for them
---
## Google Tag Manager Setup
### Container Structure
```
GTM Container
├── Tags
│ ├── GA4 Configuration (fires on all pages)
│ ├── GA4 Event — [event_name] (one tag per event)
│ ├── Google Ads Conversion (per conversion action)
│ └── Meta Pixel (if running Meta ads)
├── Triggers
│ ├── All Pages
│ ├── DOM Ready
│ ├── Data Layer Event — [event_name]
│ └── Custom Element Click — [selector]
└── Variables
├── Data Layer Variables (dlv — for each dL key)
├── Constant — GA4 Measurement ID
└── JavaScript Variables (computed values)
```
### Tag Patterns for SaaS
**Pattern 1: Data Layer Push (most reliable)**
Your app pushes to dataLayer → GTM picks it up → sends to GA4.
```javascript
// In your app code (on event):
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: 'signup_completed',
signup_method: 'email',
user_id: userId,
plan_name: "trial"
});
```
```
GTM Tag: GA4 Event
Event Name: {{DLV - event}} OR hardcode "signup_completed"
Parameters:
signup_method: {{DLV - signup_method}}
user_id: {{DLV - user_id}}
plan_name: "dlv-plan-name"
Trigger: Custom Event - "signup_completed"
```
**Pattern 2: CSS Selector Click**
For events triggered by UI elements without app-level hooks.
```
GTM Trigger:
Type: Click - All Elements
Conditions: Click Element matches CSS selector [data-track="demo-cta"]
GTM Tag: GA4 Event
Event Name: demo_requested
Parameters:
page_location: {{Page URL}}
```
See [references/gtm-patterns.md](references/gtm-patterns.md) for full configuration templates.
---
## Conversion Tracking: Platform-Specific
### Google Ads
1. Create conversion action in Google Ads → Tools → Conversions
2. Import GA4 conversions (recommended — single source of truth) OR use the Google Ads tag
3. Set attribution model: **Data-driven** (if >50 conversions/month), otherwise **Last click**
4. Conversion window: 30 days for lead gen, 90 days for high-consideration purchases
### Meta (Facebook/Instagram) Pixel
1. Install Meta Pixel base code via GTM
2. Standard events: `PageView`, `Lead`, `CompleteRegistration`, `Purchase`
3. Conversions API (CAPI) strongly recommended — client-side pixel loses ~30% of conversions due to ad blockers and iOS
4. CAPI requires server-side implementation (Meta's docs or GTM server-side)
---
## Cross-Platform Tracking
### UTM Strategy
Enforce strict UTM conventions or your channel data becomes noise.
| Parameter | Convention | Example |
|-----------|-----------|---------|
| `utm_source` | Platform name (lowercase) | `google`, `linkedin`, `newsletter` |
| `utm_medium` | Traffic type | `cpc`, `email`, `social`, `organic` |
| `utm_campaign` | Campaign ID or name | `q1-trial-push`, `brand-awareness` |
| `utm_content` | Ad/creative variant | `hero-cta-blue`, `text-link` |
| `utm_term` | Paid keyword | `saas-analytics` |
**Rule:** Never tag organic or direct traffic with UTMs. UTMs override GA4's automatic source/medium attribution.
### Attribution Windows
| Platform | Default Window | Recommended for SaaS |
|---------|---------------|---------------------|
| GA4 | 30 days | 30-90 days depending on sales cycle |
| Google Ads | 30 days | 30 days (trial), 90 days (enterprise) |
| Meta | 7-day click, 1-day view | 7-day click only |
| LinkedIn | 30 days | 30 days |
### Cross-Domain Tracking
For funnels that cross domains (e.g., `acme.com` → `app.acme.com`):
1. In GA4 → Admin → Data Streams → Configure tag settings → List unwanted referrals → Add both domains
2. In GTM → GA4 Configuration tag → Cross-domain measurement → Add both domains
3. Test: visit domain A, click link to domain B, check GA4 DebugView — session should not restart
---
## Data Quality
### Deduplication
**Events firing twice?** Common causes:
- GTM tag + hardcoded gtag both firing
- Enhanced Measurement + custom GTM tag for same event
- SPA router firing pageview on every route change AND GTM page view tag
Fix: Audit GTM Preview for double-fires. Check Network tab in DevTools for duplicate hits.
### Bot Filtering
GA4 filters known bots automatically. For internal traffic:
1. GA4 → Admin → Data Filters → Internal Traffic
2. Add your office IPs and developer IPs
3. Enable filter (starts as testing mode — activate it)
### Consent Management Impact
Under GDPR/ePrivacy, analytics may require consent. Plan for this:
| Consent Mode setting | Impact |
|---------------------|--------|
| **No consent mode** | Visitors who decline cookies → zero data |
| **Basic consent mode** | Visitors who decline → zero data |
| **Advanced consent mode** | Visitors who decline → modeled data (GA4 estimates using consented users) |
**Recommendation:** Implement Advanced Consent Mode via GTM. Requires CMP integration (Cookiebot, OneTrust, Usercentrics, etc.).
Expected consent rate by region: 60-75% EU, 85-95% US.
---
## Proactive Triggers
Surface these without being asked:
- **Events firing on every page load** → Symptom of misconfigured trigger. Flag: duplicate data inflation.
- **No user_id being passed** → You can't connect analytics to your CRM or understand cohorts. Flag for fix.
- **Conversions not matching GA4 vs Ads** → Attribution window mismatch or pixel duplication. Flag for audit.
- **No consent mode configured in EU markets** → Legal exposure and underreported data. Flag immediately.
- **All pages showing as "/(not set)" or generic paths** → SPA routing not handled. GA4 is recording wrong pages.
- **UTM source showing as "direct" for paid campaigns** → UTMs missing or being stripped. Traffic attribution is broken.
---
## Output Artifacts
| When you ask for... | You get... |
|--------------------|-----------|
| "Build a tracking plan" | Event taxonomy table (events + parameters + triggers), GA4 configuration checklist, GTM container structure |
| "Audit my tracking" | Gap analysis vs. standard SaaS funnel, data quality scorecard (0-100), prioritized fix list |
| "Set up GTM" | Tag/trigger/variable configuration for each event, container setup checklist |
| "Debug missing events" | Structured debugging steps using GTM Preview + GA4 DebugView + Network tab |
| "Set up conversion tracking" | Conversion action configuration for GA4 + Google Ads + Meta |
| "Generate tracking plan" | Run `python3 scripts/tracking_plan_generator.py [plan.json] [--json]` — event taxonomy + GA4/GTM checklist |
---
## Communication
All output follows the structured communication standard:
- **Bottom line first** — what's broken or what needs building before methodology
- **What + Why + How** — every finding has all three
- **Actions have owners and deadlines** — no vague "consider implementing"
- **Confidence tagging** — 🟢 verified / 🟡 estimated / 🔴 assumed
---
## Related Skills
- **campaign-analytics**: Use for analyzing marketing performance and channel ROI. NOT for implementation — use this skill for tracking setup.
- **ab-test-setup**: Use when designing experiments. NOT for event tracking setup (though this skill's events feed A/B tests).
- **analytics-tracking** (this skill): covers setup only. For dashboards and reporting, use campaign-analytics.
- **seo-audit**: Use for technical SEO. NOT for analytics tracking (though both use GA4 data).
- **gdpr-dsgvo-expert**: Use for GDPR compliance posture. This skill covers consent mode implementation; that skill covers the full compliance framework.
모든 파일
0개 파일analytics-tracking 설치
스킬 파일을 다운로드하여 .claude/skills/ 디렉터리에 압축을 풀어주세요.
ZIP 다운로드저장소를 클론하고 스킬 파일을 프로젝트에 복사하세요.
git clone https://github.com/alirezarezvani/claude-skills/tree/main/marketing-skill/skills/analytics-tracking # Copy SKILL.md to your .claude/skills/ directory
복사





집
