format: apply repo prettier (3.8.1) to the folded skills tree
963 markdown files reformatted with the repository's pinned prettier so pnpm format:check covers the folded tree like every other repo file. The formatter's embedded-language pass also normalized code fences (TS semicolons, closed HTML tags in examples, lowercased CSS hex colors, one renumbered list that skipped an index). Alphanumeric token deltas vs the fold commit were audited file-by-file; all are formatter-equivalent markup normalizations plus the four sanitized skills.
This commit is contained in:
@@ -24,21 +24,25 @@ Before implementing tracking, understand:
|
||||
## Core Principles
|
||||
|
||||
### 1. Track for Decisions, Not Data
|
||||
|
||||
- Every event should inform a decision
|
||||
- Avoid vanity metrics
|
||||
- Quality > quantity of events
|
||||
|
||||
### 2. Start with the Questions
|
||||
|
||||
- What do you need to know?
|
||||
- What actions will you take based on this data?
|
||||
- Work backwards to what you need to track
|
||||
|
||||
### 3. Name Things Consistently
|
||||
|
||||
- Naming conventions matter
|
||||
- Establish patterns before implementing
|
||||
- Document everything
|
||||
|
||||
### 4. Maintain Data Quality
|
||||
|
||||
- Validate implementation
|
||||
- Monitor for issues
|
||||
- Clean data > more data
|
||||
@@ -56,12 +60,12 @@ Event Name | Category | Properties | Trigger | Notes
|
||||
|
||||
### Event Types
|
||||
|
||||
| Type | Examples |
|
||||
|------|----------|
|
||||
| Pageviews | Automatic, enhanced with metadata |
|
||||
| User Actions | Button clicks, form submissions, feature usage |
|
||||
| System Events | Signup completed, purchase, subscription changed |
|
||||
| Custom Conversions | Goal completions, funnel stages |
|
||||
| Type | Examples |
|
||||
| ------------------ | ------------------------------------------------ |
|
||||
| Pageviews | Automatic, enhanced with metadata |
|
||||
| User Actions | Button clicks, form submissions, feature usage |
|
||||
| System Events | Signup completed, purchase, subscription changed |
|
||||
| Custom Conversions | Goal completions, funnel stages |
|
||||
|
||||
**For comprehensive event lists**: See [references/event-library.md](references/event-library.md)
|
||||
|
||||
@@ -80,6 +84,7 @@ checkout_payment_completed
|
||||
```
|
||||
|
||||
### Best Practices
|
||||
|
||||
- Lowercase with underscores
|
||||
- Be specific: `cta_hero_clicked` vs. `button_clicked`
|
||||
- Include context in properties, not event name
|
||||
@@ -92,21 +97,21 @@ checkout_payment_completed
|
||||
|
||||
### Marketing Site
|
||||
|
||||
| Event | Properties |
|
||||
|-------|------------|
|
||||
| cta_clicked | button_text, location |
|
||||
| form_submitted | form_type |
|
||||
| signup_completed | method, source |
|
||||
| demo_requested | - |
|
||||
| Event | Properties |
|
||||
| ---------------- | --------------------- |
|
||||
| cta_clicked | button_text, location |
|
||||
| form_submitted | form_type |
|
||||
| signup_completed | method, source |
|
||||
| demo_requested | - |
|
||||
|
||||
### Product/App
|
||||
|
||||
| Event | Properties |
|
||||
|-------|------------|
|
||||
| Event | Properties |
|
||||
| ------------------------- | ---------------------- |
|
||||
| onboarding_step_completed | step_number, step_name |
|
||||
| feature_used | feature_name |
|
||||
| purchase_completed | plan, value |
|
||||
| subscription_cancelled | reason |
|
||||
| feature_used | feature_name |
|
||||
| purchase_completed | plan, value |
|
||||
| subscription_cancelled | reason |
|
||||
|
||||
**For full event library by business type**: See [references/event-library.md](references/event-library.md)
|
||||
|
||||
@@ -116,14 +121,15 @@ checkout_payment_completed
|
||||
|
||||
### Standard Properties
|
||||
|
||||
| Category | Properties |
|
||||
|----------|------------|
|
||||
| Page | page_title, page_location, page_referrer |
|
||||
| User | user_id, user_type, account_id, plan_type |
|
||||
| Campaign | source, medium, campaign, content, term |
|
||||
| Product | product_id, product_name, category, price |
|
||||
| Category | Properties |
|
||||
| -------- | ----------------------------------------- |
|
||||
| Page | page_title, page_location, page_referrer |
|
||||
| User | user_id, user_type, account_id, plan_type |
|
||||
| Campaign | source, medium, campaign, content, term |
|
||||
| Product | product_id, product_name, category, price |
|
||||
|
||||
### Best Practices
|
||||
|
||||
- Use consistent property names
|
||||
- Include relevant context
|
||||
- Don't duplicate automatic properties
|
||||
@@ -145,8 +151,8 @@ checkout_payment_completed
|
||||
|
||||
```javascript
|
||||
gtag('event', 'signup_completed', {
|
||||
'method': 'email',
|
||||
'plan': 'free'
|
||||
method: 'email',
|
||||
plan: 'free',
|
||||
});
|
||||
```
|
||||
|
||||
@@ -158,19 +164,19 @@ gtag('event', 'signup_completed', {
|
||||
|
||||
### Container Structure
|
||||
|
||||
| Component | Purpose |
|
||||
|-----------|---------|
|
||||
| Tags | Code that executes (GA4, pixels) |
|
||||
| Triggers | When tags fire (page view, click) |
|
||||
| Component | Purpose |
|
||||
| --------- | --------------------------------------- |
|
||||
| Tags | Code that executes (GA4, pixels) |
|
||||
| Triggers | When tags fire (page view, click) |
|
||||
| Variables | Dynamic values (click text, data layer) |
|
||||
|
||||
### Data Layer Pattern
|
||||
|
||||
```javascript
|
||||
dataLayer.push({
|
||||
'event': 'form_submitted',
|
||||
'form_name': 'contact',
|
||||
'form_location': 'footer'
|
||||
event: 'form_submitted',
|
||||
form_name: 'contact',
|
||||
form_location: 'footer',
|
||||
});
|
||||
```
|
||||
|
||||
@@ -182,15 +188,16 @@ dataLayer.push({
|
||||
|
||||
### Standard Parameters
|
||||
|
||||
| Parameter | Purpose | Example |
|
||||
|-----------|---------|---------|
|
||||
| utm_source | Traffic source | google, newsletter |
|
||||
| utm_medium | Marketing medium | cpc, email, social |
|
||||
| utm_campaign | Campaign name | spring_sale |
|
||||
| utm_content | Differentiate versions | hero_cta |
|
||||
| utm_term | Paid search keywords | running+shoes |
|
||||
| Parameter | Purpose | Example |
|
||||
| ------------ | ---------------------- | ------------------ |
|
||||
| utm_source | Traffic source | google, newsletter |
|
||||
| utm_medium | Marketing medium | cpc, email, social |
|
||||
| utm_campaign | Campaign name | spring_sale |
|
||||
| utm_content | Differentiate versions | hero_cta |
|
||||
| utm_term | Paid search keywords | running+shoes |
|
||||
|
||||
### Naming Conventions
|
||||
|
||||
- Lowercase everything
|
||||
- Use underscores or hyphens consistently
|
||||
- Be specific but concise: `blog_footer_cta`, not `cta1`
|
||||
@@ -202,10 +209,10 @@ dataLayer.push({
|
||||
|
||||
### Testing Tools
|
||||
|
||||
| Tool | Use For |
|
||||
|------|---------|
|
||||
| GA4 DebugView | Real-time event monitoring |
|
||||
| GTM Preview Mode | Test triggers before publish |
|
||||
| Tool | Use For |
|
||||
| ------------------ | ---------------------------------- |
|
||||
| GA4 DebugView | Real-time event monitoring |
|
||||
| GTM Preview Mode | Test triggers before publish |
|
||||
| Browser Extensions | Tag Assistant, dataLayer Inspector |
|
||||
|
||||
### Validation Checklist
|
||||
@@ -219,23 +226,25 @@ dataLayer.push({
|
||||
|
||||
### Common Issues
|
||||
|
||||
| Issue | Check |
|
||||
|-------|-------|
|
||||
| Events not firing | Trigger config, GTM loaded |
|
||||
| Wrong values | Variable path, data layer structure |
|
||||
| Duplicate events | Multiple containers, trigger firing twice |
|
||||
| Issue | Check |
|
||||
| ----------------- | ----------------------------------------- |
|
||||
| Events not firing | Trigger config, GTM loaded |
|
||||
| Wrong values | Variable path, data layer structure |
|
||||
| Duplicate events | Multiple containers, trigger firing twice |
|
||||
|
||||
---
|
||||
|
||||
## Privacy and Compliance
|
||||
|
||||
### Considerations
|
||||
|
||||
- Cookie consent required in EU/UK/CA
|
||||
- No PII in analytics properties
|
||||
- Data retention settings
|
||||
- User deletion capabilities
|
||||
|
||||
### Implementation
|
||||
|
||||
- Use consent mode (wait for consent)
|
||||
- IP anonymization
|
||||
- Only collect what you need
|
||||
@@ -251,26 +260,27 @@ dataLayer.push({
|
||||
# [Site/Product] Tracking Plan
|
||||
|
||||
## Overview
|
||||
|
||||
- Tools: GA4, GTM
|
||||
- Last updated: [Date]
|
||||
|
||||
## Events
|
||||
|
||||
| Event Name | Description | Properties | Trigger |
|
||||
|------------|-------------|------------|---------|
|
||||
| Event Name | Description | Properties | Trigger |
|
||||
| ---------------- | --------------------- | ------------ | ------------ |
|
||||
| signup_completed | User completes signup | method, plan | Success page |
|
||||
|
||||
## Custom Dimensions
|
||||
|
||||
| Name | Scope | Parameter |
|
||||
|------|-------|-----------|
|
||||
| user_type | User | user_type |
|
||||
| Name | Scope | Parameter |
|
||||
| --------- | ----- | --------- |
|
||||
| user_type | User | user_type |
|
||||
|
||||
## Conversions
|
||||
|
||||
| Conversion | Event | Counting |
|
||||
|------------|-------|----------|
|
||||
| Signup | signup_completed | Once per session |
|
||||
| Conversion | Event | Counting |
|
||||
| ---------- | ---------------- | ---------------- |
|
||||
| Signup | signup_completed | Once per session |
|
||||
```
|
||||
|
||||
---
|
||||
@@ -290,13 +300,13 @@ dataLayer.push({
|
||||
|
||||
For implementation, see the [tools registry](../../tools/REGISTRY.md). Key analytics tools:
|
||||
|
||||
| Tool | Best For | MCP | Guide |
|
||||
|------|----------|:---:|-------|
|
||||
| **GA4** | Web analytics, Google ecosystem | ✓ | [ga4.md](../../tools/integrations/ga4.md) |
|
||||
| **Mixpanel** | Product analytics, event tracking | - | [mixpanel.md](../../tools/integrations/mixpanel.md) |
|
||||
| **Amplitude** | Product analytics, cohort analysis | - | [amplitude.md](../../tools/integrations/amplitude.md) |
|
||||
| **PostHog** | Open-source analytics, session replay | - | [posthog.md](../../tools/integrations/posthog.md) |
|
||||
| **Segment** | Customer data platform, routing | - | [segment.md](../../tools/integrations/segment.md) |
|
||||
| Tool | Best For | MCP | Guide |
|
||||
| ------------- | ------------------------------------- | :-: | ----------------------------------------------------- |
|
||||
| **GA4** | Web analytics, Google ecosystem | ✓ | [ga4.md](../../tools/integrations/ga4.md) |
|
||||
| **Mixpanel** | Product analytics, event tracking | - | [mixpanel.md](../../tools/integrations/mixpanel.md) |
|
||||
| **Amplitude** | Product analytics, cohort analysis | - | [amplitude.md](../../tools/integrations/amplitude.md) |
|
||||
| **PostHog** | Open-source analytics, session replay | - | [posthog.md](../../tools/integrations/posthog.md) |
|
||||
| **Segment** | Customer data platform, routing | - | [segment.md](../../tools/integrations/segment.md) |
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -6,36 +6,36 @@ Comprehensive list of events to track by business type and context.
|
||||
|
||||
### Navigation & Engagement
|
||||
|
||||
| Event Name | Description | Properties |
|
||||
|------------|-------------|------------|
|
||||
| page_view | Page loaded (enhanced) | page_title, page_location, content_group |
|
||||
| scroll_depth | User scrolled to threshold | depth (25, 50, 75, 100) |
|
||||
| outbound_link_clicked | Click to external site | link_url, link_text |
|
||||
| internal_link_clicked | Click within site | link_url, link_text, location |
|
||||
| video_played | Video started | video_id, video_title, duration |
|
||||
| video_completed | Video finished | video_id, video_title, duration |
|
||||
| Event Name | Description | Properties |
|
||||
| --------------------- | -------------------------- | ---------------------------------------- |
|
||||
| page_view | Page loaded (enhanced) | page_title, page_location, content_group |
|
||||
| scroll_depth | User scrolled to threshold | depth (25, 50, 75, 100) |
|
||||
| outbound_link_clicked | Click to external site | link_url, link_text |
|
||||
| internal_link_clicked | Click within site | link_url, link_text, location |
|
||||
| video_played | Video started | video_id, video_title, duration |
|
||||
| video_completed | Video finished | video_id, video_title, duration |
|
||||
|
||||
### CTA & Form Interactions
|
||||
|
||||
| Event Name | Description | Properties |
|
||||
|------------|-------------|------------|
|
||||
| cta_clicked | Call to action clicked | button_text, cta_location, page |
|
||||
| form_started | User began form | form_name, form_location |
|
||||
| form_field_completed | Field filled | form_name, field_name |
|
||||
| form_submitted | Form successfully sent | form_name, form_location |
|
||||
| form_error | Form validation failed | form_name, error_type |
|
||||
| resource_downloaded | Asset downloaded | resource_name, resource_type |
|
||||
| Event Name | Description | Properties |
|
||||
| -------------------- | ---------------------- | ------------------------------- |
|
||||
| cta_clicked | Call to action clicked | button_text, cta_location, page |
|
||||
| form_started | User began form | form_name, form_location |
|
||||
| form_field_completed | Field filled | form_name, field_name |
|
||||
| form_submitted | Form successfully sent | form_name, form_location |
|
||||
| form_error | Form validation failed | form_name, error_type |
|
||||
| resource_downloaded | Asset downloaded | resource_name, resource_type |
|
||||
|
||||
### Conversion Events
|
||||
|
||||
| Event Name | Description | Properties |
|
||||
|------------|-------------|------------|
|
||||
| signup_started | Initiated signup | source, page |
|
||||
| signup_completed | Finished signup | method, plan, source |
|
||||
| demo_requested | Demo form submitted | company_size, industry |
|
||||
| contact_submitted | Contact form sent | inquiry_type |
|
||||
| newsletter_subscribed | Email list signup | source, list_name |
|
||||
| trial_started | Free trial began | plan, source |
|
||||
| Event Name | Description | Properties |
|
||||
| --------------------- | ------------------- | ---------------------- |
|
||||
| signup_started | Initiated signup | source, page |
|
||||
| signup_completed | Finished signup | method, plan, source |
|
||||
| demo_requested | Demo form submitted | company_size, industry |
|
||||
| contact_submitted | Contact form sent | inquiry_type |
|
||||
| newsletter_subscribed | Email list signup | source, list_name |
|
||||
| trial_started | Free trial began | plan, source |
|
||||
|
||||
---
|
||||
|
||||
@@ -43,37 +43,37 @@ Comprehensive list of events to track by business type and context.
|
||||
|
||||
### Onboarding
|
||||
|
||||
| Event Name | Description | Properties |
|
||||
|------------|-------------|------------|
|
||||
| signup_completed | Account created | method, referral_source |
|
||||
| onboarding_started | Began onboarding | - |
|
||||
| onboarding_step_completed | Step finished | step_number, step_name |
|
||||
| onboarding_completed | All steps done | steps_completed, time_to_complete |
|
||||
| onboarding_skipped | User skipped onboarding | step_skipped_at |
|
||||
| first_key_action_completed | Aha moment reached | action_type |
|
||||
| Event Name | Description | Properties |
|
||||
| -------------------------- | ----------------------- | --------------------------------- |
|
||||
| signup_completed | Account created | method, referral_source |
|
||||
| onboarding_started | Began onboarding | - |
|
||||
| onboarding_step_completed | Step finished | step_number, step_name |
|
||||
| onboarding_completed | All steps done | steps_completed, time_to_complete |
|
||||
| onboarding_skipped | User skipped onboarding | step_skipped_at |
|
||||
| first_key_action_completed | Aha moment reached | action_type |
|
||||
|
||||
### Core Usage
|
||||
|
||||
| Event Name | Description | Properties |
|
||||
|------------|-------------|------------|
|
||||
| session_started | App session began | session_number |
|
||||
| feature_used | Feature interaction | feature_name, feature_category |
|
||||
| action_completed | Core action done | action_type, count |
|
||||
| content_created | User created content | content_type |
|
||||
| content_edited | User modified content | content_type |
|
||||
| content_deleted | User removed content | content_type |
|
||||
| search_performed | In-app search | query, results_count |
|
||||
| settings_changed | Settings modified | setting_name, new_value |
|
||||
| invite_sent | User invited others | invite_type, count |
|
||||
| Event Name | Description | Properties |
|
||||
| ---------------- | --------------------- | ------------------------------ |
|
||||
| session_started | App session began | session_number |
|
||||
| feature_used | Feature interaction | feature_name, feature_category |
|
||||
| action_completed | Core action done | action_type, count |
|
||||
| content_created | User created content | content_type |
|
||||
| content_edited | User modified content | content_type |
|
||||
| content_deleted | User removed content | content_type |
|
||||
| search_performed | In-app search | query, results_count |
|
||||
| settings_changed | Settings modified | setting_name, new_value |
|
||||
| invite_sent | User invited others | invite_type, count |
|
||||
|
||||
### Errors & Support
|
||||
|
||||
| Event Name | Description | Properties |
|
||||
|------------|-------------|------------|
|
||||
| error_occurred | Error experienced | error_type, error_message, page |
|
||||
| help_opened | Help accessed | help_type, page |
|
||||
| support_contacted | Support request made | contact_method, issue_type |
|
||||
| feedback_submitted | User feedback given | feedback_type, rating |
|
||||
| Event Name | Description | Properties |
|
||||
| ------------------ | -------------------- | ------------------------------- |
|
||||
| error_occurred | Error experienced | error_type, error_message, page |
|
||||
| help_opened | Help accessed | help_type, page |
|
||||
| support_contacted | Support request made | contact_method, issue_type |
|
||||
| feedback_submitted | User feedback given | feedback_type, rating |
|
||||
|
||||
---
|
||||
|
||||
@@ -81,26 +81,26 @@ Comprehensive list of events to track by business type and context.
|
||||
|
||||
### Pricing & Checkout
|
||||
|
||||
| Event Name | Description | Properties |
|
||||
|------------|-------------|------------|
|
||||
| pricing_viewed | Pricing page seen | source |
|
||||
| plan_selected | Plan chosen | plan_name, billing_cycle |
|
||||
| checkout_started | Began checkout | plan, value |
|
||||
| payment_info_entered | Payment submitted | payment_method |
|
||||
| purchase_completed | Purchase successful | plan, value, currency, transaction_id |
|
||||
| purchase_failed | Purchase failed | error_reason, plan |
|
||||
| Event Name | Description | Properties |
|
||||
| -------------------- | ------------------- | ------------------------------------- |
|
||||
| pricing_viewed | Pricing page seen | source |
|
||||
| plan_selected | Plan chosen | plan_name, billing_cycle |
|
||||
| checkout_started | Began checkout | plan, value |
|
||||
| payment_info_entered | Payment submitted | payment_method |
|
||||
| purchase_completed | Purchase successful | plan, value, currency, transaction_id |
|
||||
| purchase_failed | Purchase failed | error_reason, plan |
|
||||
|
||||
### Subscription Management
|
||||
|
||||
| Event Name | Description | Properties |
|
||||
|------------|-------------|------------|
|
||||
| trial_started | Trial began | plan, trial_length |
|
||||
| trial_ended | Trial expired | plan, converted (bool) |
|
||||
| subscription_upgraded | Plan upgraded | from_plan, to_plan, value |
|
||||
| subscription_downgraded | Plan downgraded | from_plan, to_plan |
|
||||
| subscription_cancelled | Cancelled | plan, reason, tenure |
|
||||
| subscription_renewed | Renewed | plan, value |
|
||||
| billing_updated | Payment method changed | - |
|
||||
| Event Name | Description | Properties |
|
||||
| ----------------------- | ---------------------- | ------------------------- |
|
||||
| trial_started | Trial began | plan, trial_length |
|
||||
| trial_ended | Trial expired | plan, converted (bool) |
|
||||
| subscription_upgraded | Plan upgraded | from_plan, to_plan, value |
|
||||
| subscription_downgraded | Plan downgraded | from_plan, to_plan |
|
||||
| subscription_cancelled | Cancelled | plan, reason, tenure |
|
||||
| subscription_renewed | Renewed | plan, value |
|
||||
| billing_updated | Payment method changed | - |
|
||||
|
||||
---
|
||||
|
||||
@@ -108,41 +108,41 @@ Comprehensive list of events to track by business type and context.
|
||||
|
||||
### Browsing
|
||||
|
||||
| Event Name | Description | Properties |
|
||||
|------------|-------------|------------|
|
||||
| product_viewed | Product page viewed | product_id, product_name, category, price |
|
||||
| product_list_viewed | Category/list viewed | list_name, products[] |
|
||||
| product_searched | Search performed | query, results_count |
|
||||
| product_filtered | Filters applied | filter_type, filter_value |
|
||||
| product_sorted | Sort applied | sort_by, sort_order |
|
||||
| Event Name | Description | Properties |
|
||||
| ------------------- | -------------------- | ----------------------------------------- |
|
||||
| product_viewed | Product page viewed | product_id, product_name, category, price |
|
||||
| product_list_viewed | Category/list viewed | list_name, products[] |
|
||||
| product_searched | Search performed | query, results_count |
|
||||
| product_filtered | Filters applied | filter_type, filter_value |
|
||||
| product_sorted | Sort applied | sort_by, sort_order |
|
||||
|
||||
### Cart
|
||||
|
||||
| Event Name | Description | Properties |
|
||||
|------------|-------------|------------|
|
||||
| product_added_to_cart | Item added | product_id, product_name, price, quantity |
|
||||
| product_removed_from_cart | Item removed | product_id, product_name, price, quantity |
|
||||
| cart_viewed | Cart page viewed | cart_value, items_count |
|
||||
| Event Name | Description | Properties |
|
||||
| ------------------------- | ---------------- | ----------------------------------------- |
|
||||
| product_added_to_cart | Item added | product_id, product_name, price, quantity |
|
||||
| product_removed_from_cart | Item removed | product_id, product_name, price, quantity |
|
||||
| cart_viewed | Cart page viewed | cart_value, items_count |
|
||||
|
||||
### Checkout
|
||||
|
||||
| Event Name | Description | Properties |
|
||||
|------------|-------------|------------|
|
||||
| checkout_started | Checkout began | cart_value, items_count |
|
||||
| checkout_step_completed | Step finished | step_number, step_name |
|
||||
| shipping_info_entered | Address entered | shipping_method |
|
||||
| payment_info_entered | Payment entered | payment_method |
|
||||
| coupon_applied | Coupon used | coupon_code, discount_value |
|
||||
| purchase_completed | Order placed | transaction_id, value, currency, items[] |
|
||||
| Event Name | Description | Properties |
|
||||
| ----------------------- | --------------- | ---------------------------------------- |
|
||||
| checkout_started | Checkout began | cart_value, items_count |
|
||||
| checkout_step_completed | Step finished | step_number, step_name |
|
||||
| shipping_info_entered | Address entered | shipping_method |
|
||||
| payment_info_entered | Payment entered | payment_method |
|
||||
| coupon_applied | Coupon used | coupon_code, discount_value |
|
||||
| purchase_completed | Order placed | transaction_id, value, currency, items[] |
|
||||
|
||||
### Post-Purchase
|
||||
|
||||
| Event Name | Description | Properties |
|
||||
|------------|-------------|------------|
|
||||
| order_confirmed | Confirmation viewed | transaction_id |
|
||||
| refund_requested | Refund initiated | transaction_id, reason |
|
||||
| refund_completed | Refund processed | transaction_id, value |
|
||||
| review_submitted | Product reviewed | product_id, rating |
|
||||
| Event Name | Description | Properties |
|
||||
| ---------------- | ------------------- | ---------------------- |
|
||||
| order_confirmed | Confirmation viewed | transaction_id |
|
||||
| refund_requested | Refund initiated | transaction_id, reason |
|
||||
| refund_completed | Refund processed | transaction_id, value |
|
||||
| review_submitted | Product reviewed | product_id, rating |
|
||||
|
||||
---
|
||||
|
||||
@@ -150,30 +150,30 @@ Comprehensive list of events to track by business type and context.
|
||||
|
||||
### Team & Collaboration
|
||||
|
||||
| Event Name | Description | Properties |
|
||||
|------------|-------------|------------|
|
||||
| team_created | New team/org made | team_size, plan |
|
||||
| team_member_invited | Invite sent | role, invite_method |
|
||||
| team_member_joined | Member accepted | role |
|
||||
| team_member_removed | Member removed | role |
|
||||
| role_changed | Permissions updated | user_id, old_role, new_role |
|
||||
| Event Name | Description | Properties |
|
||||
| ------------------- | ------------------- | --------------------------- |
|
||||
| team_created | New team/org made | team_size, plan |
|
||||
| team_member_invited | Invite sent | role, invite_method |
|
||||
| team_member_joined | Member accepted | role |
|
||||
| team_member_removed | Member removed | role |
|
||||
| role_changed | Permissions updated | user_id, old_role, new_role |
|
||||
|
||||
### Integration Events
|
||||
|
||||
| Event Name | Description | Properties |
|
||||
|------------|-------------|------------|
|
||||
| integration_viewed | Integration page seen | integration_name |
|
||||
| integration_started | Setup began | integration_name |
|
||||
| integration_connected | Successfully connected | integration_name |
|
||||
| integration_disconnected | Removed integration | integration_name, reason |
|
||||
| Event Name | Description | Properties |
|
||||
| ------------------------ | ---------------------- | ------------------------ |
|
||||
| integration_viewed | Integration page seen | integration_name |
|
||||
| integration_started | Setup began | integration_name |
|
||||
| integration_connected | Successfully connected | integration_name |
|
||||
| integration_disconnected | Removed integration | integration_name, reason |
|
||||
|
||||
### Account Events
|
||||
|
||||
| Event Name | Description | Properties |
|
||||
|------------|-------------|------------|
|
||||
| account_created | New account | source, plan |
|
||||
| account_upgraded | Plan upgrade | from_plan, to_plan |
|
||||
| account_churned | Account closed | reason, tenure, mrr_lost |
|
||||
| Event Name | Description | Properties |
|
||||
| ------------------- | ----------------- | ------------------------- |
|
||||
| account_created | New account | source, plan |
|
||||
| account_upgraded | Plan upgrade | from_plan, to_plan |
|
||||
| account_churned | Account closed | reason, tenure, mrr_lost |
|
||||
| account_reactivated | Returned customer | previous_tenure, new_plan |
|
||||
|
||||
---
|
||||
@@ -183,6 +183,7 @@ Comprehensive list of events to track by business type and context.
|
||||
### Standard Properties to Include
|
||||
|
||||
**User Context:**
|
||||
|
||||
```
|
||||
user_id: "12345"
|
||||
user_type: "free" | "trial" | "paid"
|
||||
@@ -191,6 +192,7 @@ plan_type: "starter" | "pro" | "enterprise"
|
||||
```
|
||||
|
||||
**Session Context:**
|
||||
|
||||
```
|
||||
session_id: "sess_abc"
|
||||
session_number: 5
|
||||
@@ -199,6 +201,7 @@ referrer: "https://google.com"
|
||||
```
|
||||
|
||||
**Campaign Context:**
|
||||
|
||||
```
|
||||
source: "google"
|
||||
medium: "cpc"
|
||||
@@ -207,6 +210,7 @@ content: "hero_cta"
|
||||
```
|
||||
|
||||
**Product Context (E-commerce):**
|
||||
|
||||
```
|
||||
product_id: "SKU123"
|
||||
product_name: "Product Name"
|
||||
@@ -217,6 +221,7 @@ currency: "USD"
|
||||
```
|
||||
|
||||
**Timing:**
|
||||
|
||||
```
|
||||
timestamp: "2024-01-15T10:30:00Z"
|
||||
time_on_page: 45
|
||||
@@ -228,6 +233,7 @@ session_duration: 300
|
||||
## Funnel Event Sequences
|
||||
|
||||
### Signup Funnel
|
||||
|
||||
1. signup_started
|
||||
2. signup_step_completed (email)
|
||||
3. signup_step_completed (password)
|
||||
@@ -235,6 +241,7 @@ session_duration: 300
|
||||
5. onboarding_started
|
||||
|
||||
### Purchase Funnel
|
||||
|
||||
1. pricing_viewed
|
||||
2. plan_selected
|
||||
3. checkout_started
|
||||
@@ -242,6 +249,7 @@ session_duration: 300
|
||||
5. purchase_completed
|
||||
|
||||
### E-commerce Funnel
|
||||
|
||||
1. product_viewed
|
||||
2. product_added_to_cart
|
||||
3. cart_viewed
|
||||
|
||||
+67
-48
@@ -13,25 +13,27 @@ Detailed implementation guide for Google Analytics 4.
|
||||
|
||||
### Enhanced Measurement Events (Automatic)
|
||||
|
||||
| Event | Description | Configuration |
|
||||
|-------|-------------|---------------|
|
||||
| page_view | Page loads | Automatic |
|
||||
| scroll | 90% scroll depth | Toggle on/off |
|
||||
| outbound_click | Click to external domain | Automatic |
|
||||
| site_search | Search query used | Configure parameter |
|
||||
| video_engagement | YouTube video plays | Toggle on/off |
|
||||
| file_download | PDF, docs, etc. | Configurable extensions |
|
||||
| Event | Description | Configuration |
|
||||
| ---------------- | ------------------------ | ----------------------- |
|
||||
| page_view | Page loads | Automatic |
|
||||
| scroll | 90% scroll depth | Toggle on/off |
|
||||
| outbound_click | Click to external domain | Automatic |
|
||||
| site_search | Search query used | Configure parameter |
|
||||
| video_engagement | YouTube video plays | Toggle on/off |
|
||||
| file_download | PDF, docs, etc. | Configurable extensions |
|
||||
|
||||
### Recommended Events
|
||||
|
||||
Use Google's predefined events when possible for enhanced reporting:
|
||||
|
||||
**All properties:**
|
||||
|
||||
- login, sign_up
|
||||
- share
|
||||
- search
|
||||
|
||||
**E-commerce:**
|
||||
|
||||
- view_item, view_item_list
|
||||
- add_to_cart, remove_from_cart
|
||||
- begin_checkout
|
||||
@@ -39,6 +41,7 @@ Use Google's predefined events when possible for enhanced reporting:
|
||||
- purchase, refund
|
||||
|
||||
**Games:**
|
||||
|
||||
- level_up, unlock_achievement
|
||||
- post_score, spend_virtual_currency
|
||||
|
||||
@@ -53,31 +56,33 @@ Reference: https://support.google.com/analytics/answer/9267735
|
||||
```javascript
|
||||
// Basic event
|
||||
gtag('event', 'signup_completed', {
|
||||
'method': 'email',
|
||||
'plan': 'free'
|
||||
method: 'email',
|
||||
plan: 'free',
|
||||
});
|
||||
|
||||
// Event with value
|
||||
gtag('event', 'purchase', {
|
||||
'transaction_id': 'T12345',
|
||||
'value': 99.99,
|
||||
'currency': 'USD',
|
||||
'items': [{
|
||||
'item_id': 'SKU123',
|
||||
'item_name': 'Product Name',
|
||||
'price': 99.99
|
||||
}]
|
||||
transaction_id: 'T12345',
|
||||
value: 99.99,
|
||||
currency: 'USD',
|
||||
items: [
|
||||
{
|
||||
item_id: 'SKU123',
|
||||
item_name: 'Product Name',
|
||||
price: 99.99,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
// User properties
|
||||
gtag('set', 'user_properties', {
|
||||
'user_type': 'premium',
|
||||
'plan_name': 'pro'
|
||||
user_type: 'premium',
|
||||
plan_name: 'pro',
|
||||
});
|
||||
|
||||
// User ID (for logged-in users)
|
||||
gtag('config', 'GA_MEASUREMENT_ID', {
|
||||
'user_id': 'USER_ID'
|
||||
user_id: 'USER_ID',
|
||||
});
|
||||
```
|
||||
|
||||
@@ -86,40 +91,42 @@ gtag('config', 'GA_MEASUREMENT_ID', {
|
||||
```javascript
|
||||
// Custom event
|
||||
dataLayer.push({
|
||||
'event': 'signup_completed',
|
||||
'method': 'email',
|
||||
'plan': 'free'
|
||||
event: 'signup_completed',
|
||||
method: 'email',
|
||||
plan: 'free',
|
||||
});
|
||||
|
||||
// Set user properties
|
||||
dataLayer.push({
|
||||
'user_id': '12345',
|
||||
'user_type': 'premium'
|
||||
user_id: '12345',
|
||||
user_type: 'premium',
|
||||
});
|
||||
|
||||
// E-commerce purchase
|
||||
dataLayer.push({
|
||||
'event': 'purchase',
|
||||
'ecommerce': {
|
||||
'transaction_id': 'T12345',
|
||||
'value': 99.99,
|
||||
'currency': 'USD',
|
||||
'items': [{
|
||||
'item_id': 'SKU123',
|
||||
'item_name': 'Product Name',
|
||||
'price': 99.99,
|
||||
'quantity': 1
|
||||
}]
|
||||
}
|
||||
event: 'purchase',
|
||||
ecommerce: {
|
||||
transaction_id: 'T12345',
|
||||
value: 99.99,
|
||||
currency: 'USD',
|
||||
items: [
|
||||
{
|
||||
item_id: 'SKU123',
|
||||
item_name: 'Product Name',
|
||||
price: 99.99,
|
||||
quantity: 1,
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
// Clear ecommerce before sending (best practice)
|
||||
dataLayer.push({ ecommerce: null });
|
||||
dataLayer.push({
|
||||
'event': 'view_item',
|
||||
'ecommerce': {
|
||||
event: 'view_item',
|
||||
ecommerce: {
|
||||
// ...
|
||||
}
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
@@ -141,8 +148,8 @@ dataLayer.push({
|
||||
```javascript
|
||||
// Event with conversion value
|
||||
gtag('event', 'purchase', {
|
||||
'value': 99.99,
|
||||
'currency': 'USD'
|
||||
value: 99.99,
|
||||
currency: 'USD',
|
||||
});
|
||||
```
|
||||
|
||||
@@ -155,11 +162,13 @@ Or set default value in GA4 Admin when marking conversion.
|
||||
### When to Use
|
||||
|
||||
**Custom dimensions:**
|
||||
|
||||
- Properties you want to segment/filter by
|
||||
- User attributes (plan type, industry)
|
||||
- Content attributes (author, category)
|
||||
|
||||
**Custom metrics:**
|
||||
|
||||
- Numeric values to aggregate
|
||||
- Scores, counts, durations
|
||||
|
||||
@@ -175,11 +184,11 @@ Or set default value in GA4 Admin when marking conversion.
|
||||
|
||||
### Examples
|
||||
|
||||
| Dimension | Scope | Parameter | Description |
|
||||
|-----------|-------|-----------|-------------|
|
||||
| User Type | User | user_type | Free, trial, paid |
|
||||
| Content Author | Event | author | Blog post author |
|
||||
| Product Category | Item | item_category | E-commerce category |
|
||||
| Dimension | Scope | Parameter | Description |
|
||||
| ---------------- | ----- | ------------- | ------------------- |
|
||||
| User Type | User | user_type | Free, trial, paid |
|
||||
| Content Author | Event | author | Blog post author |
|
||||
| Product Category | Item | item_category | E-commerce category |
|
||||
|
||||
---
|
||||
|
||||
@@ -190,6 +199,7 @@ Or set default value in GA4 Admin when marking conversion.
|
||||
Admin > Data display > Audiences
|
||||
|
||||
**Use cases:**
|
||||
|
||||
- Remarketing audiences (export to Ads)
|
||||
- Segment analysis
|
||||
- Trigger-based events
|
||||
@@ -197,15 +207,18 @@ Admin > Data display > Audiences
|
||||
### Audience Examples
|
||||
|
||||
**High-intent visitors:**
|
||||
|
||||
- Viewed pricing page
|
||||
- Did not convert
|
||||
- In last 7 days
|
||||
|
||||
**Engaged users:**
|
||||
|
||||
- 3+ sessions
|
||||
- Or 5+ minutes total engagement
|
||||
|
||||
**Purchasers:**
|
||||
|
||||
- Purchase event
|
||||
- For exclusion or lookalike
|
||||
|
||||
@@ -216,6 +229,7 @@ Admin > Data display > Audiences
|
||||
### DebugView
|
||||
|
||||
Enable with:
|
||||
|
||||
- URL parameter: `?debug_mode=true`
|
||||
- Chrome extension: GA Debugger
|
||||
- gtag: `'debug_mode': true` in config
|
||||
@@ -230,16 +244,19 @@ Reports > Real-time
|
||||
### Common Issues
|
||||
|
||||
**Events not appearing:**
|
||||
|
||||
- Check DebugView first
|
||||
- Verify gtag/GTM firing
|
||||
- Check filter exclusions
|
||||
|
||||
**Parameter values missing:**
|
||||
|
||||
- Custom dimension not created
|
||||
- Parameter name mismatch
|
||||
- Data still processing (24-48 hrs)
|
||||
|
||||
**Conversions not recording:**
|
||||
|
||||
- Event not marked as conversion
|
||||
- Event name doesn't match
|
||||
- Counting method (once vs. every)
|
||||
@@ -253,6 +270,7 @@ Reports > Real-time
|
||||
Admin > Data streams > [Stream] > Configure tag settings > Define internal traffic
|
||||
|
||||
**Exclude:**
|
||||
|
||||
- Internal IP addresses
|
||||
- Developer traffic
|
||||
- Testing environments
|
||||
@@ -285,6 +303,7 @@ Admin > Data streams > [Stream] > Configure tag settings
|
||||
### Audience Export
|
||||
|
||||
Audiences created in GA4 can be used in Google Ads for:
|
||||
|
||||
- Remarketing campaigns
|
||||
- Customer match
|
||||
- Similar audiences
|
||||
|
||||
+94
-64
@@ -9,6 +9,7 @@ Detailed guide for implementing tracking via Google Tag Manager.
|
||||
Tags are code snippets that execute when triggered.
|
||||
|
||||
**Common tag types:**
|
||||
|
||||
- GA4 Configuration (base setup)
|
||||
- GA4 Event (custom events)
|
||||
- Google Ads Conversion
|
||||
@@ -21,6 +22,7 @@ Tags are code snippets that execute when triggered.
|
||||
Triggers define when tags fire.
|
||||
|
||||
**Built-in triggers:**
|
||||
|
||||
- Page View: All Pages, DOM Ready, Window Loaded
|
||||
- Click: All Elements, Just Links
|
||||
- Form Submission
|
||||
@@ -29,6 +31,7 @@ Triggers define when tags fire.
|
||||
- Element Visibility
|
||||
|
||||
**Custom triggers:**
|
||||
|
||||
- Custom Event (from dataLayer)
|
||||
- Trigger Groups (multiple conditions)
|
||||
|
||||
@@ -37,12 +40,14 @@ Triggers define when tags fire.
|
||||
Variables capture dynamic values.
|
||||
|
||||
**Built-in (enable as needed):**
|
||||
|
||||
- Click Text, Click URL, Click ID, Click Classes
|
||||
- Page Path, Page URL, Page Hostname
|
||||
- Referrer
|
||||
- Form Element, Form ID
|
||||
|
||||
**User-defined:**
|
||||
|
||||
- Data Layer variables
|
||||
- JavaScript variables
|
||||
- Lookup tables
|
||||
@@ -88,9 +93,9 @@ window.dataLayer = window.dataLayer || [];
|
||||
|
||||
// Push event
|
||||
dataLayer.push({
|
||||
'event': 'event_name',
|
||||
'property1': 'value1',
|
||||
'property2': 'value2'
|
||||
event: 'event_name',
|
||||
property1: 'value1',
|
||||
property2: 'value2',
|
||||
});
|
||||
```
|
||||
|
||||
@@ -100,24 +105,24 @@ dataLayer.push({
|
||||
// Set on page load (before GTM container)
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
dataLayer.push({
|
||||
'pageType': 'product',
|
||||
'contentGroup': 'products',
|
||||
'user': {
|
||||
'loggedIn': true,
|
||||
'userId': '12345',
|
||||
'userType': 'premium'
|
||||
}
|
||||
pageType: 'product',
|
||||
contentGroup: 'products',
|
||||
user: {
|
||||
loggedIn: true,
|
||||
userId: '12345',
|
||||
userType: 'premium',
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
### Form Submission
|
||||
|
||||
```javascript
|
||||
document.querySelector('#contact-form').addEventListener('submit', function() {
|
||||
document.querySelector('#contact-form').addEventListener('submit', function () {
|
||||
dataLayer.push({
|
||||
'event': 'form_submitted',
|
||||
'formName': 'contact',
|
||||
'formLocation': 'footer'
|
||||
event: 'form_submitted',
|
||||
formName: 'contact',
|
||||
formLocation: 'footer',
|
||||
});
|
||||
});
|
||||
```
|
||||
@@ -125,11 +130,11 @@ document.querySelector('#contact-form').addEventListener('submit', function() {
|
||||
### Button Click
|
||||
|
||||
```javascript
|
||||
document.querySelector('.cta-button').addEventListener('click', function() {
|
||||
document.querySelector('.cta-button').addEventListener('click', function () {
|
||||
dataLayer.push({
|
||||
'event': 'cta_clicked',
|
||||
'ctaText': this.innerText,
|
||||
'ctaLocation': 'hero'
|
||||
event: 'cta_clicked',
|
||||
ctaText: this.innerText,
|
||||
ctaLocation: 'hero',
|
||||
});
|
||||
});
|
||||
```
|
||||
@@ -140,49 +145,55 @@ document.querySelector('.cta-button').addEventListener('click', function() {
|
||||
// Product view
|
||||
dataLayer.push({ ecommerce: null }); // Clear previous
|
||||
dataLayer.push({
|
||||
'event': 'view_item',
|
||||
'ecommerce': {
|
||||
'items': [{
|
||||
'item_id': 'SKU123',
|
||||
'item_name': 'Product Name',
|
||||
'price': 99.99,
|
||||
'item_category': 'Category',
|
||||
'quantity': 1
|
||||
}]
|
||||
}
|
||||
event: 'view_item',
|
||||
ecommerce: {
|
||||
items: [
|
||||
{
|
||||
item_id: 'SKU123',
|
||||
item_name: 'Product Name',
|
||||
price: 99.99,
|
||||
item_category: 'Category',
|
||||
quantity: 1,
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
// Add to cart
|
||||
dataLayer.push({ ecommerce: null });
|
||||
dataLayer.push({
|
||||
'event': 'add_to_cart',
|
||||
'ecommerce': {
|
||||
'items': [{
|
||||
'item_id': 'SKU123',
|
||||
'item_name': 'Product Name',
|
||||
'price': 99.99,
|
||||
'quantity': 1
|
||||
}]
|
||||
}
|
||||
event: 'add_to_cart',
|
||||
ecommerce: {
|
||||
items: [
|
||||
{
|
||||
item_id: 'SKU123',
|
||||
item_name: 'Product Name',
|
||||
price: 99.99,
|
||||
quantity: 1,
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
// Purchase
|
||||
dataLayer.push({ ecommerce: null });
|
||||
dataLayer.push({
|
||||
'event': 'purchase',
|
||||
'ecommerce': {
|
||||
'transaction_id': 'T12345',
|
||||
'value': 99.99,
|
||||
'currency': 'USD',
|
||||
'tax': 5.00,
|
||||
'shipping': 10.00,
|
||||
'items': [{
|
||||
'item_id': 'SKU123',
|
||||
'item_name': 'Product Name',
|
||||
'price': 99.99,
|
||||
'quantity': 1
|
||||
}]
|
||||
}
|
||||
event: 'purchase',
|
||||
ecommerce: {
|
||||
transaction_id: 'T12345',
|
||||
value: 99.99,
|
||||
currency: 'USD',
|
||||
tax: 5.0,
|
||||
shipping: 10.0,
|
||||
items: [
|
||||
{
|
||||
item_id: 'SKU123',
|
||||
item_name: 'Product Name',
|
||||
price: 99.99,
|
||||
quantity: 1,
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
@@ -195,6 +206,7 @@ dataLayer.push({
|
||||
**Tag Type:** Google Analytics: GA4 Configuration
|
||||
|
||||
**Settings:**
|
||||
|
||||
- Measurement ID: G-XXXXXXXX
|
||||
- Send page view: Checked (for pageviews)
|
||||
- User Properties: Add any user-level dimensions
|
||||
@@ -206,6 +218,7 @@ dataLayer.push({
|
||||
**Tag Type:** Google Analytics: GA4 Event
|
||||
|
||||
**Settings:**
|
||||
|
||||
- Configuration Tag: Select your config tag
|
||||
- Event Name: {{DL - event_name}} or hardcode
|
||||
- Event Parameters: Add parameters from dataLayer
|
||||
@@ -218,14 +231,22 @@ dataLayer.push({
|
||||
|
||||
```html
|
||||
<script>
|
||||
!function(f,b,e,v,n,t,s)
|
||||
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
|
||||
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
|
||||
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
|
||||
n.queue=[];t=b.createElement(e);t.async=!0;
|
||||
t.src=v;s=b.getElementsByTagName(e)[0];
|
||||
s.parentNode.insertBefore(t,s)}(window, document,'script',
|
||||
'https://connect.facebook.net/en_US/fbevents.js');
|
||||
!(function (f, b, e, v, n, t, s) {
|
||||
if (f.fbq) return;
|
||||
n = f.fbq = function () {
|
||||
n.callMethod ? n.callMethod.apply(n, arguments) : n.queue.push(arguments);
|
||||
};
|
||||
if (!f._fbq) f._fbq = n;
|
||||
n.push = n;
|
||||
n.loaded = !0;
|
||||
n.version = '2.0';
|
||||
n.queue = [];
|
||||
t = b.createElement(e);
|
||||
t.async = !0;
|
||||
t.src = v;
|
||||
s = b.getElementsByTagName(e)[0];
|
||||
s.parentNode.insertBefore(t, s);
|
||||
})(window, document, 'script', 'https://connect.facebook.net/en_US/fbevents.js');
|
||||
fbq('init', 'YOUR_PIXEL_ID');
|
||||
fbq('track', 'PageView');
|
||||
</script>
|
||||
@@ -240,7 +261,7 @@ dataLayer.push({
|
||||
```html
|
||||
<script>
|
||||
fbq('track', 'Lead', {
|
||||
content_name: '{{DL - form_name}}'
|
||||
content_name: '{{DL - form_name}}',
|
||||
});
|
||||
</script>
|
||||
```
|
||||
@@ -258,6 +279,7 @@ dataLayer.push({
|
||||
3. GTM debug panel opens at bottom
|
||||
|
||||
**What to check:**
|
||||
|
||||
- Tags fired on this event
|
||||
- Tags not fired (and why)
|
||||
- Variables and their values
|
||||
@@ -266,16 +288,19 @@ dataLayer.push({
|
||||
### Debug Tips
|
||||
|
||||
**Tag not firing:**
|
||||
|
||||
- Check trigger conditions
|
||||
- Verify data layer push
|
||||
- Check tag sequencing
|
||||
|
||||
**Wrong variable value:**
|
||||
|
||||
- Check data layer structure
|
||||
- Verify variable path (nested objects)
|
||||
- Check timing (data may not exist yet)
|
||||
|
||||
**Multiple firings:**
|
||||
|
||||
- Check trigger uniqueness
|
||||
- Look for duplicate tags
|
||||
- Check tag firing options
|
||||
@@ -287,6 +312,7 @@ dataLayer.push({
|
||||
### Workspaces
|
||||
|
||||
Use workspaces for team collaboration:
|
||||
|
||||
- Default workspace for production
|
||||
- Separate workspaces for large changes
|
||||
- Merge when ready
|
||||
@@ -294,12 +320,14 @@ Use workspaces for team collaboration:
|
||||
### Version Management
|
||||
|
||||
**Best practices:**
|
||||
|
||||
- Name every version descriptively
|
||||
- Add notes explaining changes
|
||||
- Review changes before publish
|
||||
- Keep production version noted
|
||||
|
||||
**Version notes example:**
|
||||
|
||||
```
|
||||
v15: Added purchase conversion tracking
|
||||
- New tag: GA4 - Event - Purchase
|
||||
@@ -317,15 +345,15 @@ v15: Added purchase conversion tracking
|
||||
```javascript
|
||||
// Default state (before consent)
|
||||
gtag('consent', 'default', {
|
||||
'analytics_storage': 'denied',
|
||||
'ad_storage': 'denied'
|
||||
analytics_storage: 'denied',
|
||||
ad_storage: 'denied',
|
||||
});
|
||||
|
||||
// Update on consent
|
||||
function grantConsent() {
|
||||
gtag('consent', 'update', {
|
||||
'analytics_storage': 'granted',
|
||||
'ad_storage': 'granted'
|
||||
analytics_storage: 'granted',
|
||||
ad_storage: 'granted',
|
||||
});
|
||||
}
|
||||
```
|
||||
@@ -346,6 +374,7 @@ function grantConsent() {
|
||||
Tag Configuration > Advanced Settings > Tag Sequencing
|
||||
|
||||
**Use cases:**
|
||||
|
||||
- Config tag before event tags
|
||||
- Pixel initialization before tracking
|
||||
- Cleanup after conversion
|
||||
@@ -353,6 +382,7 @@ Tag Configuration > Advanced Settings > Tag Sequencing
|
||||
### Exception Handling
|
||||
|
||||
**Trigger exceptions** - Prevent tag from firing:
|
||||
|
||||
- Exclude certain pages
|
||||
- Exclude internal traffic
|
||||
- Exclude during testing
|
||||
|
||||
Reference in New Issue
Block a user