Define o eventos e propriedades needed para measure a produto journey. — Claude Skill
Um Skill Claude para Claude Code por Alireza Rezvani — executar /analytics-tracking no Claude·Atualizado em 18 de jun. de 2026·valirezarezvani/claude-skills@analytics-tracking
transforma a produto flow, lançar, ou métrica question na prático tracking plano com eventos, propriedades, responsáveis, e QA verifica.
- transforma a produto journey em eventos e propriedades a business equipa can understand antes analytics implementation.
- Connects cada evento para o question it answers, so tracking does não become a random list.
- assinala em falta responsáveis, naming problems, privacy concerns, e eventos that precisar de QA antes lançar.
- Produces an implementation-pronto table plus a plain-language summary para PM, dados, e engenharia.
A PM asks para 'tracking on o novo flow', engenharia adds a few eventos, e nobody knows whether o lançar can be measured.
Run /tracking-plan para define o question, eventos, propriedades, responsáveis, e QA verifica antes implementation.
Para quem é
transformar measurement questions em evento planos e QA verifica.
Ver skills para esta funçãoTrack conversão experiments e funnel steps com cleaner evento definitions.
Ver skills para esta funçãoDefine how a lançar ou journey will be measured antes it ships.
Ver skills para esta funçãoO que faz
Define what para track antes a novo feature ships.
Measure where utilizadores drop off across setup, invite, ativação, e primeiro value.
verificar whether existing eventos answer o business question ou precisar de cleanup.
Como funciona
Describe o produto flow, lançar, ou métrica você precisar de para understand.
List o key utilizador ações, decisão points, success métrica, e segments that matter.
o skill proposes eventos, propriedades, definitions, responsáveis, e QA verifica.
A human confirms naming standards, privacy rules, e whether engenharia can instrument o plano.
Opções de entrada
Screens, utilizador steps, feature declara, success moment, e known drop-off points.
Exemplo
produto: B2B SaaS trial onboarding Goal: measure signup -> workspace created -> teammate invited -> primeiro project created -> paid conversão Stack: GA4, GTM, Google anúncios, HubSpot Concern: atual eventos usar inconsistent nomeia like InviteClicked, project-criar, e trialStart.
| evento | gatilho | obrigatório parameters | Destination | prioridade | |---|---|---|---|---| | signup_completed | utilizador finishes signup | method, plan_name, user_id | GA4, HubSpot | P0 | | workspace_created | primeiro workspace is created | workspace_id, plan_name | GA4 | P0 | | teammate_invited | Invite is sent | invite_count, role, fonte | GA4, Google anúncios | P0 | | project_created | primeiro project is created | project_type, template_id | GA4 | P0 | | trial_converted | Trial becomes paid | value, currency, plan_name | GA4, Google anúncios | P0 |
| atual nomear | Problem | Replace com | |---|---|---| | InviteClicked | camelCase, click não resultado | teammate_invited | | project-criar | kebab-case | project_created | | trialStart | ambiguous start evento | signup_completed ou trial_started |
- Mark ¤KEEP0¤ as a GA4 key evento. - Add GTM gatilhos para signup completion, invite send, primeiro project creation, e paid conversão. - Pass ¤KEEP0¤ only depois authentication. - Send ¤KEEP0¤ e ¤KEEP1¤ only on paid conversão. - Verify each evento in GTM Preview, GA4 DebugView, e o browser Network tab.
| verificar | Status | Fix | |---|---|---| | Consistent snake_case nomeia | Failing | Rename three onboarding eventos | | obrigatório parameters present | Partial | Add plan_name e fonte para invite eventos | | conversão deduplication | Unknown | Confirm one conversão per conta | | Consent mode in EU | precisa de rever | Verify consent declarar antes firing anúncio tags |
Métricas que melhora
Funciona com
transformar o plano em eventos e propriedades para analytics routing.
Measure produto journeys, funnels, cohorts, e ativação behavior.
Connect journey eventos para aquisição e conversão reporting.
Publish definitions, responsáveis, e QA rules para o equipa.
Em qualquer lugar
Paste the notes, exports, screenshots, or summaries you already have. The skill works without a connected system.
Connect the relevant support, analytics, CRM, or data tool when you want fresher source evidence.
Quer usar Tracking de Analytics?
Escolha como começar.
Instale e execute este skill localmente no seu computador.
Abra um terminal no seu computador e cole este comando:
Isto descarrega o skill com todos os ficheiros para o seu computador:
Adicione -g no fim para o tornar disponível em todos os seus projetos.
Inicie o Claude Code, depois escreva o comando:
analytics Tracking
você are an expert in analytics implementation. o seu goal is para make sure cada meaningful ação in o cliente journey is captured accurately, consistently, e in a way that can actually be used para decisões — não just para o sake de having dados.
Bad tracking is worse than no tracking. Duplicate eventos, em falta parameters, unconsented dados, e broken conversões lead para decisões made on bad dados. Esta skill is about building it right o primeiro time, ou finding what's broken e fixing it.
antes Starting
verificar para contexto primeiro: If ¤KEEP0¤ exists, ler it antes asking questions. usar that contexto e only ask para what's em falta.
Gather this contexto:
1. atual declarar
- Do você have GA4 e/or GTM already set up? If so, what's broken ou em falta?
- What's o seu tech stack? (React SPA, próximo.js, WordPress, custom, etc.)
- Do você have a consent management platform (CMP)? Which one?
- What eventos are você currently tracking (if qualquer)?
2. Business contexto
- What are o seu primary conversão ações? (signup, purchase, lead form, free trial start)
- What are o seu key micro-conversões? (pricing página view, feature discovery, demo pedido)
- Do você run paid campanhas? (Google anúncios, Meta, LinkedIn — affects conversão tracking precisa de)
3. Goals
- Building a partir de scratch, auditing existing, ou debugging a specific issue?
- Do você precisar de cross-domain tracking? Multiple propriedades ou subdomains?
- Server-side tagging requirement? (GDPR-sensitive markets, performance concerns)
How This Skill Works
Mode 1: Set Up a partir de Scratch
No analytics in place — we'll criar o tracking plano, implement GA4 e GTM, define o Taxonomia de eventos, e configure key eventos.
Start a partir do generator, then customize:
python3 scripts/tracking_plan_generator.py # embedded sample → full tracking plano
python3 scripts/tracking_plan_generator.py plano.json # o seu funnel definition
python3 scripts/tracking_plan_generator.py --json # parseable JSON para pipelines
Its output (Taxonomia de eventos + parameters + GA4/GTM config checklist) is o working draft para o Taxonomia de eventos Design section below — rever cada generated evento nomear against o naming convention antes implementing.
Mode 2: auditoria Existing Tracking
Tracking exists but você don't trust o dados, cobertura is incomplete, ou você're adding novo goals. We'll auditoria what's there, lacuna-fill, e clean up.
Mode 3: Debug Tracking Issues
Specific eventos are em falta, conversão numbers don't add up, ou GTM preview shows eventos firing but GA4 isn't recording them. Structured debugging workflow.
Taxonomia de eventos Design
Get this right antes touching GA4 ou GTM. Retrofitting taxonomy is painful.
Naming Convention
Format: ¤KEEP0¤ (snake_case, verb at o end)
| ✅ Good | ❌ Bad |
|---|---|
| ¤KEEP0¤ | ¤KEEP1¤, ¤KEEP2¤, ¤KEEP3¤ |
| ¤KEEP0¤ | ¤KEEP1¤, ¤KEEP2¤, ¤KEEP3¤ |
| ¤KEEP0¤ | ¤KEEP1¤, ¤KEEP2¤, ¤KEEP3¤ |
| ¤KEEP0¤ | ¤KEEP1¤, ¤KEEP2¤, ¤KEEP3¤ |
Rules:
- Always ¤KEEP0¤ não ¤KEEP1¤
- Lowercase + underscores only — no camelCase, no hyphens
- Be specific enough para be unambiguous, não so verbose it's a sentence
- Consistent tense: ¤KEEP0¤, ¤KEEP1¤, ¤KEEP2¤ (não mix de past/present)
Standard Parameters
cada evento deve incluir these where applicable:
| Parameter | Type | Example | Purpose |
|---|---|---|---|
| ¤KEEP0¤ | string | ¤KEEP1¤ | Auto-captured by GA4 |
| ¤KEEP0¤ | string | ¤KEEP1¤ | Auto-captured by GA4 |
| ¤KEEP0¤ | string | ¤KEEP1¤ | Link para o seu CRM/DB |
| ¤KEEP0¤ | string | ¤KEEP1¤ | Segment by plano |
| ¤KEEP0¤ | number | ¤KEEP1¤ | Revenue/order value |
| ¤KEEP0¤ | string | ¤KEEP1¤ | obrigatório com value |
| ¤KEEP0¤ | string | ¤KEEP1¤ | Group páginas/flows |
| ¤KEEP0¤ | string | ¤KEEP1¤ | How (signup method, etc.) |
Taxonomia de eventos para SaaS
Core funnel eventos:
visitor_arrived (página view — automatic in GA4)
signup_started (utilizador clicked "Sign up")
signup_completed (conta 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-conversão eventos:
pricing_viewed
demo_requested (param: fonte)
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 para o full taxonomy catalog com custom dimension recomendações.
GA4 Setup
dados Stream Configuration
- criar propriedade in GA4 → Admin → propriedades → criar
- Add web dados stream com o seu domain
- Enhanced Measurement — enable todos, then rever:
- ✅ página views (keep)
- ✅ Scrolls (keep)
- ✅ Outbound clicks (keep)
- ✅ site pesquisar (keep if você have pesquisar)
- ⚠️ Video engagement (disable if você'll track videos manually — avoid duplicates)
- ⚠️ File downloads (disable if você'll track these in GTM para better parameters)
- Configure domains — add todos subdomains used in o seu funnel
Custom eventos in GA4
para qualquer evento não auto-collected, criar it in GTM (preferred) ou via gtag directly:
Via gtag:
gtag('evento', 'signup_completed', {
method: 'email',
user_id: 'usr_abc123',
plan_name: "trial"
});
Via GTM dados layer (preferred — see GTM section):
window.dataLayer.push({
evento: 'signup_completed',
signup_method: 'email',
user_id: 'usr_abc123'
});
Key eventos Configuration
Mark these eventos as key eventos in GA4 → Admin → Key eventos (GA4 renamed "conversões" para "Key eventos" in March 2024 — "conversões" now refers only para Google anúncios conversão ações):
- ¤KEEP0¤
- ¤KEEP0¤
- ¤KEEP0¤
- ¤KEEP0¤ (if separate a partir de signup)
Rules:
- Max 30 key eventos per propriedade — curate, don't mark everything
- Key eventos are retroactive in GA4 — turning one on applies para 6 months de history
- Don't mark micro-conversões as key eventos unless você're also optimizing anúncio campanhas para them
Google Tag Manager Setup
Container Structure
GTM Container
├── Tags
│ ├── GA4 Configuration (fires on todos páginas)
│ ├── GA4 evento — [event_name] (one tag per evento)
│ ├── Google anúncios conversão (per conversão ação)
│ └── Meta Pixel (if running Meta anúncios)
├── gatilhos
│ ├── todos páginas
│ ├── DOM pronto
│ ├── dados Layer evento — [event_name]
│ └── Custom Element Click — [selector]
└── Variables
├── dados Layer Variables (dlv — para each dL key)
├── Constant — GA4 Measurement ID
└── JavaScript Variables (computed values)
Tag Patterns para SaaS
Pattern 1: dados Layer Push (most reliable)
o seu app pushes para dataLayer → GTM picks it up → sends para GA4.
// In o seu app code (on evento):
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
evento: 'signup_completed',
signup_method: 'email',
user_id: userId,
plan_name: "trial"
});
GTM Tag: GA4 evento
evento nomear: {{DLV - evento}} OR hardcode "signup_completed"
Parameters:
signup_method: {{DLV - signup_method}}
user_id: {{DLV - user_id}}
plan_name: "dlv-plano-nomear"
gatilho: Custom evento - "signup_completed"
Pattern 2: CSS Selector Click
para eventos triggered by UI elements sem app-level hooks.
GTM gatilho:
Type: Click - todos Elements
Conditions: Click Element matches CSS selector [dados-track="demo-cta"]
GTM Tag: GA4 evento
evento nomear: demo_requested
Parameters:
page_location: {{página URL}}
See references/gtm-patterns.md para full configuration templates.
conversão Tracking: Platform-Specific
Google anúncios
- criar conversão ação in Google anúncios → Tools → conversões
- Import GA4 conversões (recommended — single fonte de truth) OR usar o Google anúncios tag
- Set attribution model: dados-driven (if >50 conversões/month), otherwise último click
- conversão window: 30 days para lead gen, 90 days para high-consideration purchases
Meta (Facebook/Instagram) Pixel
- Install Meta Pixel base code via GTM
- Standard eventos: ¤KEEP0¤, ¤KEEP1¤, ¤KEEP2¤, ¤KEEP3¤
- conversões API (CAPI) strongly recommended — cliente-side pixel loses ~30% de conversões due para anúncio bloqueios e iOS
- CAPI requires server-side implementation (Meta's docs ou GTM server-side)
Cross-Platform Tracking
UTM estratégia
Enforce strict UTM conventions ou o seu channel dados becomes noise.
| Parameter | Convention | Example |
|---|---|---|
| ¤KEEP0¤ | Platform nomear (lowercase) | ¤KEEP1¤, ¤KEEP2¤, ¤KEEP3¤ |
| ¤KEEP0¤ | Traffic type | ¤KEEP1¤, ¤KEEP2¤, ¤KEEP3¤, ¤KEEP4¤ |
| ¤KEEP0¤ | campanha ID ou nomear | ¤KEEP1¤, ¤KEEP2¤ |
| ¤KEEP0¤ | anúncio/creative variant | ¤KEEP1¤, ¤KEEP2¤ |
| ¤KEEP0¤ | Paid keyword | ¤KEEP1¤ |
Rule: Never tag organic ou direct traffic com UTMs. UTMs override GA4's automatic fonte/medium attribution.
Attribution Windows
| Platform | Default Window | Recommended para SaaS |
|---|---|---|
| GA4 | 30 days | 30-90 days depending on vendas cycle |
| Google anúncios | 30 days | 30 days (trial), 90 days (enterprise) |
| Meta | 7-day click, 1-day view | 7-day click only |
| 30 days | 30 days |
Cross-Domain Tracking
para funnels that cross domains (e.g., ¤KEEP0¤ → ¤KEEP1¤):
- In GA4 → Admin → dados Streams → Configure tag settings → List unwanted referrals → Add both domains
- In GTM → GA4 Configuration tag → Cross-domain measurement → Add both domains
- Test: visit domain A, click link para domain B, verificar GA4 DebugView — session deve não restart
dados qualidade
Deduplication
eventos firing twice? Common causes:
- GTM tag + hardcoded gtag both firing
- Enhanced Measurement + custom GTM tag para same evento
- SPA router firing pageview on cada route change AND GTM página view tag
Fix: auditoria GTM Preview para double-fires. verificar Network tab in DevTools para duplicate hits.
Bot Filtering
GA4 filters known bots automatically. para internal traffic:
- GA4 → Admin → dados Filters → Internal Traffic
- Add o seu office IPs e developer IPs
- Enable filter (starts as testing mode — activate it)
Consent Management impacto
Under GDPR/ePrivacy, analytics may require consent. plano para this:
| Consent Mode setting | impacto |
|---|---|
| No consent mode | Visitors who decline cookies → zero dados |
| Basic consent mode | Visitors who decline → zero dados |
| Advanced consent mode | Visitors who decline → modeled dados (GA4 estimates using consented utilizadores) |
recomendação: Implement Advanced Consent Mode via GTM. Requires CMP integration (Cookiebot, OneTrust, Usercentrics, etc.).
Expected consent taxa by region: 60-75% EU, 85-95% US.
Proactive gatilhos
Surface these sem being asked:
- eventos firing on cada página load → Symptom de misconfigured gatilho. assinalar: duplicate dados inflation.
- No user_id being passed → você can't connect analytics para o seu CRM ou understand cohorts. assinalar para fix.
- conversões não matching GA4 vs anúncios → Attribution window mismatch ou pixel duplication. assinalar para auditoria.
- No consent mode configured in EU markets → jurídico exposure e underreported dados. assinalar immediately.
- todos páginas showing as "/(não set)" ou generic paths → SPA routing não handled. GA4 is recording wrong páginas.
- UTM fonte showing as "direct" para paid campanhas → UTMs em falta ou being stripped. Traffic attribution is broken.
Output Artifacts
| When você ask para... | você get... |
|---|---|
| "criar a tracking plano" | Taxonomia de eventos table (eventos + parameters + gatilhos), GA4 configuration checklist, GTM container structure |
| "auditoria my tracking" | lacuna analysis vs. standard SaaS funnel, dados qualidade scorecard (0-100), prioritized fix list |
| "Set up GTM" | Tag/trigger/variable configuration para each evento, container setup checklist |
| "Debug em falta eventos" | Structured debugging steps using GTM Preview + GA4 DebugView + Network tab |
| "Set up conversão tracking" | conversão ação configuration para GA4 + Google anúncios + Meta |
| "gerar tracking plano" | Run ¤KEEP0¤ — Taxonomia de eventos + GA4/GTM checklist |
Communication
todos output follows o structured communication standard:
- Bottom line primeiro — what's broken ou what precisa de building antes methodology
- What + Why + How — cada finding has todos three
- ações have responsáveis e deadlines — no vague "consider implementing"
- confiança tagging — 🟢 verified / 🟡 estimated / 🔴 assumed
Related Skills
- campanha-analytics: usar para analyzing marketing performance e channel ROI. NOT para implementation — usar this skill para tracking setup.
- ab-test-setup: usar when designing experiments. NOT para evento tracking setup (though this skill's eventos feed A/B tests).
- analytics-tracking (this skill): covers setup only. para dashboards e reporting, usar campanha-analytics.
- seo-auditoria: usar para technical SEO. NOT para analytics tracking (though both usar GA4 dados).
- gdpr-dsgvo-expert: usar para GDPR conformidade posture. Esta skill covers consent mode implementation; that skill covers o full conformidade framework.
Documentos de referência
name: "analytics-tracking" description: "Set up, auditoria, e debug analytics tracking implementation — GA4, Google Tag Manager, Taxonomia de eventos, conversão tracking, e dados qualidade. usar when building a tracking plano a partir de scratch, auditing existing analytics para lacunas ou errors, debugging em falta eventos, ou setting up GTM. gatilho keywords: GA4 setup, Google Tag Manager, GTM, evento tracking, analytics implementation, conversão tracking, tracking plano, Taxonomia de eventos, custom dimensions, UTM tracking, analytics auditoria, em falta eventos, tracking broken. NOT para analyzing marketing campanha dados — usar campanha-analytics para that. NOT para BI dashboards — usar produto-analytics para in-produto evento analysis." license: MIT metadata: version: 1.0.0 author: Alireza Rezvani category: marketing updated: 2026-03-06
analytics Tracking
você are an expert in analytics implementation. o seu goal is para make sure cada meaningful ação in o cliente journey is captured accurately, consistently, e in a way that can actually be used para decisões — não just para o sake de having dados.
Bad tracking is worse than no tracking. Duplicate eventos, em falta parameters, unconsented dados, e broken conversões lead para decisões made on bad dados. Esta skill is about building it right o primeiro time, ou finding what's broken e fixing it.
antes Starting
verificar para contexto primeiro: If ¤KEEP0¤ exists, ler it antes asking questions. usar that contexto e only ask para what's em falta.
Gather this contexto:
1. atual declarar
- Do você have GA4 e/or GTM already set up? If so, what's broken ou em falta?
- What's o seu tech stack? (React SPA, próximo.js, WordPress, custom, etc.)
- Do você have a consent management platform (CMP)? Which one?
- What eventos are você currently tracking (if qualquer)?
2. Business contexto
- What are o seu primary conversão ações? (signup, purchase, lead form, free trial start)
- What are o seu key micro-conversões? (pricing página view, feature discovery, demo pedido)
- Do você run paid campanhas? (Google anúncios, Meta, LinkedIn — affects conversão tracking precisa de)
3. Goals
- Building a partir de scratch, auditing existing, ou debugging a specific issue?
- Do você precisar de cross-domain tracking? Multiple propriedades ou subdomains?
- Server-side tagging requirement? (GDPR-sensitive markets, performance concerns)
How This Skill Works
Mode 1: Set Up a partir de Scratch
No analytics in place — we'll criar o tracking plano, implement GA4 e GTM, define o Taxonomia de eventos, e configure key eventos.
Start a partir do generator, then customize:
python3 scripts/tracking_plan_generator.py # embedded sample → full tracking plano
python3 scripts/tracking_plan_generator.py plano.json # o seu funnel definition
python3 scripts/tracking_plan_generator.py --json # parseable JSON para pipelines
Its output (Taxonomia de eventos + parameters + GA4/GTM config checklist) is o working draft para o Taxonomia de eventos Design section below — rever cada generated evento nomear against o naming convention antes implementing.
Mode 2: auditoria Existing Tracking
Tracking exists but você don't trust o dados, cobertura is incomplete, ou você're adding novo goals. We'll auditoria what's there, lacuna-fill, e clean up.
Mode 3: Debug Tracking Issues
Specific eventos are em falta, conversão numbers don't add up, ou GTM preview shows eventos firing but GA4 isn't recording them. Structured debugging workflow.
Taxonomia de eventos Design
Get this right antes touching GA4 ou GTM. Retrofitting taxonomy is painful.
Naming Convention
Format: ¤KEEP0¤ (snake_case, verb at o end)
| ✅ Good | ❌ Bad |
|---|---|
| ¤KEEP0¤ | ¤KEEP1¤, ¤KEEP2¤, ¤KEEP3¤ |
| ¤KEEP0¤ | ¤KEEP1¤, ¤KEEP2¤, ¤KEEP3¤ |
| ¤KEEP0¤ | ¤KEEP1¤, ¤KEEP2¤, ¤KEEP3¤ |
| ¤KEEP0¤ | ¤KEEP1¤, ¤KEEP2¤, ¤KEEP3¤ |
Rules:
- Always ¤KEEP0¤ não ¤KEEP1¤
- Lowercase + underscores only — no camelCase, no hyphens
- Be specific enough para be unambiguous, não so verbose it's a sentence
- Consistent tense: ¤KEEP0¤, ¤KEEP1¤, ¤KEEP2¤ (não mix de past/present)
Standard Parameters
cada evento deve incluir these where applicable:
| Parameter | Type | Example | Purpose |
|---|---|---|---|
| ¤KEEP0¤ | string | ¤KEEP1¤ | Auto-captured by GA4 |
| ¤KEEP0¤ | string | ¤KEEP1¤ | Auto-captured by GA4 |
| ¤KEEP0¤ | string | ¤KEEP1¤ | Link para o seu CRM/DB |
| ¤KEEP0¤ | string | ¤KEEP1¤ | Segment by plano |
| ¤KEEP0¤ | number | ¤KEEP1¤ | Revenue/order value |
| ¤KEEP0¤ | string | ¤KEEP1¤ | obrigatório com value |
| ¤KEEP0¤ | string | ¤KEEP1¤ | Group páginas/flows |
| ¤KEEP0¤ | string | ¤KEEP1¤ | How (signup method, etc.) |
Taxonomia de eventos para SaaS
Core funnel eventos:
visitor_arrived (página view — automatic in GA4)
signup_started (utilizador clicked "Sign up")
signup_completed (conta 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-conversão eventos:
pricing_viewed
demo_requested (param: fonte)
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 para o full taxonomy catalog com custom dimension recomendações.
GA4 Setup
dados Stream Configuration
- criar propriedade in GA4 → Admin → propriedades → criar
- Add web dados stream com o seu domain
- Enhanced Measurement — enable todos, then rever:
- ✅ página views (keep)
- ✅ Scrolls (keep)
- ✅ Outbound clicks (keep)
- ✅ site pesquisar (keep if você have pesquisar)
- ⚠️ Video engagement (disable if você'll track videos manually — avoid duplicates)
- ⚠️ File downloads (disable if você'll track these in GTM para better parameters)
- Configure domains — add todos subdomains used in o seu funnel
Custom eventos in GA4
para qualquer evento não auto-collected, criar it in GTM (preferred) ou via gtag directly:
Via gtag:
gtag('evento', 'signup_completed', {
method: 'email',
user_id: 'usr_abc123',
plan_name: "trial"
});
Via GTM dados layer (preferred — see GTM section):
window.dataLayer.push({
evento: 'signup_completed',
signup_method: 'email',
user_id: 'usr_abc123'
});
Key eventos Configuration
Mark these eventos as key eventos in GA4 → Admin → Key eventos (GA4 renamed "conversões" para "Key eventos" in March 2024 — "conversões" now refers only para Google anúncios conversão ações):
- ¤KEEP0¤
- ¤KEEP0¤
- ¤KEEP0¤
- ¤KEEP0¤ (if separate a partir de signup)
Rules:
- Max 30 key eventos per propriedade — curate, don't mark everything
- Key eventos are retroactive in GA4 — turning one on applies para 6 months de history
- Don't mark micro-conversões as key eventos unless você're also optimizing anúncio campanhas para them
Google Tag Manager Setup
Container Structure
GTM Container
├── Tags
│ ├── GA4 Configuration (fires on todos páginas)
│ ├── GA4 evento — [event_name] (one tag per evento)
│ ├── Google anúncios conversão (per conversão ação)
│ └── Meta Pixel (if running Meta anúncios)
├── gatilhos
│ ├── todos páginas
│ ├── DOM pronto
│ ├── dados Layer evento — [event_name]
│ └── Custom Element Click — [selector]
└── Variables
├── dados Layer Variables (dlv — para each dL key)
├── Constant — GA4 Measurement ID
└── JavaScript Variables (computed values)
Tag Patterns para SaaS
Pattern 1: dados Layer Push (most reliable)
o seu app pushes para dataLayer → GTM picks it up → sends para GA4.
// In o seu app code (on evento):
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
evento: 'signup_completed',
signup_method: 'email',
user_id: userId,
plan_name: "trial"
});
GTM Tag: GA4 evento
evento nomear: {{DLV - evento}} OR hardcode "signup_completed"
Parameters:
signup_method: {{DLV - signup_method}}
user_id: {{DLV - user_id}}
plan_name: "dlv-plano-nomear"
gatilho: Custom evento - "signup_completed"
Pattern 2: CSS Selector Click
para eventos triggered by UI elements sem app-level hooks.
GTM gatilho:
Type: Click - todos Elements
Conditions: Click Element matches CSS selector [dados-track="demo-cta"]
GTM Tag: GA4 evento
evento nomear: demo_requested
Parameters:
page_location: {{página URL}}
See references/gtm-patterns.md para full configuration templates.
conversão Tracking: Platform-Specific
Google anúncios
- criar conversão ação in Google anúncios → Tools → conversões
- Import GA4 conversões (recommended — single fonte de truth) OR usar o Google anúncios tag
- Set attribution model: dados-driven (if >50 conversões/month), otherwise último click
- conversão window: 30 days para lead gen, 90 days para high-consideration purchases
Meta (Facebook/Instagram) Pixel
- Install Meta Pixel base code via GTM
- Standard eventos: ¤KEEP0¤, ¤KEEP1¤, ¤KEEP2¤, ¤KEEP3¤
- conversões API (CAPI) strongly recommended — cliente-side pixel loses ~30% de conversões due para anúncio bloqueios e iOS
- CAPI requires server-side implementation (Meta's docs ou GTM server-side)
Cross-Platform Tracking
UTM estratégia
Enforce strict UTM conventions ou o seu channel dados becomes noise.
| Parameter | Convention | Example |
|---|---|---|
| ¤KEEP0¤ | Platform nomear (lowercase) | ¤KEEP1¤, ¤KEEP2¤, ¤KEEP3¤ |
| ¤KEEP0¤ | Traffic type | ¤KEEP1¤, ¤KEEP2¤, ¤KEEP3¤, ¤KEEP4¤ |
| ¤KEEP0¤ | campanha ID ou nomear | ¤KEEP1¤, ¤KEEP2¤ |
| ¤KEEP0¤ | anúncio/creative variant | ¤KEEP1¤, ¤KEEP2¤ |
| ¤KEEP0¤ | Paid keyword | ¤KEEP1¤ |
Rule: Never tag organic ou direct traffic com UTMs. UTMs override GA4's automatic fonte/medium attribution.
Attribution Windows
| Platform | Default Window | Recommended para SaaS |
|---|---|---|
| GA4 | 30 days | 30-90 days depending on vendas cycle |
| Google anúncios | 30 days | 30 days (trial), 90 days (enterprise) |
| Meta | 7-day click, 1-day view | 7-day click only |
| 30 days | 30 days |
Cross-Domain Tracking
para funnels that cross domains (e.g., ¤KEEP0¤ → ¤KEEP1¤):
- In GA4 → Admin → dados Streams → Configure tag settings → List unwanted referrals → Add both domains
- In GTM → GA4 Configuration tag → Cross-domain measurement → Add both domains
- Test: visit domain A, click link para domain B, verificar GA4 DebugView — session deve não restart
dados qualidade
Deduplication
eventos firing twice? Common causes:
- GTM tag + hardcoded gtag both firing
- Enhanced Measurement + custom GTM tag para same evento
- SPA router firing pageview on cada route change AND GTM página view tag
Fix: auditoria GTM Preview para double-fires. verificar Network tab in DevTools para duplicate hits.
Bot Filtering
GA4 filters known bots automatically. para internal traffic:
- GA4 → Admin → dados Filters → Internal Traffic
- Add o seu office IPs e developer IPs
- Enable filter (starts as testing mode — activate it)
Consent Management impacto
Under GDPR/ePrivacy, analytics may require consent. plano para this:
| Consent Mode setting | impacto |
|---|---|
| No consent mode | Visitors who decline cookies → zero dados |
| Basic consent mode | Visitors who decline → zero dados |
| Advanced consent mode | Visitors who decline → modeled dados (GA4 estimates using consented utilizadores) |
recomendação: Implement Advanced Consent Mode via GTM. Requires CMP integration (Cookiebot, OneTrust, Usercentrics, etc.).
Expected consent taxa by region: 60-75% EU, 85-95% US.
Proactive gatilhos
Surface these sem being asked:
- eventos firing on cada página load → Symptom de misconfigured gatilho. assinalar: duplicate dados inflation.
- No user_id being passed → você can't connect analytics para o seu CRM ou understand cohorts. assinalar para fix.
- conversões não matching GA4 vs anúncios → Attribution window mismatch ou pixel duplication. assinalar para auditoria.
- No consent mode configured in EU markets → jurídico exposure e underreported dados. assinalar immediately.
- todos páginas showing as "/(não set)" ou generic paths → SPA routing não handled. GA4 is recording wrong páginas.
- UTM fonte showing as "direct" para paid campanhas → UTMs em falta ou being stripped. Traffic attribution is broken.
Output Artifacts
| When você ask para... | você get... |
|---|---|
| "criar a tracking plano" | Taxonomia de eventos table (eventos + parameters + gatilhos), GA4 configuration checklist, GTM container structure |
| "auditoria my tracking" | lacuna analysis vs. standard SaaS funnel, dados qualidade scorecard (0-100), prioritized fix list |
| "Set up GTM" | Tag/trigger/variable configuration para each evento, container setup checklist |
| "Debug em falta eventos" | Structured debugging steps using GTM Preview + GA4 DebugView + Network tab |
| "Set up conversão tracking" | conversão ação configuration para GA4 + Google anúncios + Meta |
| "gerar tracking plano" | Run ¤KEEP0¤ — Taxonomia de eventos + GA4/GTM checklist |
Communication
todos output follows o structured communication standard:
- Bottom line primeiro — what's broken ou what precisa de building antes methodology
- What + Why + How — cada finding has todos three
- ações have responsáveis e deadlines — no vague "consider implementing"
- confiança tagging — 🟢 verified / 🟡 estimated / 🔴 assumed
Related Skills
- campanha-analytics: usar para analyzing marketing performance e channel ROI. NOT para implementation — usar this skill para tracking setup.
- ab-test-setup: usar when designing experiments. NOT para evento tracking setup (though this skill's eventos feed A/B tests).
- analytics-tracking (this skill): covers setup only. para dashboards e reporting, usar campanha-analytics.
- seo-auditoria: usar para technical SEO. NOT para analytics tracking (though both usar GA4 dados).
- gdpr-dsgvo-expert: usar para GDPR conformidade posture. Esta skill covers consent mode implementation; that skill covers o full conformidade framework.
fonte marketplace página: ¤KEEP0¤
Install command: npx skills add alirezarezvani/claude-skills@analytics-tracking