Analytics

01What is it?
Provides expert guidance for guidance for analytics implementation and measurement. It stands out by giving marketing analytics a defined shape, so the agent asks for better context and returns a more usable result.
02Inputs
Context for marketing analytics: your goals, audience, constraints, and any source material the skill asks for.
03Output
A ready-to-use result for marketing analytics: the analysis, copy, or recommendations the agent produces.
Install-only

Install as a package

Installs this one skill package for your coding agent, including any supporting files that skill ships with — not every skill in the repository. Read the tutorial.

Terminal
$ npx skills add coreyhaines31/marketingskills --skill analytics

Skill instructions

The instruction file for this skill. The skill also includes other files you need to install to use it.

SKILL.md

Analytics Tracking

You are an expert in analytics implementation and measurement. Your goal is to help set up tracking that provides actionable insights for marketing and product decisions.

Initial Assessment

Check for product marketing context first: If .agents/product-marketing.md exists (or .claude/product-marketing.md, or the legacy product-marketing-context.md filename, in older setups), read it before asking questions. Use that context and only ask for information not already covered or specific to this task.

Before implementing tracking, understand:

  1. Business Context - What decisions will this data inform? What are key conversions?
  2. Current State - What tracking exists? What tools are in use?
  3. Technical Context - What's the tech stack? Any privacy/compliance requirements?

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

Tracking Plan Framework

Structure

Event Name | Category | Properties | Trigger | Notes
---------- | -------- | ---------- | ------- | -----

Event Types

TypeExamples
PageviewsAutomatic, enhanced with metadata
User ActionsButton clicks, form submissions, feature usage
System EventsSignup completed, purchase, subscription changed
Custom ConversionsGoal 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_clicked vs. button_clicked
  • Include context in properties, not event name
  • Avoid spaces and special characters
  • Document decisions

Essential Events

Marketing Site

EventProperties
cta_clickedbutton_text, location
form_submittedform_type
signup_completedmethod, source
demo_requested-

Product/App

EventProperties
onboarding_step_completedstep_number, step_name
feature_usedfeature_name
purchase_completedplan, value
subscription_cancelledreason

For full event library by business type: See references/event-library.md


Event Properties

Standard Properties

CategoryProperties
Pagepage_title, page_location, page_referrer
Useruser_id, user_type, account_id, plan_type
Campaignsource, medium, campaign, content, term
Productproduct_id, product_name, category, price

Best Practices

  • Use consistent property names
  • Include relevant context
  • Don't duplicate automatic properties
  • Avoid PII in properties

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

gtag('event', 'signup_completed', {
  'method': 'email',
  'plan': 'free'
});

For detailed GA4 implementation: See references/ga4-implementation.md


Google Tag Manager

Container Structure

ComponentPurpose
TagsCode that executes (GA4, pixels)
TriggersWhen tags fire (page view, click)
VariablesDynamic 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

ParameterPurposeExample
utm_sourceTraffic sourcegoogle, newsletter
utm_mediumMarketing mediumcpc, email, social
utm_campaignCampaign namespring_sale
utm_contentDifferentiate versionshero_cta
utm_termPaid search keywordsrunning+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

ToolUse For
GA4 DebugViewReal-time event monitoring
GTM Preview ModeTest triggers before publish
Browser ExtensionsTag Assistant, dataLayer Inspector

Validation Checklist

  • Events firing on correct triggers
  • Property values populating correctly
  • No duplicate events
  • Works across browsers and mobile
  • Conversions recorded correctly
  • No PII leaking

Common Issues

IssueCheck
Events not firingTrigger config, GTM loaded
Wrong valuesVariable path, data layer structure
Duplicate eventsMultiple 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
  • Integrate with consent management platform

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

  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

For implementation, see the tools registry (../../tools/REGISTRY.md). Key analytics tools:

ToolBest ForMCPGuide
GA4Web analytics, Google ecosystemga4.md (../../tools/integrations/ga4.md)
MixpanelProduct analytics, event tracking-mixpanel.md (../../tools/integrations/mixpanel.md)
AmplitudeProduct analytics, cohort analysis-amplitude.md (../../tools/integrations/amplitude.md)
PostHogOpen-source analytics, session replay-posthog.md (../../tools/integrations/posthog.md)
SegmentCustomer data platform, routing-segment.md (../../tools/integrations/segment.md)

Related Skills

  • ab-testing: For experiment tracking
  • seo-audit: For organic traffic analysis
  • cro: For conversion optimization (uses this data)
  • revops: For pipeline metrics, CRM tracking, and revenue attribution

Supporting file: evals/evals.json

{
  "skill_name": "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 the ab-testing skill 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 ab-testing is the right skill for the experiment framework.",
      "assertions": [
        "Recognizes overlap with A/B test setup",
        "References or defers to ab-testing skill",
        "May help with tracking implementation specifics",
        "Does not attempt to design the full experiment"
      ],
      "files": []
    }
  ]
}

Supporting file: references/event-library.md

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 NameDescriptionProperties
page_viewPage loaded (enhanced)page_title, page_location, content_group
scroll_depthUser scrolled to thresholddepth (25, 50, 75, 100)
outbound_link_clickedClick to external sitelink_url, link_text
internal_link_clickedClick within sitelink_url, link_text, location
video_playedVideo startedvideo_id, video_title, duration
video_completedVideo finishedvideo_id, video_title, duration

CTA & Form Interactions

Event NameDescriptionProperties
cta_clickedCall to action clickedbutton_text, cta_location, page
form_startedUser began formform_name, form_location
form_field_completedField filledform_name, field_name
form_submittedForm successfully sentform_name, form_location
form_errorForm validation failedform_name, error_type
resource_downloadedAsset downloadedresource_name, resource_type

Conversion Events

Event NameDescriptionProperties
signup_startedInitiated signupsource, page
signup_completedFinished signupmethod, plan, source
demo_requestedDemo form submittedcompany_size, industry
contact_submittedContact form sentinquiry_type
newsletter_subscribedEmail list signupsource, list_name
trial_startedFree trial beganplan, source

Product/App Events

Onboarding

Event NameDescriptionProperties
signup_completedAccount createdmethod, referral_source
onboarding_startedBegan onboarding-
onboarding_step_completedStep finishedstep_number, step_name
onboarding_completedAll steps donesteps_completed, time_to_complete
onboarding_skippedUser skipped onboardingstep_skipped_at
first_key_action_completedAha moment reachedaction_type

Core Usage

Event NameDescriptionProperties
session_startedApp session begansession_number
feature_usedFeature interactionfeature_name, feature_category
action_completedCore action doneaction_type, count
content_createdUser created contentcontent_type
content_editedUser modified contentcontent_type
content_deletedUser removed contentcontent_type
search_performedIn-app searchquery, results_count
settings_changedSettings modifiedsetting_name, new_value
invite_sentUser invited othersinvite_type, count

Errors & Support

Event NameDescriptionProperties
error_occurredError experiencederror_type, error_message, page
help_openedHelp accessedhelp_type, page
support_contactedSupport request madecontact_method, issue_type
feedback_submittedUser feedback givenfeedback_type, rating

Monetization Events

Pricing & Checkout

Event NameDescriptionProperties
pricing_viewedPricing page seensource
plan_selectedPlan chosenplan_name, billing_cycle
checkout_startedBegan checkoutplan, value
payment_info_enteredPayment submittedpayment_method
purchase_completedPurchase successfulplan, value, currency, transaction_id
purchase_failedPurchase failederror_reason, plan

Subscription Management

Event NameDescriptionProperties
trial_startedTrial beganplan, trial_length
trial_endedTrial expiredplan, converted (bool)
subscription_upgradedPlan upgradedfrom_plan, to_plan, value
subscription_downgradedPlan downgradedfrom_plan, to_plan
subscription_cancelledCancelledplan, reason, tenure
subscription_renewedRenewedplan, value
billing_updatedPayment method changed-

E-commerce Events

Browsing

Event NameDescriptionProperties
product_viewedProduct page viewedproduct_id, product_name, category, price
product_list_viewedCategory/list viewedlist_name, products[]
product_searchedSearch performedquery, results_count
product_filteredFilters appliedfilter_type, filter_value
product_sortedSort appliedsort_by, sort_order

Cart

Event NameDescriptionProperties
product_added_to_cartItem addedproduct_id, product_name, price, quantity
product_removed_from_cartItem removedproduct_id, product_name, price, quantity
cart_viewedCart page viewedcart_value, items_count

Checkout

Event NameDescriptionProperties
checkout_startedCheckout begancart_value, items_count
checkout_step_completedStep finishedstep_number, step_name
shipping_info_enteredAddress enteredshipping_method
payment_info_enteredPayment enteredpayment_method
coupon_appliedCoupon usedcoupon_code, discount_value
purchase_completedOrder placedtransaction_id, value, currency, items[]

Post-Purchase

Event NameDescriptionProperties
order_confirmedConfirmation viewedtransaction_id
refund_requestedRefund initiatedtransaction_id, reason
refund_completedRefund processedtransaction_id, value
review_submittedProduct reviewedproduct_id, rating

B2B / SaaS Specific Events

Team & Collaboration

Event NameDescriptionProperties
team_createdNew team/org madeteam_size, plan
team_member_invitedInvite sentrole, invite_method
team_member_joinedMember acceptedrole
team_member_removedMember removedrole
role_changedPermissions updateduser_id, old_role, new_role

Integration Events

Event NameDescriptionProperties
integration_viewedIntegration page seenintegration_name
integration_startedSetup beganintegration_name
integration_connectedSuccessfully connectedintegration_name
integration_disconnectedRemoved integrationintegration_name, reason

Account Events

Event NameDescriptionProperties
account_createdNew accountsource, plan
account_upgradedPlan upgradefrom_plan, to_plan
account_churnedAccount closedreason, tenure, mrr_lost
account_reactivatedReturned customerprevious_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

Supporting file: references/ga4-implementation.md

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)

EventDescriptionConfiguration
page_viewPage loadsAutomatic
scroll90% scroll depthToggle on/off
outbound_clickClick to external domainAutomatic
site_searchSearch query usedConfigure parameter
video_engagementYouTube video playsToggle on/off
file_downloadPDF, 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

// 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)

// 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

// 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

DimensionScopeParameterDescription
User TypeUseruser_typeFree, trial, paid
Content AuthorEventauthorBlog post author
Product CategoryItemitem_categoryE-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

Supporting file: references/gtm-implementation.md

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

// Initialize (in <head> before GTM)
window.dataLayer = window.dataLayer || [];

// Push event
dataLayer.push({
  'event': 'event_name',
  'property1': 'value1',
  'property2': 'value2'
});

Page Load Data

// 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

document.querySelector('#contact-form').addEventListener('submit', function() {
  dataLayer.push({
    'event': 'form_submitted',
    'formName': 'contact',
    'formLocation': 'footer'
  });
});

Button Click

document.querySelector('.cta-button').addEventListener('click', function() {
  dataLayer.push({
    'event': 'cta_clicked',
    'ctaText': this.innerText,
    'ctaLocation': 'hero'
  });
});

E-commerce Events

// 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

<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

<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

// 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

// 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;
}

Supporting file: tools/REGISTRY.md

Marketing Tools Registry

Quick reference for AI agents to discover tool capabilities and integration methods.

How to Use This Registry

  1. Find tools by category - Browse sections below for tools in each domain
  2. Check integration methods - See what APIs, MCPs, CLIs, or SDKs are available
  3. Read integration guides - Detailed setup and common operations in integrations/

Tool Index

ToolCategoryAPIMCPCLISDKGuide
ga4Analytics (clis/ga4.js)ga4.md (integrations/ga4.md)
mixpanelAnalytics- (clis/mixpanel.js)mixpanel.md (integrations/mixpanel.md)
amplitudeAnalytics- (clis/amplitude.js)amplitude.md (integrations/amplitude.md)
posthogAnalytics-posthog.md (integrations/posthog.md)
segmentAnalytics- (clis/segment.js)segment.md (integrations/segment.md)
adobe-analyticsAnalytics- (clis/adobe-analytics.js)adobe-analytics.md (integrations/adobe-analytics.md)
plausibleAnalytics- (clis/plausible.js)-plausible.md (integrations/plausible.md)
google-search-consoleSEO- (clis/google-search-console.js)google-search-console.md (integrations/google-search-console.md)
semrushSEO- (clis/semrush.js)-semrush.md (integrations/semrush.md)
ahrefsSEO- (clis/ahrefs.js)-ahrefs.md (integrations/ahrefs.md)
dataforseoSEO- (clis/dataforseo.js)dataforseo.md (integrations/dataforseo.md)
keywords-everywhereSEO- (clis/keywords-everywhere.js)-keywords-everywhere.md (integrations/keywords-everywhere.md)
rankparseSEO (clis/rankparse.js)-rankparse.md (integrations/rankparse.md)
clearbitData Enrichment- (clis/clearbit.js)clearbit.md (integrations/clearbit.md)
apolloData Enrichment- (clis/apollo.js)-apollo.md (integrations/apollo.md)
zoominfoData Enrichment (clis/zoominfo.js)-zoominfo.md (integrations/zoominfo.md)
clayData Enrichment (clis/clay.js)-clay.md (integrations/clay.md)
supermetricsData Aggregation (clis/supermetrics.js)-supermetrics.md (integrations/supermetrics.md)
couplerData Aggregation (clis/coupler.js)-coupler.md (integrations/coupler.md)
hubspotCRM-hubspot.md (integrations/hubspot.md)
salesforceCRM-salesforce.md (integrations/salesforce.md)
closeCRM- (clis/close.js)-close.md (integrations/close.md)
stripePaymentsstripe.md (integrations/stripe.md)
paddlePayments- (clis/paddle.js)paddle.md (integrations/paddle.md)
rewardfulReferral- (clis/rewardful.js)-rewardful.md (integrations/rewardful.md)
toltReferral- (clis/tolt.js)-tolt.md (integrations/tolt.md)
dub-coLinks- (clis/dub.js)dub-co.md (integrations/dub-co.md)
mention-meReferral- (clis/mention-me.js)-mention-me.md (integrations/mention-me.md)
partnerstackAffiliate- (clis/partnerstack.js)-partnerstack.md (integrations/partnerstack.md)
mailchimpEmail (clis/mailchimp.js)mailchimp.md (integrations/mailchimp.md)
customer-ioEmail- (clis/customer-io.js)customer-io.md (integrations/customer-io.md)
sendgridEmail- (clis/sendgrid.js)sendgrid.md (integrations/sendgrid.md)
resendEmail (clis/resend.js)resend.md (integrations/resend.md)
sequenzyEmail-sequenzy.md (integrations/sequenzy.md)
nitrosendEmail--nitrosend.md (integrations/nitrosend.md)
kitEmail- (clis/kit.js)kit.md (integrations/kit.md)
beehiivNewsletter- (clis/beehiiv.js)-beehiiv.md (integrations/beehiiv.md)
klaviyoEmail/SMS- (clis/klaviyo.js)klaviyo.md (integrations/klaviyo.md)
postmarkEmail- (clis/postmark.js)postmark.md (integrations/postmark.md)
brevoEmail/SMS- (clis/brevo.js)brevo.md (integrations/brevo.md)
activecampaignEmail/CRM- (clis/activecampaign.js)activecampaign.md (integrations/activecampaign.md)
twilioSMS/Voice-twilio.md (integrations/twilio.md)
plivoSMS/Voice--plivo.md (integrations/plivo.md)
postscriptSMS---postscript.md (integrations/postscript.md)
attentiveSMS---attentive.md (integrations/attentive.md)
audiencetapSMS/Email---audiencetap.md (integrations/audiencetap.md)
hunterEmail Outreach- (clis/hunter.js)-hunter.md (integrations/hunter.md)
snovEmail Outreach- (clis/snov.js)-snov.md (integrations/snov.md)
truelistEmail Verification-truelist.md (integrations/truelist.md)
githubDeveloper Intent- (clis/github-prospects.js)github.md (integrations/github.md)
firecrawlSite Scraping-firecrawl.md (integrations/firecrawl.md)
browserbaseSite Scraping-browserbase.md (integrations/browserbase.md)
lemlistEmail Outreach- (clis/lemlist.js)-lemlist.md (integrations/lemlist.md)
instantlyEmail Outreach- (clis/instantly.js)-instantly.md (integrations/instantly.md)
google-adsAds (clis/google-ads.js)google-ads.md (integrations/google-ads.md)
meta-adsAds- (clis/meta-ads.js)meta-ads.md (integrations/meta-ads.md)
linkedin-adsAds- (clis/linkedin-ads.js)-linkedin-ads.md (integrations/linkedin-ads.md)
tiktok-adsAds- (clis/tiktok-ads.js)tiktok-ads.md (integrations/tiktok-ads.md)
zapierAutomation (clis/zapier.js)zapier.md (integrations/zapier.md)
hotjarCRO- (clis/hotjar.js)-hotjar.md (integrations/hotjar.md)
optimizelyA/B Testing- (clis/optimizely.js)optimizely.md (integrations/optimizely.md)
calendlyScheduling- (clis/calendly.js)-calendly.md (integrations/calendly.md)
savvycalScheduling- (clis/savvycal.js)-savvycal.md (integrations/savvycal.md)
typeformForms- (clis/typeform.js)typeform.md (integrations/typeform.md)
intercomMessaging- (clis/intercom.js)intercom.md (integrations/intercom.md)
outreachSales Engagement (clis/outreach.js)-outreach.md (integrations/outreach.md)
crossbeamPartner Ecosystem (clis/crossbeam.js)-crossbeam.md (integrations/crossbeam.md)
introwPartner Ecosystem---introw.md (integrations/introw.md)
pendoProduct Analytics- (clis/pendo.js)-pendo.md (integrations/pendo.md)
similarwebCompetitive Intelligence- (clis/similarweb.js)-similarweb.md (integrations/similarweb.md)
exaAI Search (clis/exa.js)exa.md (integrations/exa.md)
firehoseCompetitive Intelligence---firehose.md (integrations/firehose.md)
sparktoroAudience Research----sparktoro.md (integrations/sparktoro.md)
rb2bVisitor Identification---rb2b.md (integrations/rb2b.md)
gongRevenue Intelligence---gong.md (integrations/gong.md)
airopsAI Content- (clis/airops.js)-airops.md (integrations/airops.md)
bufferSocial- (clis/buffer.js)-buffer.md (integrations/buffer.md)
wistiaVideo- (clis/wistia.js)-wistia.md (integrations/wistia.md)
heygenVideo-heygen.md (integrations/heygen.md)
hyperframesVideo--hyperframes.md (integrations/hyperframes.md)
trustpilotReviews- (clis/trustpilot.js)-trustpilot.md (integrations/trustpilot.md)
g2Reviews- (clis/g2.js)-g2.md (integrations/g2.md)
onesignalPush- (clis/onesignal.js)onesignal.md (integrations/onesignal.md)
demioWebinar- (clis/demio.js)-demio.md (integrations/demio.md)
livestormWebinar- (clis/livestorm.js)-livestorm.md (integrations/livestorm.md)
shopifyCommerce-shopify.md (integrations/shopify.md)
wordpressCMS-wordpress.md (integrations/wordpress.md)
webflowCMS-webflow.md (integrations/webflow.md)
sanityHeadless CMS-sanity.md (integrations/sanity.md)
contentfulHeadless CMS-contentful.md (integrations/contentful.md)
strapiHeadless CMS-strapi.md (integrations/strapi.md)
composioIntegration Layercomposio.md (integrations/composio.md)
cognyIntegration Layer---cogny.md (integrations/cogny.md)

By Category

Analytics

Track user behavior, measure conversions, and analyze marketing performance.

ToolBest ForMCP Available
ga4Web analytics, Google ecosystem
mixpanelProduct analytics, event tracking-
amplitudeProduct analytics, cohort analysis-
posthogOpen-source analytics, session replay-
segmentCustomer data platform, routing-
adobe-analyticsEnterprise analytics-
plausiblePrivacy-focused analytics-

Agent recommendation: Start with GA4 if using Google ecosystem. Use Mixpanel or Amplitude for deeper product analytics. Plausible for privacy-focused sites.

SEO

Search engine optimization tools for keyword research, rank tracking, and site audits.

ToolBest ForNotes
google-search-consoleFree, authoritative search dataDirect from Google
semrushCompetitive analysis, keyword researchComprehensive
ahrefsBacklink analysis, content researchBest for links
dataforseoSERP tracking, backlinks, on-page auditsComprehensive API
keywords-everywhereQuick keyword research, traffic estimatesCredit-based
rankparseCheap, agent-friendly backlinks + domain dataCredit-based, MCP available

Agent recommendation: Google Search Console is essential (free). Add Semrush or Ahrefs for competitive research. DataForSEO for programmatic SERP data. Keywords Everywhere for quick keyword lookups. RankParse for agent workflows where per-call cost matters — backlinks, domain authority, and tech stack at a fraction of enterprise pricing.

CRM

Customer relationship management and sales tools.

ToolBest ForCLI Available
hubspotSMB, marketing + sales alignment
salesforceEnterprise, complex sales processes
closeSMB, high-velocity sales (clis/close.js)

Agent recommendation: HubSpot for startups/SMBs. Close for high-velocity inside sales. Salesforce for enterprise.

Payments

Payment processing and subscription management.

ToolBest ForMCP Available
stripeSaaS subscriptions, developer-friendly
paddleSaaS billing with tax handling-

Agent recommendation: Stripe is the default for SaaS. Paddle for built-in tax compliance.

Referral & Affiliate

Tools for referral programs, affiliate tracking, and partner management.

ToolBest ForStripe Integration
rewardfulStripe-native affiliate programs
toltSaaS affiliate programs
mention-meEnterprise referral programs
dub-coLink tracking, attribution-
partnerstackEnterprise partner programs

Agent recommendation: Rewardful or Tolt for Stripe-based SaaS. PartnerStack for enterprise partner programs. Dub.co for link attribution.

Email

Email marketing, transactional email, and automation platforms.

ToolBest ForMCP Available
mailchimpSMB email marketing
customer-ioBehavior-based messaging-
sendgridTransactional email at scale-
resendDeveloper-friendly transactional
sequenzyLifecycle email, sequences, transactional email
kitCreator/newsletter focused-
beehiivNewsletter platform-
klaviyoE-commerce email + SMS-
postmarkDeliverability-focused transactional-
brevoEmail + SMS, popular in EU-
activecampaignEmail automation + CRM-

Agent recommendation: Resend for transactional (dev-friendly). Sequenzy for lifecycle email, sequences, and agent-driven email marketing. Postmark for deliverability. Customer.io for advanced automation. Kit for creators. Beehiiv for newsletters. Klaviyo for e-commerce email/SMS. ActiveCampaign for email + CRM combo.

SMS / Messaging

SMS and MMS marketing platforms and programmable messaging APIs.

ToolBest ForMCP Available
klaviyoDTC ecom already on Klaviyo email-
postscriptShopify DTC, SMS-first depth-
attentiveMid-market+ DTC, full-service-
twilioCustom API builds, transactional, dev-first-
plivoTwilio alternative, lower per-send cost-
audiencetapDTC with AI-forward creative + on-pack QR opt-in-
brevoEU SMB email + SMS combo-
customer-ioBehavior-based SMS automation-

Agent recommendation: Klaviyo SMS for ecom already on Klaviyo email. Postscript for Shopify-first depth. Attentive for mid-market+ wanting concierge support. Twilio (or Plivo for lower cost) for custom builds and transactional/auth. AudienceTap when AI creative or on-pack QR opt-in matters.

Advertising

Paid advertising platforms and campaign management.

ToolBest ForMCP Available
google-adsSearch intent, high-intent traffic
meta-adsDemand gen, visual products, B2C-
linkedin-adsB2B, job title targeting-
tiktok-adsYounger demographics, video-

Agent recommendation: Google Ads for search intent. Meta for demand generation. LinkedIn for B2B.

Automation

Workflow automation and integration platforms.

ToolBest ForMCP Available
zapierNo-code integrations + SDK for 8,000+ apps

Agent recommendation: Zapier SDK for agents that need to interact with any app directly. Zaps for always-on automations.

CRO & A/B Testing

Conversion rate optimization, heatmaps, and experimentation.

ToolBest ForNotes
hotjarHeatmaps, recordings, surveysVisual behavior data
optimizelyA/B testing, feature flagsEnterprise experimentation

Agent recommendation: Hotjar for understanding user behavior. Optimizely for running experiments.

Scheduling

Booking and appointment scheduling tools.

ToolBest ForNotes
calendlyMeeting scheduling, lead genMost popular
savvycalPersonalized schedulingDeveloper-friendly

Agent recommendation: Calendly for general use. SavvyCal for personalized booking experiences.

Forms & Surveys

Form builders and survey platforms.

ToolBest ForNotes
typeformInteractive forms, surveysConversational UX

Agent recommendation: Typeform for engaging forms and surveys.

Messaging

In-app messaging, chat, and customer communication.

ToolBest ForNotes
intercomIn-app messaging, support, product toursFull customer platform

Agent recommendation: Intercom for in-app messaging and customer support.

Social Media

Social media scheduling, management, and analytics.

ToolBest ForNotes
bufferSocial scheduling, analyticsMulti-platform

Agent recommendation: Buffer for scheduling and analytics across social platforms.

Video

Video hosting, creation, and AI generation.

ToolBest ForNotes
wistiaVideo hosting, marketing analyticsBest for marketing video hosting
heygenAI avatars, talking-head videosMCP server available
hyperframesProgrammatic video from HTML/CSSOpen source, agent-native

Agent recommendation: HeyGen for AI avatar videos (MCP-enabled). Hyperframes for templated, data-driven video from code. Wistia for hosting and analytics.

Data Enrichment

Company and person data enrichment for sales and marketing.

ToolBest ForNotes
clearbitCompany/person enrichmentNow HubSpot Breeze
apolloB2B prospecting, email findingLarge database
zoominfoB2B contacts, intent dataEnterprise-grade
clayWaterfall enrichment, outbound75+ data providers

Agent recommendation: Clearbit for enrichment. Apollo for prospecting and outbound. ZoomInfo for enterprise B2B data with intent signals. Clay for waterfall enrichment across multiple providers.

Email Verification

Pre-outreach email deliverability validation.

ToolBest ForNotes
truelistBulk + single email deliverability validationReturns email_state (ok / email_invalid / risky / unknown / accept_all) + email_sub_state. MCP server + 7-language SDKs available.

Agent recommendation: Truelist for any prospect list before outreach — Apollo/ZoomInfo/Hunter data accuracy is typically 60–80%, validation is non-negotiable to keep sender reputation healthy.

Developer Intent / GitHub

Discovery channel for dev-tool SaaS prospecting via GitHub stargazers, forkers, and watchers.

ToolBest ForNotes
githubStargazers / forks / watchers of competitor or adjacent reposPublic API; pair with Apollo/Clay/Hunter for email enrichment

Agent recommendation: Use github-prospects.js CLI to pull stargazers/forks of 3–5 anchor repos (competitors, category leaders, complementary tools). Filter to users with company field set, then enrich missing emails via Apollo or Hunter, then validate via Truelist before outreach.

Site Scraping (single-target only)

Programmatic page extraction for individual public business sites — not for the platforms hosting prospects (Google Maps, LinkedIn, Yelp, Apollo, etc.).

ToolBest ForNotes
firecrawlPage → clean markdown / structured extractionAPI + MCP; lower overhead for "just give me the content"
browserbaseReal Chromium when rendering, interaction, or session state is requiredAPI + MCP (Stagehand); use when Firecrawl can't handle the page

Agent recommendation: Default to Firecrawl for static-ish pages and structured extraction. Use Browserbase when the site requires JS rendering, form interaction, cookie consent, or auth — and when you want session recordings for debugging. For both: discovery happens on platforms (manual browser); extraction happens on the prospect's own website URL. Don't point either tool at LinkedIn, Google Maps, Yelp, or similar.

Reviews

Review management and social proof platforms.

ToolBest ForNotes
trustpilotConsumer business reviewsMost recognized
g2Software/B2B reviewsBest for SaaS

Agent recommendation: Trustpilot for consumer products. G2 for B2B software.

Push Notifications

Push notification delivery platforms.

ToolBest ForNotes
onesignalMulti-channel push notificationsWeb + mobile

Agent recommendation: OneSignal for web and mobile push notifications.

Webinar

Webinar and virtual event platforms.

ToolBest ForNotes
demioMarketing webinarsSimple, focused
livestormVideo engagement, webinarsFull event platform

Agent recommendation: Demio for marketing-focused webinars. Livestorm for full event engagement.

Sales Engagement

Sales engagement and outreach automation platforms.

ToolBest ForNotes
outreachEnterprise sales engagementSequences, tasks, analytics

Agent recommendation: Outreach for enterprise sales teams managing multi-touch sequences at scale.

Product Analytics

Product analytics, feature adoption tracking, and in-app guidance.

ToolBest ForNotes
pendoFeature adoption, in-app guidesProduct-led growth

Agent recommendation: Pendo for tracking feature adoption and delivering targeted in-app guidance.

Competitive Intelligence

Traffic analytics, competitor benchmarking, and market research.

ToolBest ForNotes
similarwebWebsite traffic, competitor analysisTraffic sources, keywords

Agent recommendation: Similarweb for competitor traffic analysis and market benchmarking.

Audience Research

Audience intelligence and behavioral research tools.

ToolBest ForNotes
sparktoroAudience affinities, behavioral dataClickstream + social data

Agent recommendation: SparkToro for discovering where your ICP spends time — what they read, watch, listen to, follow, and search for. Essential for customer research, content strategy, and media buying decisions.

Visitor Identification

Website visitor de-anonymization for B2B sales and marketing.

ToolBest ForNotes
rb2bPerson-level visitor ID, intent signalsLinkedIn profiles, emails, page-level data

Agent recommendation: RB2B for identifying anonymous B2B website visitors and routing high-intent visitors to outreach tools. Pairs well with Clay for enrichment and Instantly/Lemlist for cold email.

Revenue Intelligence

Sales conversation analytics, call recording, and deal intelligence.

ToolBest ForNotes
gongCall recording, transcript analysis, deal insightsREST API, 10k API calls/day

Agent recommendation: Gong for mining sales call transcripts for customer research, competitive intelligence, and coaching insights. Essential for revenue attribution and win/loss analysis.

AI Content

AI-powered content generation and optimization platforms.

ToolBest ForNotes
airopsAI content workflows, SEO contentFlow-based automation

Agent recommendation: AirOps for building AI content workflows that generate SEO-optimized content at scale.

AI Search

AI-powered web search APIs built for LLMs and agents. Return structured results with on-demand text, highlights, and summaries.

ToolBest ForNotes
exaNeural/semantic web search, content research, competitor discoverySearch + findSimilar + Contents; MCP and SDKs available

Agent recommendation: Exa for neural search over the open web — content research, competitor/similar-page discovery, link prospecting, news monitoring, and audience research. Pairs well with seo-audit, content-strategy, and competitor-profiling skills.

Partner Ecosystem

Partner data sharing, co-sell, and ecosystem management.

ToolBest ForNotes
crossbeamAccount overlaps, co-sellNow part of Reveal
introwPartner management, deal registration, QBRsMCP-enabled PRM

Agent recommendation: Crossbeam for identifying partner account overlaps and co-sell opportunities. Introw for full partner relationship management — partner pipeline, commissions, tasks, and automated business review prep.

Email Outreach

Cold email outreach and email finding tools for link building and sales prospecting.

ToolBest ForNotes
hunterEmail finding, domain searchLargest email database
snovEmail finding, drip campaignsBuilt-in sequences
lemlistCold email campaignsPersonalization features
instantlyCold email at scaleEmail warmup built-in

Agent recommendation: Hunter for finding emails. Lemlist or Instantly for sending cold email campaigns. Snov for combined finding + outreach.

Data Aggregation

Marketing data pipeline tools that connect multiple platforms for unified reporting.

ToolBest ForNotes
supermetricsCross-platform data pulling200+ connectors
couplerAutomated data flows to sheets/BIScheduled pipelines

Agent recommendation: Supermetrics for pulling data from multiple marketing platforms into unified reports. Coupler.io for automated data flows to spreadsheets and BI tools.

Commerce & CMS

E-commerce platforms and content management systems.

ToolBest ForCLI Available
shopifyE-commerce, product sales
wordpressBlogs, content sites
webflowDesign-focused marketing sites
sanityHeadless CMS, structured content
contentfulEnterprise headless CMS, multi-locale
strapiOpen-source headless CMS, self-hosted

Agent recommendation: Shopify for e-commerce. Webflow for marketing sites. WordPress for blogs. For headless CMS: Sanity for developer-flexible content, Contentful for enterprise multi-locale, Strapi for self-hosted/budget-conscious. See headless CMS guide (../skills/content-strategy/references/headless-cms.md) for selection criteria.


CLI Tools

Zero-dependency, single-file Node.js CLIs for tools that don't ship their own. See clis/README.md for install instructions and usage.

All CLIs follow a consistent pattern:

  • No dependencies — Node 18+ only, uses native fetch
  • JSON output — pipe to jq, save to file, or use in scripts
  • Env var auth — set {TOOL}_API_KEY and go
  • Consistent commands{tool} <resource> <action> [options]

MCP-Enabled Tools

These tools have Model Context Protocol servers available, enabling direct agent interaction:

  • ga4 - Google Analytics 4 data access
  • stripe - Payment and subscription management
  • mailchimp - Email campaign management
  • google-ads - Ad campaign management
  • resend - Transactional email sending
  • zapier - Workflow automation + SDK for 8,000+ app integrations
  • zoominfo - B2B contacts and intent data
  • clay - Data enrichment and outbound automation
  • supermetrics - Cross-platform marketing data
  • coupler - Marketing data pipelines
  • outreach - Sales engagement sequences
  • crossbeam - Partner ecosystem data
  • introw - Partner relationship management
  • exa - AI-powered web search for LLMs and agents

To use MCP tools, ensure the appropriate MCP server is configured in your environment.

Composio Integration

Composio (integrations/composio.md) provides managed OAuth and pre-built connectors for 500+ tools via a single MCP server. It adds MCP access to tools that don't have native MCP servers, including HubSpot, Salesforce, Meta Ads, LinkedIn Ads, Google Sheets, Slack, Notion, and more.

Use Composio when you need MCP access to OAuth-heavy tools. Prefer native MCP servers (GA4, Stripe, Mailchimp, etc.) when available — they have deeper coverage.

Cogny Integration

Cogny (integrations/cogny.md) is a hosted MCP gateway focused on marketing channels — one federated MCP URL with managed OAuth across every channel you've connected. Narrower than Composio (marketing-only) and useful when you want SEO, paid social, and privacy-friendly analytics behind a single MCP login.

  • Setup: connect channels at cogny.com (https://cogny.com), then in Claude.ai go to Settings → Connectors → Add custom connector and paste https://app.cogny.com/mcp
  • Channels: Search Console, Bing Webmaster, Semrush, LinkedIn Ads, Reddit Ads, TikTok Ads, Plausible, Fathom
  • Pricing: Solo plan starts at $9/mo (7-day trial)

Use Cogny when you only need marketing channels and want to avoid running your own OAuth proxy. Prefer native APIs when you need deep, custom control of a single tool.


Quick Start by Use Case

Setting up analytics tracking

  1. Read ga4.md (integrations/ga4.md) for web analytics
  2. Read segment.md (integrations/segment.md) if routing to multiple tools

Launching a referral program

  1. Read rewardful.md (integrations/rewardful.md) or tolt.md (integrations/tolt.md) for Stripe-based programs
  2. Read dub-co.md (integrations/dub-co.md) for link tracking

Setting up email automation

  1. Read customer-io.md (integrations/customer-io.md) for behavior-based automation
  2. Read resend.md (integrations/resend.md) for transactional email

Running email outreach for backlinks

  1. Read hunter.md (integrations/hunter.md) for finding emails
  2. Read lemlist.md (integrations/lemlist.md) or instantly.md (integrations/instantly.md) for sending campaigns

Running paid ads

  1. Read google-ads.md (integrations/google-ads.md) for search campaigns
  2. Read meta-ads.md (integrations/meta-ads.md) for social campaigns

Supporting file: tools/integrations/amplitude.md

Amplitude

Product analytics platform for user behavior, retention, and experimentation.

Capabilities

IntegrationAvailableNotes
APIHTTP API for events, User Profile API, Export API
MCP-Not available
CLI-Not available
SDKJavaScript, iOS, Android, Python, etc.

Authentication

  • HTTP API: API Key (public for events)
  • Export/Dashboard API: API Key + Secret Key

Common Agent Operations

Track event

POST https://api2.amplitude.com/2/httpapi

{
  "api_key": "{api_key}",
  "events": [{
    "user_id": "user_123",
    "event_type": "signup_completed",
    "event_properties": {
      "plan": "pro"
    },
    "user_properties": {
      "email": "user@example.com"
    }
  }]
}

Batch events

POST https://api2.amplitude.com/batch

{
  "api_key": "{api_key}",
  "events": [
    {"user_id": "user_1", "event_type": "pageview"},
    {"user_id": "user_2", "event_type": "signup"}
  ]
}

Get user activity

GET https://amplitude.com/api/2/useractivity?user={user_id}

Authorization: Basic {base64(api_key:secret_key)}

Export events

GET https://amplitude.com/api/2/export?start=20240101T00&end=20240131T23

Authorization: Basic {base64(api_key:secret_key)}

Get retention data

GET https://amplitude.com/api/2/retention?e={"event_type":"signup_completed"}&start=20240101&end=20240131

Authorization: Basic {base64(api_key:secret_key)}

Query with SQL (Snowflake)

For Amplitude customers with SQL access:

SELECT event_type, COUNT(*) as count
FROM events
WHERE event_time > '2024-01-01'
GROUP BY event_type

JavaScript SDK

// Initialize
amplitude.init('API_KEY');

// Identify user
amplitude.setUserId('user_123');

// Set user properties
const identify = new amplitude.Identify();
identify.set('plan', 'pro');
amplitude.identify(identify);

// Track event
amplitude.track('Feature Used', {
  feature_name: 'export'
});

Key Concepts

  • Events - User actions with properties
  • User Properties - Persistent user attributes
  • Cohorts - Behavioral segments
  • Funnels - Multi-step conversion analysis
  • Retention - User return patterns
  • Journeys - User path analysis

When to Use

  • Tracking product analytics
  • Analyzing user funnels
  • Cohort analysis and retention
  • Experimentation and A/B testing
  • User journey mapping

Rate Limits

  • HTTP API: 1000 events/second
  • Export API: 360 requests/hour

Relevant Skills

  • analytics
  • ab-testing
  • onboarding

Supporting file: tools/integrations/ga4.md

Google Analytics 4 (GA4)

Web analytics platform for tracking user behavior, conversions, and marketing performance.

Capabilities

IntegrationAvailableNotes
APIData API for reports, Admin API for configuration
MCPAvailable via Google Analytics MCP server
CLI-Use gcloud for some operations
SDKgtag.js, Google Analytics SDK for mobile

Authentication

  • Type: OAuth 2.0 or Service Account
  • Scopes: https://www.googleapis.com/auth/analytics.readonly (read), https://www.googleapis.com/auth/analytics.edit (write)
  • Setup: Create credentials in Google Cloud Console

Common Agent Operations

Run a report (Data API)

POST https://analyticsdata.googleapis.com/v1beta/properties/{property_id}:runReport

{
  "dateRanges": [{"startDate": "30daysAgo", "endDate": "today"}],
  "dimensions": [{"name": "sessionSource"}],
  "metrics": [{"name": "sessions"}, {"name": "conversions"}]
}

Get real-time data

POST https://analyticsdata.googleapis.com/v1beta/properties/{property_id}:runRealtimeReport

{
  "dimensions": [{"name": "country"}],
  "metrics": [{"name": "activeUsers"}]
}

List conversion events

GET https://analyticsadmin.googleapis.com/v1beta/properties/{property_id}/conversionEvents

Create a conversion event

POST https://analyticsadmin.googleapis.com/v1beta/properties/{property_id}/conversionEvents

{
  "eventName": "purchase"
}

Client-Side Tracking

Send custom event (gtag.js)

gtag('event', 'signup_completed', {
  'method': 'email',
  'plan': 'free'
});

Send event via Measurement Protocol

POST https://www.google-analytics.com/mp/collect?measurement_id={measurement_id}&api_secret={api_secret}

{
  "client_id": "client_123",
  "events": [{
    "name": "purchase",
    "params": {
      "value": 99.99,
      "currency": "USD"
    }
  }]
}

Key Dimensions & Metrics

Common Dimensions

  • sessionSource - Traffic source
  • sessionMedium - Traffic medium
  • sessionCampaignName - Campaign name
  • landingPage - Entry page
  • deviceCategory - Device type
  • country - User country

Common Metrics

  • sessions - Total sessions
  • activeUsers - Active users
  • newUsers - New users
  • conversions - Conversion events
  • engagementRate - Engaged sessions rate
  • averageSessionDuration - Session duration

When to Use

  • Tracking website traffic and user behavior
  • Measuring marketing campaign performance
  • Setting up conversion tracking
  • Analyzing user journeys and funnels
  • Attribution modeling

Rate Limits

  • Data API: 10 requests per second per property
  • Admin API: Varies by endpoint
  • Measurement Protocol: 1M hits/day for free tier

Relevant Skills

  • analytics
  • ab-testing
  • seo-audit
  • cro

Supporting file: tools/integrations/mixpanel.md

Mixpanel

Product analytics platform for tracking user behavior and retention.

Capabilities

IntegrationAvailableNotes
APIIngestion API, Query API, Data Export
MCP-Not available
CLI-Not available
SDKJavaScript, iOS, Android, Python, etc.

Authentication

  • Ingestion: Project token (public)
  • Query API: Service Account (username:secret as Basic auth)
  • Export: API Secret

Common Agent Operations

Track event (Ingestion API)

POST https://api.mixpanel.com/track

{
  "event": "signup_completed",
  "properties": {
    "token": "{project_token}",
    "distinct_id": "user_123",
    "plan": "pro",
    "time": 1705312800
  }
}

Set user profile

POST https://api.mixpanel.com/engage

{
  "$token": "{project_token}",
  "$distinct_id": "user_123",
  "$set": {
    "$email": "user@example.com",
    "$name": "John Doe",
    "plan": "pro"
  }
}

Query events (Query API)

POST https://mixpanel.com/api/2.0/insights

{
  "project_id": {project_id},
  "bookmark_id": null,
  "params": {
    "events": [{"event": "signup_completed"}],
    "time_range": {
      "from_date": "2024-01-01",
      "to_date": "2024-01-31"
    }
  }
}

Get funnel data

GET https://mixpanel.com/api/2.0/funnels?funnel_id={funnel_id}&from_date=2024-01-01&to_date=2024-01-31

Export raw events

GET https://data.mixpanel.com/api/2.0/export?from_date=2024-01-01&to_date=2024-01-01

Get retention data

GET https://mixpanel.com/api/2.0/retention?from_date=2024-01-01&to_date=2024-01-31&retention_type=birth&born_event=signup_completed

JavaScript SDK

// Initialize
mixpanel.init('YOUR_TOKEN');

// Identify user
mixpanel.identify('user_123');

// Set user properties
mixpanel.people.set({
  '$email': 'user@example.com',
  'plan': 'pro'
});

// Track event
mixpanel.track('Feature Used', {
  'feature_name': 'export'
});

Key Concepts

  • Events - User actions (signup, purchase, etc.)
  • Properties - Attributes on events
  • User Profiles - Persistent user data
  • Cohorts - Saved user segments
  • Funnels - Conversion sequences
  • Retention - User return patterns

When to Use

  • Tracking product usage events
  • Analyzing conversion funnels
  • Measuring feature adoption
  • Retention analysis
  • User segmentation

Rate Limits

  • Ingestion: No hard limit (batch recommended)
  • Query API: Varies by plan

Relevant Skills

  • analytics
  • ab-testing
  • onboarding

Supporting file: tools/integrations/posthog.md

PostHog

Open-source product analytics with session replay and feature flags.

Capabilities

IntegrationAvailableNotes
APICapture API, Query API, Feature Flags API
MCP-Not available
CLIposthog CLI for local development
SDKJavaScript, Python, Ruby, Go, etc.

Authentication

  • Type: API Key (Personal or Project)
  • Header: Authorization: Bearer {api_key}
  • For capture: Project API Key in payload

Common Agent Operations

Capture event

POST https://app.posthog.com/capture/

{
  "api_key": "{project_api_key}",
  "event": "signup_completed",
  "distinct_id": "user_123",
  "properties": {
    "plan": "pro",
    "$current_url": "https://example.com/signup"
  }
}

Batch events

POST https://app.posthog.com/batch/

{
  "api_key": "{project_api_key}",
  "batch": [
    {"event": "pageview", "distinct_id": "user_1"},
    {"event": "signup", "distinct_id": "user_2"}
  ]
}

Get person by distinct_id

GET https://app.posthog.com/api/projects/{project_id}/persons/?distinct_id=user_123

Authorization: Bearer {api_key}

Query events (HogQL)

POST https://app.posthog.com/api/projects/{project_id}/query/

{
  "query": {
    "kind": "HogQLQuery",
    "query": "SELECT event, count() FROM events WHERE timestamp > now() - interval 7 day GROUP BY event ORDER BY count() DESC LIMIT 10"
  }
}

Get feature flag value

POST https://app.posthog.com/decide?v=3

{
  "api_key": "{project_api_key}",
  "distinct_id": "user_123"
}

Get insights

GET https://app.posthog.com/api/projects/{project_id}/insights/

Authorization: Bearer {api_key}

Get session recordings

GET https://app.posthog.com/api/projects/{project_id}/session_recordings/

Authorization: Bearer {api_key}

JavaScript SDK

// Initialize
posthog.init('PROJECT_API_KEY', {
  api_host: 'https://app.posthog.com'
});

// Identify user
posthog.identify('user_123', {
  email: 'user@example.com',
  plan: 'pro'
});

// Track event
posthog.capture('signup_completed', {
  method: 'email'
});

// Check feature flag
if (posthog.isFeatureEnabled('new-pricing')) {
  // Show new pricing
}

Key Features

  • Event tracking - Product analytics
  • Session replay - Watch user sessions
  • Feature flags - Control feature rollout
  • A/B testing - Built-in experiments
  • HogQL - SQL-like query language
  • Self-hostable - Run on your infrastructure

When to Use

  • Product analytics with privacy focus
  • Session replay for UX insights
  • Feature flag management
  • Self-hosted analytics needs
  • Open-source requirements

Rate Limits

  • Cloud: 10,000 events/second
  • Self-hosted: Unlimited

Relevant Skills

  • analytics
  • ab-testing
  • onboarding

Supporting file: tools/integrations/segment.md

Segment

Customer data platform for collecting, routing, and activating user data.

Capabilities

IntegrationAvailableNotes
APITracking API, Profile API, Config API
MCP-Not available
CLI-Not available
SDKanalytics.js, iOS, Android, server libraries

Authentication

  • Tracking: Write Key (per source)
  • API: Access Token (OAuth 2.0)
  • Header: Authorization: Bearer {access_token}

Common Agent Operations

Track event

POST https://api.segment.io/v1/track

Authorization: Basic {base64(write_key:)}

{
  "userId": "user_123",
  "event": "signup_completed",
  "properties": {
    "plan": "pro",
    "method": "email"
  }
}

Identify user

POST https://api.segment.io/v1/identify

Authorization: Basic {base64(write_key:)}

{
  "userId": "user_123",
  "traits": {
    "email": "user@example.com",
    "name": "John Doe",
    "plan": "pro"
  }
}

Track page view

POST https://api.segment.io/v1/page

Authorization: Basic {base64(write_key:)}

{
  "userId": "user_123",
  "name": "Pricing",
  "properties": {
    "title": "Pricing - Example",
    "url": "https://example.com/pricing"
  }
}

Batch events

POST https://api.segment.io/v1/batch

Authorization: Basic {base64(write_key:)}

{
  "batch": [
    {"type": "identify", "userId": "user_1", "traits": {"plan": "free"}},
    {"type": "track", "userId": "user_1", "event": "signup"}
  ]
}

Get user profile (Profile API)

GET https://profiles.segment.com/v1/spaces/{space_id}/collections/users/profiles/user_id:{user_id}/traits

Authorization: Basic {base64(access_token:)}

Get user events

GET https://profiles.segment.com/v1/spaces/{space_id}/collections/users/profiles/user_id:{user_id}/events

Authorization: Basic {base64(access_token:)}

JavaScript SDK

// Initialize
analytics.load('WRITE_KEY');

// Identify user
analytics.identify('user_123', {
  email: 'user@example.com',
  plan: 'pro'
});

// Track event
analytics.track('Feature Used', {
  feature_name: 'export'
});

// Page view
analytics.page('Pricing');

Key Concepts

  • Sources - Where data comes from (website, app, server)
  • Destinations - Where data goes (analytics, CRM, ads)
  • Tracking Plan - Schema for events and properties
  • Protocols - Data governance and validation
  • Personas - Unified user profiles
  • Audiences - Computed user segments

Common Destinations

  • Analytics: GA4, Mixpanel, Amplitude
  • CRM: HubSpot, Salesforce
  • Email: Customer.io, Mailchimp
  • Ads: Google Ads, Meta
  • Data Warehouse: BigQuery, Snowflake

When to Use

  • Centralizing event tracking
  • Routing data to multiple tools
  • Maintaining consistent tracking
  • Building unified user profiles
  • Syncing audiences across platforms

Rate Limits

  • 500 requests/second per source
  • Batch up to 500KB or 32KB per event

Relevant Skills

  • analytics
  • emails
  • ads

How do I install Analytics in Cursor, Claude Code, or Codex?

Run npx skills add coreyhaines31/marketingskills --skill analytics in the project where you want it, then ask your agent for the skill by name. The --skill flag installs only Analytics, not every skill in the repository.

Where does Analytics come from and what license is it under?

Analytics comes from the coreyhaines31/marketingskills repository on GitHub. That repository has 35.7K GitHub stars. The skill is published under the MIT license.

Prefer plain text? Read the Analytics guide as markdown.