Receber por email
← Voltar para o catálogo

utm-builder

UTM Parameter Strategy & Builder — naming conventions, GA4 channel grouping rules, auto-tagging, common mistakes, and BigQuery validation queries

59estrelas
Atualizado há 4 meses

Ver no GitHub ↗

Como adicionar

/plugin marketplace add cognyai/claude-code-marketing-skills

O comando exato pode variar conforme o repositório. Confira o README no GitHub.

Para o autor da skill

Cole no README do seu repo

Mostra que sua skill está catalogada na Skillteca, gera backlink e tráfego rastreável.

[![Skillteca](https://www.skillteca.com.br/api/badge/utm-builder/svg)](https://www.skillteca.com.br/skills/utm-builder)

Skills relacionadas

Ver todas de Marketing →

Alerta por categoria

Receba novas skills de Marketing toda segunda

1 email curto, só com as skills novas de Marketing. 4 minutos de leitura, sem spam, cancela com 1 clique.

Você confirma o email no primeiro envio. Sem spam. Cancela com 1 clique.

Ler descrição completa

UTM Parameter Strategy & Builder Reference

Complete guide to UTM parameter strategy, naming conventions, GA4 default channel grouping rules, auto-tagging behavior, common mistakes, and BigQuery validation queries for marketing attribution.

Full docs: https://cogny.com/docs/utm-strategy

Usage

/utm-builder                          # Full UTM strategy overview
/utm-builder naming conventions       # Show naming convention rules
/utm-builder channel grouping         # GA4 default channel grouping rules
/utm-builder meta ads                 # Meta Ads UTM template
/utm-builder audit                    # BigQuery validation queries
/utm-builder build google cpc         # Generate UTM URL for Google Ads

Instructions

You are a UTM strategy and marketing attribution expert. Use this reference to help users build correct UTM URLs, audit existing UTM naming conventions, understand GA4 default channel grouping rules, and validate attribution data in BigQuery.

When the user asks a question, find the relevant section below and provide precise, actionable answers. When building UTM URLs, always enforce lowercase and hyphen-separated naming conventions.

If the user provides a specific topic as an argument, focus on that area. Otherwise, provide an overview of UTM strategy fundamentals.

When connected to Cogny MCP tools, you can pull live GA4 data and Google Ads data to audit real UTM implementations.

The Five UTM Parameters

| Parameter | Required | Purpose | Example | |-----------|----------|---------|---------| | utm_source | Yes | Platform or publisher sending traffic | google, facebook, linkedin, newsletter | | utm_medium | Yes | Marketing channel type | cpc, paid-social, email, organic-social | | utm_campaign | Yes | Specific campaign name | spring-sale-2025, brand-awareness-q1 | | utm_term | No | Paid search keywords | running+shoes, crm+software | | utm_content | No | Creative variant or link placement | hero-banner, sidebar-cta, blue-variant |

Parameter Details

utm_source — Where did the click physically happen?

utm_source=google          # Google Ads or Google organic
utm_source=facebook        # Meta Ads (Facebook/Instagram)
utm_source=linkedin        # LinkedIn Ads or organic
utm_source=klaviyo         # Email via Klaviyo
utm_source=tiktok          # TikTok Ads
utm_source=partner-blog    # A specific referral partner

utm_medium — The channel type. This is the most important parameter for GA4 default channel grouping. If utm_medium is wrong, traffic lands in the wrong channel.

utm_medium=cpc             # Cost-per-click (paid search)
utm_medium=paid-social     # Paid social ads
utm_medium=email           # Email marketing
utm_medium=organic-social  # Organic social posts
utm_medium=display         # Display/banner ads
utm_medium=affiliate       # Affiliate traffic
utm_medium=referral        # Partner/referral traffic
utm_medium=video           # Video ads

utm_campaign — Campaign name with consistent structure:

utm_campaign=spring-sale-2025
utm_campaign=brand-awareness-q1-2025
utm_campaign=retargeting-cart-abandoners

utm_term — Keyword or targeting term:

utm_term=running-shoes
utm_term=best-crm-software

utm_content — Creative variant or placement:

utm_content=hero-image-v1
utm_content=sidebar-cta
utm_content=video-30s

GA4 Default Channel Grouping Rules

GA4 classifies every session into a default channel group based on source, medium, and campaign values. These rules determine how traffic appears in GA4 standard reports.

| Channel | Medium Must Match | |---------|-------------------| | Direct | source = (direct) AND medium is (not set) or (none) | | Organic Search | medium = organic | | Paid Search | medium matches ^(cpc\|ppc\|paidsearch)$ | | Display | medium matches ^(display\|cpm\|banner)$ | | Paid Social | medium matches ^(paid-social\|paidsocial\|paid_social)$ | | Organic Social | medium matches ^(social\|social-network\|social-media\|sm\|organic-social)$ | | Email | medium = email | | Affiliates | medium = affiliate | | Referral | medium = referral | | Audio | medium = audio | | SMS | medium matches ^(sms\|sms_message)$ | | Video | medium matches ^(video\|youtube)$ | | Cross-network | campaign name contains cross-network | | Unassigned | Does not match any rule above |

Critical: If utm_medium does not match any pattern above, traffic falls into Unassigned.

GA4 Source/Medium Mapping in BigQuery

UTM values appear in multiple locations in the GA4 BigQuery export:

| UTM Parameter | BigQuery Location | Scope | |---------------|-------------------|-------| | utm_source | traffic_source.source | User (first-touch) | | utm_medium | traffic_source.medium | User (first-touch) | | utm_campaign | traffic_source.name | User (first-touch) | | utm_source | Event param source on session_start | Session | | utm_medium | Event param medium on session_start | Session | | utm_campaign | Event param campaign on session_start | Session |

Session-level source/medium query:

SELECT
  (SELECT value.string_value FROM UNNEST(event_params) WHERE key = 'source') as session_source,
  (SELECT value.string_value FROM UNNEST(event_params) WHERE key = 'medium') as session_medium,
  (SELECT value.string_value FROM UNNEST(event_params) WHERE key = 'campaign') as session_campaign,
  COUNT(*) as sessions
FROM `project.analytics_123456789.events_*`
WHERE _TABLE_SUFFIX BETWEEN FORMAT_DATE('%Y%m%d', DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY))
                        AND FORMAT_DATE('%Y%m%d', CURRENT_DATE() - 1)
  AND event_name = 'session_start'
GROUP BY 1, 2, 3
ORDER BY sessions DESC

Naming Conventions

Rules

  1. Lowercase everything. GA4 is case-sensitive. Facebook and facebook are separate sources.
  2. Use hyphens as word separators. Not spaces (become %20) or special characters.
  3. No special characters. Stick to a-z, 0-9, and -.
  4. Be specific but concise. paid-social not ps.
  5. Include time identifiers in campaigns. spring-sale-2025 not spring-sale.

Recommended Taxonomy

| Parameter | Convention | Examples | |-----------|-----------|---------| | utm_source | Platform name, lowercase | google, facebook, linkedin, klaviyo | | utm_medium | Channel type matching GA4 rules | cpc, paid-social, email, display | | utm_campaign | name-date or name-quarter | spring-sale-2025, retarget-cart-q1 | | utm_term | Keyword or targeting | running-shoes, brand-keyword | | utm_content | Creative variant or placement | video-30s-v2, hero-banner, cta-red |

UTM Templates by Channel

Google Ads (Search)

?utm_source=google&utm_medium=cpc&utm_campaign={campaign_name}&utm_term={keyword}&utm_content={ad_variant}

Google Ads (Display)

?utm_source=google&utm_medium=display&utm_campaign={campaign_name}&utm_content={creative_variant}

Meta Ads (Facebook/Instagram)

utm_source=facebook&utm_medium=paid-social&utm_campaign={{campaign.name}}&utm_content={{ad.name}}&utm_term={{adset.name}}

Meta dynamic parameters: {{campaign.name}}, {{campaign.id}}, {{adset.name}}, {{adset.id}}, {{ad.name}}, {{ad.id}}, {{placement}}, {{site_source_name}}.

LinkedIn Ads

utm_source=linkedin&utm_medium=paid-social&utm_campaign={{CAMPAIGN_NAME}}&utm_content={{CREATIVE_NAME}}

LinkedIn macros: {{CAMPAIGN_ID}}, {{CAMPAIGN_NAME}}, {{CAMPAIGN_GROUP_ID}}, {{CAMPAIGN_GROUP_NAME}}, {{CREATIVE_ID}}, {{CREATIVE_NAME}}.

Email

?utm_source={esp_name}&utm_medium=email&utm_campaign={email_campaign_name}&utm_content={link_placement}

Organic Social

?utm_source={platform}&utm_medium=organic-social&utm_campaign={post_theme}&utm_content={post_variant}

Influencer

Compartilhar X LinkedIn