suede-analytics
Suede-owned measurement discipline for tracking plans, event and conversion instrumentation, UTM and campaign-parameter hygiene, and verification of what actually fires. Use when setting up, auditing, or repairing analytics across web, product, paid, and lifecycle surfaces. NOT F
Install
npx skills add https://github.com/JasonColapietro/suede-creator-skills/tree/main/skills/suede-analytics
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install jasoncolapietro-suede-creator-skills@llmmart
git clone https://github.com/JasonColapietro/suede-creator-skills.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole jasoncolapietro/suede-creator-skills collection as a plugin from our marketplace. Git is the plain clone.
Skill manifest
Suede Analytics Tracking
Use this Suede measurement playbook to build tracking that supports auditable marketing and product decisions.
Initial Assessment
Check for .agents/product-marketing.md (or .claude/product-marketing.md, or the legacy product-marketing-context.md) and read it if present — the key conversions, the decisions the data has to serve, and the tools already in place drive every recommendation here.
Then work the intake list under Task-Specific Questions below; ask only what the context file did not already answer.
Production Changes: Halt Before Mutating
Editing live tags, properties, destinations, or consent settings is the highest-consequence action in this skill, and Boundaries below forbids doing it without explicit authorization and a rollback plan. When a task requires one and you do not have both, halt in four parts:
- Stop. Do not publish the container, edit the property, or change the consent configuration.
- Name the blocker in one line ("publishing this GTM container version changes what fires for all live traffic; I have no rollback version identified").
- Offer 2-4 options (stage it in Preview and hand over the trace; write the change as a diff for the owner to publish; publish after the user names the rollback version; scope the change to a test environment).
- Wait for the answer. Do not pick one and continue.
The same halt applies to anything the Privacy and Compliance section below sends to legal or privacy review: an unresolved lawful-basis question blocks implementation, it does not get an assumption.
Tracking Plan Framework
Structure
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 |
For comprehensive event lists: See references/event-library.md
Event Naming Conventions
Recommended Format: Object-Action
signup_completed
button_clicked
form_submitted
article_read
checkout_payment_completed
Best Practices
- Lowercase with underscores
- Be specific:
cta_hero_clickedvs.button_clicked - Include context in properties, not event name
- Avoid spaces and special characters
Essential Events
Marketing Site
| Event | Properties |
|---|---|
| cta_clicked | button_text, location |
| form_submitted | form_type |
| signup_completed | method, source |
| demo_requested | - |
Product/App
| Event | Properties |
|---|---|
| onboarding_step_completed | step_number, step_name |
| feature_used | feature_name |
| purchase_completed | plan, value |
| subscription_cancelled | reason |
For full event library by business type: See references/event-library.md
Event Properties
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 |
Best Practices
- Avoid PII in properties
- Reuse the Standard Properties names above rather than inventing per-event variants
GA4 Implementation
Quick Setup
- Create GA4 property and data stream
- Install gtag.js or GTM
- Enable enhanced measurement
- Configure custom events
- Mark conversions in Admin
Custom Event Example
gtag('event', 'signup_completed', {
'method': 'email',
'plan': 'free'
});
For detailed GA4 implementation: See references/ga4-implementation.md
Google Tag Manager
Container Structure
| 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
dataLayer.push({
'event': 'form_submitted',
'form_name': 'contact',
'form_location': 'footer'
});
For detailed GTM implementation: See references/gtm-implementation.md
UTM Parameter Strategy
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 |
Naming Conventions
- Lowercase everything
- Use underscores or hyphens consistently
- Be specific but concise:
blog_footer_cta, notcta1 - Document all UTMs in a spreadsheet
Debugging and Validation
Testing Tools
| Tool | Use For |
|---|---|
| GA4 DebugView | Real-time event monitoring |
| GTM Preview Mode | Test triggers before publish |
| Browser Extensions | Tag Assistant, dataLayer Inspector |
Validation Checklist
Each box closes on an artifact from the tools above, matched to the tool category's "Required current proof" in Tool Integrations below. An unchecked box does not mean "probably fine" — it means the tracking is reported as unverified, never as done. Inspecting the tag config is not proof; a readback is.
- Events firing on correct triggers — a DebugView/live-events capture showing each event on the intended action
- Property values populating correctly — a property readback per event, values matched against the tracking plan
- No duplicate events — the same capture inspected for repeat fires (multiple containers, trigger firing twice)
- Works across browsers and mobile — the readback repeated on at least one non-primary browser and one mobile session
- Conversions recorded correctly — a source receipt plus a destination receipt for the conversion, not the source alone
- No PII leaking — the payload of a real captured event read field by field, plus masking/sampling settings for session replay
Report what was proven and what was not. "Instrumented" and "verified" are different claims; only the second one may cite this checklist.
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 |
Privacy and Compliance
Privacy, consent, retention, deletion, and identifier rules vary by jurisdiction, audience, data type, contract, and platform configuration. Do not treat this skill as legal advice or declare a universal consent rule.
Before implementation:
- Identify the actual markets, audience age, data categories, vendors, purposes, and data flows in scope.
- Review current official regulator and platform requirements for those jurisdictions and configurations; obtain qualified privacy or legal review when the requirement is unclear or material.
- Document the approved lawful basis or consent state, retention and deletion behavior, access controls, and prohibited properties.
- Collect only approved data, avoid direct personal identifiers unless the reviewed design expressly allows them, and test both allowed and denied consent paths.
Output Format
Tracking Plan Document
# [Site/Product] Tracking Plan
## Overview
- Tools: GA4, GTM
- Last updated: [Date]
## Events
| Event Name | Description | Properties | Trigger |
|------------|-------------|------------|---------|
| signup_completed | User completes signup | method, plan | Success page |
## Custom Dimensions
| Name | Scope | Parameter |
|------|-------|-----------|
| user_type | User | user_type |
## Conversions
| Conversion | Event | Counting |
|------------|-------|----------|
| Signup | signup_completed | Once per session |
Task-Specific Questions
- What tools are you using (GA4, Mixpanel, etc.)?
- What key actions do you want to track?
- What decisions will this data inform?
- Who implements - dev team or marketing?
- Are there privacy/consent requirements?
- What's already tracked?
Tool Integrations
This pack does not ship analytics connectors. Use the user's authorized property UI, debugger, export, API, or installed connector and verify current official documentation before constructing a call.
| Tool category | Typical use | Required current proof |
|---|---|---|
| Web analytics | Sessions, acquisition, web conversions | Debug event plus property readback |
| Product analytics | Event funnels, cohorts, retention | Schema check plus sampled event readback |
| Tag manager | Controlled client-side deployment | Preview trace plus published-version ID |
| Customer data router | Send approved events to destinations | Source receipt plus destination receipt |
| Session replay | Diagnose interaction friction | Consent, masking, sampling, and replay verification |
Boundaries
- Do not claim an event, conversion, consent state, or attribution path works until a current debug or readback proves it.
- Do not mutate production tags, properties, destinations, or consent settings without explicit authorization and a rollback plan.
- Do not collect secrets, direct personal identifiers, or sensitive traits merely because a tool permits them.
- Do not decide business success from a single dashboard number; state the metric definition, window, denominator, and exclusions.
Routing
- Need experiment design or result interpretation -> use
suede-ab-testing. - Need paid-campaign decisions -> use
suede-ads. - Need attribution modeling, model comparison, or cross-tool reconciliation -> use
suede-attribution. - Need pipeline and CRM attribution -> use
suede-revops. - Need organic visibility diagnosis -> use
suede-seo-audit. - From those skills, route instrumentation plans and firing verification back to
suede-analytics.
Files (suede-creator-skills)
-
agents
-
openai.yaml 584 B
interface: display_name: "Suede Analytics" short_description: "Know whether any of it worked" default_prompt: "Use $suede-analytics on [target]. The user is setting up or fixing analytics, conversion tracking, or attribution, or cannot tell whether a change moved anything. Work through tracking plans, event and conversion instrumentation, UTM discipline, attribution, and auditing what is actually firing, ground every recommendation in evidence the user can check, and return the decisions, the reasoning, and what to measure next." policy: allow_implicit_invocation: true
-
-
evals
-
evals.json 6.2 KB
{ "skill_name": "suede-analytics", "evals": [ { "id": 1, "prompt": "Help me set up analytics tracking for our B2B SaaS product. We use GA4 and GTM. We need to track signups, feature usage, and upgrade events.", "expected_output": "Should check for product-marketing.md first. Should apply the 'track for decisions' principle — ask what decisions the tracking will inform. Should use the event naming convention (object_action, lowercase with underscores). Should define essential events for SaaS: signup_completed, trial_started, feature_used, plan_upgraded, etc. Should provide GA4 implementation details with proper event parameters. Should include GTM data layer push examples. Should organize output as a tracking plan with event name, trigger, parameters, and purpose for each event.", "assertions": [ "Checks for product-marketing.md", "Applies 'track for decisions' principle", "Uses object_action naming convention", "Defines essential SaaS events (signup, feature usage, upgrade)", "Provides GA4 implementation details", "Includes GTM data layer examples", "Output follows tracking plan format" ], "files": [] }, { "id": 2, "prompt": "What UTM parameters should we use? We run ads on Google, Meta, and LinkedIn, plus send a weekly newsletter and post on LinkedIn organically.", "expected_output": "Should apply the UTM parameter strategy framework. Should define consistent UTM conventions: source (google, meta, linkedin, newsletter), medium (cpc, paid-social, email, organic-social), campaign (naming convention with date or identifier). Should provide specific UTM examples for each channel mentioned. Should warn about common UTM mistakes (inconsistent casing, redundant parameters, missing medium). Should recommend a UTM tracking spreadsheet or naming convention document.", "assertions": [ "Applies UTM parameter strategy", "Defines source, medium, and campaign conventions", "Provides specific UTM examples for each channel", "Uses consistent naming conventions (lowercase)", "Warns about common UTM mistakes", "Recommends tracking documentation" ], "files": [] }, { "id": 3, "prompt": "our tracking seems broken — we're seeing duplicate events and our conversion numbers in GA4 don't match what our database shows. help?", "expected_output": "Should trigger on casual phrasing. Should apply the debugging and validation framework. Should systematically check for common issues: duplicate GTM tags firing, missing event deduplication, incorrect trigger conditions, cross-domain tracking issues, consent mode filtering. Should provide specific debugging steps: use GA4 DebugView, GTM Preview mode, browser developer tools. Should address the GA4 vs database discrepancy (common causes: consent mode, ad blockers, client-side vs server-side tracking, session timeout differences).", "assertions": [ "Triggers on casual phrasing", "Applies debugging and validation framework", "Checks for duplicate tag firing", "Provides specific debugging tools (GA4 DebugView, GTM Preview)", "Addresses GA4 vs database discrepancy", "Lists common causes of data mismatches", "Provides systematic troubleshooting steps" ], "files": [] }, { "id": 4, "prompt": "We're launching an e-commerce store and need to set up tracking from scratch. What events do we absolutely need?", "expected_output": "Should reference the essential events by site type, specifically e-commerce. Should define the e-commerce event taxonomy: product_viewed, product_added_to_cart, cart_viewed, checkout_started, checkout_step_completed, purchase_completed, product_removed_from_cart. Should include enhanced e-commerce parameters (item_id, item_name, price, quantity, etc.). Should follow object_action naming convention. Should organize as a tracking plan with priorities (must-have vs nice-to-have).", "assertions": [ "References essential events for e-commerce site type", "Defines full e-commerce event taxonomy", "Includes enhanced e-commerce parameters", "Follows object_action naming convention", "Organizes by priority (must-have vs nice-to-have)", "Provides tracking plan format output" ], "files": [] }, { "id": 5, "prompt": "We need to make sure our tracking is GDPR compliant. We have European users and we're using GA4, Hotjar, and Facebook Pixel.", "expected_output": "Should apply the privacy and compliance framework. Should address GDPR requirements for each tool: consent before tracking, consent management platform (CMP) setup, GA4 consent mode configuration, conditional loading of Hotjar and Facebook Pixel. Should recommend a consent hierarchy (necessary, analytics, marketing). Should provide GTM implementation for consent-based tag firing. Should mention data retention settings in GA4. Should address cookie banner requirements.", "assertions": [ "Applies privacy and compliance framework", "Addresses GDPR requirements specifically", "Recommends consent management platform", "Covers GA4 consent mode configuration", "Addresses conditional loading for each tool", "Provides consent hierarchy", "Mentions data retention settings" ], "files": [] }, { "id": 6, "prompt": "Help me set up tracking for our A/B test. We want to measure which version of our pricing page converts better.", "expected_output": "Should recognize this overlaps with A/B test setup, not just analytics tracking. Should defer to or cross-reference suede-ab-testing for the experiment design, hypothesis, and statistical analysis. May help with the tracking implementation (events to fire, parameters to include) but should make clear that suede-ab-testing is the right skill for the experiment framework.", "assertions": [ "Recognizes overlap with A/B test setup", "References or defers to suede-ab-testing", "May help with tracking implementation specifics", "Does not attempt to design the full experiment" ], "files": [] } ] }
-
-
references
-
event-library.md 8.5 KB
# Event Library Reference Comprehensive list of events to track by business type and context. ## Contents - Marketing Site Events (navigation & engagement, CTA & form interactions, conversion events) - Product/App Events (onboarding, core usage, errors & support) - Monetization Events (pricing & checkout, subscription management) - E-commerce Events (browsing, cart, checkout, post-purchase) - B2B / SaaS Specific Events (team & collaboration, integration events, account events) - Event Properties (Parameters) - Funnel Event Sequences ## Marketing Site Events ### 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 | ### 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 | ### 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 | --- ## Product/App Events ### 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 | ### 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 | ### 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 | --- ## Monetization Events ### 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 | ### 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 | - | --- ## E-commerce Events ### 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 | ### 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 | ### 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[] | ### 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 | --- ## B2B / SaaS Specific Events ### 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 | ### 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 | ### 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 | | account_reactivated | Returned customer | previous_tenure, new_plan | --- ## Event Properties (Parameters) ### Standard Properties to Include **User Context:** ``` user_id: "12345" user_type: "free" | "trial" | "paid" account_id: "acct_123" plan_type: "starter" | "pro" | "enterprise" ``` **Session Context:** ``` session_id: "sess_abc" session_number: 5 page: "/pricing" referrer: "https://google.com" ``` **Campaign Context:** ``` source: "google" medium: "cpc" campaign: "spring_sale" content: "hero_cta" ``` **Product Context (E-commerce):** ``` product_id: "SKU123" product_name: "Product Name" category: "Category" price: 99.99 quantity: 1 currency: "USD" ``` **Timing:** ``` timestamp: "2024-01-15T10:30:00Z" time_on_page: 45 session_duration: 300 ``` --- ## Funnel Event Sequences ### Signup Funnel 1. signup_started 2. signup_step_completed (email) 3. signup_step_completed (password) 4. signup_completed 5. onboarding_started ### Purchase Funnel 1. pricing_viewed 2. plan_selected 3. checkout_started 4. payment_info_entered 5. purchase_completed ### E-commerce Funnel 1. product_viewed 2. product_added_to_cart 3. cart_viewed 4. checkout_started 5. shipping_info_entered 6. payment_info_entered 7. purchase_completed -
ga4-implementation.md 6.2 KB
# GA4 Implementation Reference Detailed implementation guide for Google Analytics 4. ## Contents - Configuration (data streams, enhanced measurement events, recommended events) - Custom Events (gtag.js implementation, Google Tag Manager) - Conversions Setup (creating conversions, conversion values) - Custom Dimensions and Metrics (when to use, setup steps, examples) - Audiences (creating audiences, audience examples) - Debugging (DebugView, real-time reports, common issues) - Data Quality (filters, cross-domain tracking, session settings) - Integration with Google Ads (linking, audience export) ## Configuration ### Data Streams - One stream per platform (web, iOS, Android) - Enable enhanced measurement for automatic tracking - Configure data retention (2 months default, 14 months max) - Enable Google Signals (for cross-device, if consented) ### 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 | ### 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 - add_payment_info - purchase, refund **Games:** - level_up, unlock_achievement - post_score, spend_virtual_currency Reference: https://support.google.com/analytics/answer/9267735 --- ## Custom Events ### gtag.js Implementation ```javascript // Basic event gtag('event', 'signup_completed', { '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 }] }); // User properties gtag('set', 'user_properties', { 'user_type': 'premium', 'plan_name': 'pro' }); // User ID (for logged-in users) gtag('config', 'GA_MEASUREMENT_ID', { 'user_id': 'USER_ID' }); ``` ### Google Tag Manager (dataLayer) ```javascript // Custom event dataLayer.push({ 'event': 'signup_completed', 'method': 'email', 'plan': 'free' }); // Set user properties dataLayer.push({ '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 }] } }); // Clear ecommerce before sending (best practice) dataLayer.push({ ecommerce: null }); dataLayer.push({ 'event': 'view_item', 'ecommerce': { // ... } }); ``` --- ## Conversions Setup ### Creating Conversions 1. **Collect the event** - Ensure event is firing in GA4 2. **Mark as conversion** - Admin > Events > Mark as conversion 3. **Set counting method**: - Once per session (leads, signups) - Every event (purchases) 4. **Import to Google Ads** - For conversion-optimized bidding ### Conversion Values ```javascript // Event with conversion value gtag('event', 'purchase', { 'value': 99.99, 'currency': 'USD' }); ``` Or set default value in GA4 Admin when marking conversion. --- ## Custom Dimensions and Metrics ### 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 ### Setup Steps 1. Admin > Data display > Custom definitions 2. Create dimension or metric 3. Choose scope: - **Event**: Per event (content_type) - **User**: Per user (account_type) - **Item**: Per product (product_category) 4. Enter parameter name (must match event parameter) ### 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 | --- ## Audiences ### Creating Audiences Admin > Data display > Audiences **Use cases:** - Remarketing audiences (export to Ads) - Segment analysis - Trigger-based events ### 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 --- ## Debugging ### DebugView Enable with: - URL parameter: `?debug_mode=true` - Chrome extension: GA Debugger - gtag: `'debug_mode': true` in config View at: Reports > Configure > DebugView ### Real-Time Reports Check events within 30 minutes: 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) --- ## Data Quality ### Filters Admin > Data streams > [Stream] > Configure tag settings > Define internal traffic **Exclude:** - Internal IP addresses - Developer traffic - Testing environments ### Cross-Domain Tracking For multiple domains sharing analytics: 1. Admin > Data streams > [Stream] > Configure tag settings 2. Configure your domains 3. List all domains that should share sessions ### Session Settings Admin > Data streams > [Stream] > Configure tag settings - Session timeout (default 30 min) - Engaged session duration (10 sec default) --- ## Integration with Google Ads ### Linking 1. Admin > Product links > Google Ads links 2. Enable auto-tagging in Google Ads 3. Import conversions in Google Ads ### Audience Export Audiences created in GA4 can be used in Google Ads for: - Remarketing campaigns - Customer match - Similar audiences -
gtm-implementation.md 7.4 KB
# Google Tag Manager Implementation Reference Detailed guide for implementing tracking via Google Tag Manager. ## Contents - Container Structure (tags, triggers, variables) - Naming Conventions - Data Layer Patterns - Common Tag Configurations (GA4 configuration tag, GA4 event tag, Facebook pixel) - Preview and Debug - Workspaces and Versioning - Consent Management - Advanced Patterns (tag sequencing, exception handling, custom JavaScript variables) ## Container Structure ### Tags Tags are code snippets that execute when triggered. **Common tag types:** - GA4 Configuration (base setup) - GA4 Event (custom events) - Google Ads Conversion - Facebook Pixel - LinkedIn Insight Tag - Custom HTML (for other pixels) ### Triggers Triggers define when tags fire. **Built-in triggers:** - Page View: All Pages, DOM Ready, Window Loaded - Click: All Elements, Just Links - Form Submission - Scroll Depth - Timer - Element Visibility **Custom triggers:** - Custom Event (from dataLayer) - Trigger Groups (multiple conditions) ### Variables 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 - RegEx tables - Constants --- ## Naming Conventions ### Recommended Format ``` [Type] - [Description] - [Detail] Tags: GA4 - Event - Signup Completed GA4 - Config - Base Configuration FB - Pixel - Page View HTML - LiveChat Widget Triggers: Click - CTA Button Submit - Contact Form View - Pricing Page Custom - signup_completed Variables: DL - user_id JS - Current Timestamp LT - Campaign Source Map ``` --- ## Data Layer Patterns ### Basic Structure ```javascript // Initialize (in <head> before GTM) window.dataLayer = window.dataLayer || []; // Push event dataLayer.push({ 'event': 'event_name', 'property1': 'value1', 'property2': 'value2' }); ``` ### Page Load Data ```javascript // Set on page load (before GTM container) window.dataLayer = window.dataLayer || []; dataLayer.push({ 'pageType': 'product', 'contentGroup': 'products', 'user': { 'loggedIn': true, 'userId': '12345', 'userType': 'premium' } }); ``` ### Form Submission ```javascript document.querySelector('#contact-form').addEventListener('submit', function() { dataLayer.push({ 'event': 'form_submitted', 'formName': 'contact', 'formLocation': 'footer' }); }); ``` ### Button Click ```javascript document.querySelector('.cta-button').addEventListener('click', function() { dataLayer.push({ 'event': 'cta_clicked', 'ctaText': this.innerText, 'ctaLocation': 'hero' }); }); ``` ### E-commerce Events ```javascript // 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 }] } }); // 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 }] } }); // 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 }] } }); ``` --- ## Common Tag Configurations ### GA4 Configuration Tag **Tag Type:** Google Analytics: GA4 Configuration **Settings:** - Measurement ID: G-XXXXXXXX - Send page view: Checked (for pageviews) - User Properties: Add any user-level dimensions **Trigger:** All Pages ### GA4 Event Tag **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 **Trigger:** Custom Event with event name match ### Facebook Pixel - Base **Tag Type:** Custom HTML ```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'); fbq('init', 'YOUR_PIXEL_ID'); fbq('track', 'PageView'); </script> ``` **Trigger:** All Pages ### Facebook Pixel - Event **Tag Type:** Custom HTML ```html <script> fbq('track', 'Lead', { content_name: '{{DL - form_name}}' }); </script> ``` **Trigger:** Custom Event - form_submitted --- ## Preview and Debug ### Preview Mode 1. Click "Preview" in GTM 2. Enter site URL 3. GTM debug panel opens at bottom **What to check:** - Tags fired on this event - Tags not fired (and why) - Variables and their values - Data layer contents ### 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 --- ## Workspaces and Versioning ### Workspaces Use workspaces for team collaboration: - Default workspace for production - Separate workspaces for large changes - Merge when ready ### 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 - New trigger: Custom Event - purchase - New variables: DL - transaction_id, DL - value - Tested: Chrome, Safari, Mobile ``` --- ## Consent Management ### Consent Mode Integration ```javascript // Default state (before consent) gtag('consent', 'default', { 'analytics_storage': 'denied', 'ad_storage': 'denied' }); // Update on consent function grantConsent() { gtag('consent', 'update', { 'analytics_storage': 'granted', 'ad_storage': 'granted' }); } ``` ### GTM Consent Overview 1. Enable Consent Overview in Admin 2. Configure consent for each tag 3. Tags respect consent state automatically --- ## Advanced Patterns ### Tag Sequencing **Setup tags to fire in order:** Tag Configuration > Advanced Settings > Tag Sequencing **Use cases:** - Config tag before event tags - Pixel initialization before tracking - Cleanup after conversion ### Exception Handling **Trigger exceptions** - Prevent tag from firing: - Exclude certain pages - Exclude internal traffic - Exclude during testing ### Custom JavaScript Variables ```javascript // Get URL parameter function() { var params = new URLSearchParams(window.location.search); return params.get('campaign') || '(not set)'; } // Get cookie value function() { var match = document.cookie.match('(^|;) ?user_id=([^;]*)(;|$)'); return match ? match[2] : null; } // Get data from page function() { var el = document.querySelector('.product-price'); return el ? parseFloat(el.textContent.replace('$', '')) : 0; } ```
-
-
CARD.md 4.5 KB
# Skill Card — Suede Analytics Tracking <!-- Generated by scripts/build-skill-cards.mjs — do not hand-edit. --> <!-- Regenerate with: npm run build:cards --> Release record for the `suede-analytics` skill, following the NVIDIA skill-card template (<https://docs.nvidia.com/skills/skill-cards>). It tells a reviewer what the skill does, who owns it, what it needs, what could go wrong, and what evidence backs the release — without requiring them to open the source first. ## Description Suede-owned measurement discipline for tracking plans, event and conversion instrumentation, UTM and campaign-parameter hygiene, and verification of what actually fires. Status: production. Ships in the `suede-skills` plugin (the full pack) at release 0.19.0; loads as a Claude Code / Codex agent skill from this directory's [SKILL.md](./SKILL.md). ## Owner Jason Colapietro, Suede Labs AI (<https://github.com/JasonColapietro>). Security contact: `info@suedeai.ai` per [SECURITY.md](../../SECURITY.md). ## License / Terms of Use MIT ([LICENSE](../../LICENSE)). The pack's combined license expression is `MIT AND BSD-3-Clause`; this skill bundles no third-party licensed material of its own. ## Use Case Target users: developers and creators running the skill inside a Claude Code or Codex CLI session. Use when setting up, auditing, or repairing analytics across web, product, paid, and lifecycle surfaces. Out of scope — experiment design or significance decisions (use suede-ab-testing), campaign optimization (use suede-ads), attribution models, model comparison, or cross-tool reconciliation (use suede-attribution), or revenue-process architecture (use suede-revops). ## Deployment Geography Global. The skill is a prompt-and-script package that runs locally inside the invoking agent session; it pins no region-specific service of its own. ## Requirements / Dependencies - A Claude Code or Codex CLI session with the `suede-skills` plugin installed (install options: <https://skills.suedeai.ai/>). - Bundled files loaded relative to this directory: `agents/` (1 file), `references/` (3 files). - Credentials: none are bundled or required by the skill files. Any tool or API credentials come from the host session; never paste credentials into skill files, prompts, or outputs. ## Known Risks and Mitigations - Risk: an agent treats a quality gate as autonomous authority. Mitigation: every gate in the pack is advisory — it changes what is reported, never what the user decided; only extreme-risk findings (data loss, credential exposure, legal/rights violations, payment mistakes, irreversible public damage) pause for the user's explicit choice. - Risk: a skill instruction is used to act outside its mandate. Mitigation: the hard limits in the skill body's "Boundaries" section, quoted below. From "Boundaries": - Do not claim an event, conversion, consent state, or attribution path works until a current debug or readback proves it. - Do not mutate production tags, properties, destinations, or consent settings without explicit authorization and a rollback plan. - Do not collect secrets, direct personal identifiers, or sensitive traits merely because a tool permits them. - Do not decide business success from a single dashboard number; state the metric definition, window, denominator, and exclusions. ## References - Skill source: [`skills/suede-analytics/SKILL.md`](./SKILL.md) - Rendered reference page: <https://skills.suedeai.ai/skills/suede-analytics.html> - Security policy and reviewed scanner exceptions: [SECURITY.md](../../SECURITY.md) and [`.plugin-scanner.toml`](../../.plugin-scanner.toml) at the repo root ## Skill Output Structured Markdown returned in the agent's response, shaped by the output contract defined in the skill body: "Output Format". The skill publishes, posts, and sends nothing without the user's explicit authorization; delivery decisions stay with the user. ## Skill Version 0.19.0 — the pack is single-versioned, so every skill releases together; see [VERSION](../../VERSION) and [CITATION.cff](../../CITATION.cff) for the release identifier this card describes. ## Ethical Considerations - The skill produces recommendations for a human decision-maker. Publishing, sending, payment, and rights decisions stay with the user. - Its gates require verifiable claims and honest reporting; do not use the skill to fabricate claims, evidence, metrics, or attribution. - Report suspected misuse or a security concern privately per [SECURITY.md](../../SECURITY.md); do not open a public issue for it. -
SKILL.md 10.7 KB
--- name: suede-analytics description: "Suede-owned measurement discipline for tracking plans, event and conversion instrumentation, UTM and campaign-parameter hygiene, and verification of what actually fires. Use when setting up, auditing, or repairing analytics across web, product, paid, and lifecycle surfaces. NOT FOR: experiment design or significance decisions (use suede-ab-testing), campaign optimization (use suede-ads), attribution models, model comparison, or cross-tool reconciliation (use suede-attribution), or revenue-process architecture (use suede-revops)." metadata: version: 2.0.1 --- # Suede Analytics Tracking Use this Suede measurement playbook to build tracking that supports auditable marketing and product decisions. ## Initial Assessment Check for `.agents/product-marketing.md` (or `.claude/product-marketing.md`, or the legacy `product-marketing-context.md`) and read it if present — the key conversions, the decisions the data has to serve, and the tools already in place drive every recommendation here. Then work the intake list under Task-Specific Questions below; ask only what the context file did not already answer. --- ## Production Changes: Halt Before Mutating Editing live tags, properties, destinations, or consent settings is the highest-consequence action in this skill, and Boundaries below forbids doing it without explicit authorization and a rollback plan. When a task requires one and you do not have both, halt in four parts: 1. Stop. Do not publish the container, edit the property, or change the consent configuration. 2. Name the blocker in one line ("publishing this GTM container version changes what fires for all live traffic; I have no rollback version identified"). 3. Offer 2-4 options (stage it in Preview and hand over the trace; write the change as a diff for the owner to publish; publish after the user names the rollback version; scope the change to a test environment). 4. Wait for the answer. Do not pick one and continue. The same halt applies to anything the Privacy and Compliance section below sends to legal or privacy review: an unresolved lawful-basis question blocks implementation, it does not get an assumption. --- ## Tracking Plan Framework ### Structure ``` 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 | **For comprehensive event lists**: See [references/event-library.md](references/event-library.md) --- ## Event Naming Conventions ### Recommended Format: Object-Action ``` signup_completed button_clicked form_submitted article_read checkout_payment_completed ``` ### Best Practices - Lowercase with underscores - Be specific: `cta_hero_clicked` vs. `button_clicked` - Include context in properties, not event name - Avoid spaces and special characters --- ## Essential Events ### Marketing Site | Event | Properties | |-------|------------| | cta_clicked | button_text, location | | form_submitted | form_type | | signup_completed | method, source | | demo_requested | - | ### Product/App | Event | Properties | |-------|------------| | onboarding_step_completed | step_number, step_name | | 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) --- ## Event Properties ### 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 | ### Best Practices - Avoid PII in properties - Reuse the Standard Properties names above rather than inventing per-event variants --- ## GA4 Implementation ### Quick Setup 1. Create GA4 property and data stream 2. Install gtag.js or GTM 3. Enable enhanced measurement 4. Configure custom events 5. Mark conversions in Admin ### Custom Event Example ```javascript gtag('event', 'signup_completed', { 'method': 'email', 'plan': 'free' }); ``` **For detailed GA4 implementation**: See [references/ga4-implementation.md](references/ga4-implementation.md) --- ## Google Tag Manager ### Container Structure | 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' }); ``` **For detailed GTM implementation**: See [references/gtm-implementation.md](references/gtm-implementation.md) --- ## UTM Parameter Strategy ### 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 | ### Naming Conventions - Lowercase everything - Use underscores or hyphens consistently - Be specific but concise: `blog_footer_cta`, not `cta1` - Document all UTMs in a spreadsheet --- ## Debugging and Validation ### Testing Tools | Tool | Use For | |------|---------| | GA4 DebugView | Real-time event monitoring | | GTM Preview Mode | Test triggers before publish | | Browser Extensions | Tag Assistant, dataLayer Inspector | ### Validation Checklist Each box closes on an artifact from the tools above, matched to the tool category's "Required current proof" in Tool Integrations below. An unchecked box does not mean "probably fine" — it means the tracking is reported as **unverified**, never as done. Inspecting the tag config is not proof; a readback is. - [ ] **Events firing on correct triggers** — a DebugView/live-events capture showing each event on the intended action - [ ] **Property values populating correctly** — a property readback per event, values matched against the tracking plan - [ ] **No duplicate events** — the same capture inspected for repeat fires (multiple containers, trigger firing twice) - [ ] **Works across browsers and mobile** — the readback repeated on at least one non-primary browser and one mobile session - [ ] **Conversions recorded correctly** — a source receipt plus a destination receipt for the conversion, not the source alone - [ ] **No PII leaking** — the payload of a real captured event read field by field, plus masking/sampling settings for session replay Report what was proven and what was not. "Instrumented" and "verified" are different claims; only the second one may cite this checklist. ### 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 | --- ## Privacy and Compliance Privacy, consent, retention, deletion, and identifier rules vary by jurisdiction, audience, data type, contract, and platform configuration. Do not treat this skill as legal advice or declare a universal consent rule. Before implementation: 1. Identify the actual markets, audience age, data categories, vendors, purposes, and data flows in scope. 2. Review current official regulator and platform requirements for those jurisdictions and configurations; obtain qualified privacy or legal review when the requirement is unclear or material. 3. Document the approved lawful basis or consent state, retention and deletion behavior, access controls, and prohibited properties. 4. Collect only approved data, avoid direct personal identifiers unless the reviewed design expressly allows them, and test both allowed and denied consent paths. --- ## Output Format ### Tracking Plan Document ```markdown # [Site/Product] Tracking Plan ## Overview - Tools: GA4, GTM - Last updated: [Date] ## Events | Event Name | Description | Properties | Trigger | |------------|-------------|------------|---------| | signup_completed | User completes signup | method, plan | Success page | ## Custom Dimensions | Name | Scope | Parameter | |------|-------|-----------| | user_type | User | user_type | ## Conversions | Conversion | Event | Counting | |------------|-------|----------| | Signup | signup_completed | Once per session | ``` --- ## Task-Specific Questions 1. What tools are you using (GA4, Mixpanel, etc.)? 2. What key actions do you want to track? 3. What decisions will this data inform? 4. Who implements - dev team or marketing? 5. Are there privacy/consent requirements? 6. What's already tracked? --- ## Tool Integrations This pack does not ship analytics connectors. Use the user's authorized property UI, debugger, export, API, or installed connector and verify current official documentation before constructing a call. | Tool category | Typical use | Required current proof | |---------------|-------------|------------------------| | Web analytics | Sessions, acquisition, web conversions | Debug event plus property readback | | Product analytics | Event funnels, cohorts, retention | Schema check plus sampled event readback | | Tag manager | Controlled client-side deployment | Preview trace plus published-version ID | | Customer data router | Send approved events to destinations | Source receipt plus destination receipt | | Session replay | Diagnose interaction friction | Consent, masking, sampling, and replay verification | --- ## Boundaries - Do not claim an event, conversion, consent state, or attribution path works until a current debug or readback proves it. - Do not mutate production tags, properties, destinations, or consent settings without explicit authorization and a rollback plan. - Do not collect secrets, direct personal identifiers, or sensitive traits merely because a tool permits them. - Do not decide business success from a single dashboard number; state the metric definition, window, denominator, and exclusions. ## Routing - Need experiment design or result interpretation -> use `suede-ab-testing`. - Need paid-campaign decisions -> use `suede-ads`. - Need attribution modeling, model comparison, or cross-tool reconciliation -> use `suede-attribution`. - Need pipeline and CRM attribution -> use `suede-revops`. - Need organic visibility diagnosis -> use `suede-seo-audit`. - From those skills, route instrumentation plans and firing verification back to `suede-analytics`.
Comments (0)
Sign in to join the conversation.
Reviews (0)
No reviews yet.
No comments yet.