# UTM Parameters

> How AnyTrack uses UTM parameters for campaign attribution and reporting. Includes standard parameter reference, recommended tracking templates, and best practices.

UTM parameters are the foundation of how AnyTrack tracks, attributes, and reports on your marketing campaigns. This guide explains where UTM parameters are located, why AnyTrack provides recommended tracking templates, and how to use them for accurate attribution and reporting.

## Where Are UTM Parameters Located?

UTM parameters are appended to the end of your destination URL as query string parameters after the `?` character and separated by `&`.

**Example:**

```
https://example.com/landing-page?utm_source=facebook&utm_medium=cpc&utm_campaign=summer_sale&utm_id=123456
```

When a visitor clicks a link with UTM parameters, the AnyTrack [Tracking Tag](/docs/install-anytrack-tag) automatically captures these values and stores them with the visitor session data.

## Standard UTM Parameters

| Parameter | Required | Purpose | Example |
| --- | --- | --- | --- |
| `utm_source` | Yes | Identifies the traffic source | `google`, `facebook`, `newsletter` |
| `utm_medium` | Yes | Identifies the marketing channel type | `cpc`, `email`, `organic` |
| `utm_campaign` | Yes | Names the specific campaign | `summer_sale_2026` |
| `utm_id` | Recommended | Unique campaign ID for GA4 and AnyTrack | `123456789` |
| `utm_content` | No | Differentiates ad variations or ad sets | `banner_ad`, `sidebar_cta` |
| `utm_term` | No | Captures keywords or ad names | `running_shoes`, `ad_v1` |

UTM parameters are case-sensitive. Use lowercase consistently across all campaigns to avoid data fragmentation.

## Why Use Recommended UTM Templates

AnyTrack provides platform-specific tracking templates for every supported ad platform in your dashboard under **Tracking Tags → Ads Integrations**.

**Three reasons to use the recommended templates:**

1. **Accurate attribution**: Templates include standard UTM parameters and platform-specific ID parameters (`ad_id`, `adset_id`, `placement`). These ID-based parameters let AnyTrack match session data with campaign data from your ad platform API, producing accurate [Campaign Reports](/docs/campaign-report).

2. **Cross-platform compatibility**: Templates follow Google Analytics best practices so UTM data flows correctly into GA4, AnyTrack, and other analytics tools.

3. **Automatic verification**: For Meta Ads, AnyTrack can verify your ads and flag UTM issues automatically. This works only with the recommended template structure.

> ❗ **Important**
>
> Using non-standard UTM parameters costs you accurate attribution, campaign-level ROAS reporting, and audience building.

### Platform-Specific Templates

Each ad platform uses different dynamic tokens. AnyTrack provides pre-built templates:

- **Meta Ads**: Dynamic tokens and bulk campaign updates
- **Google Ads**: Account-level template with auto-tagging
- **TikTok Ads**: Platform-specific tokens and Click ID tagging
- **Microsoft Ads**: Custom template with platform-specific tokens

## Using Existing UTM Parameters

**AnyTrack maps known platform UTMs automatically.** Platforms like HubSpot and Mailchimp use their own UTM conventions. AnyTrack recognizes common patterns and maps them to correct campaign dimensions.

**Keep existing UTMs with conditions.** Preserve ID-based parameters (`utm_id`, `ad_id`, `adset_id`). You can customize name-based parameters (`utm_campaign`, `utm_content`, `utm_term`) to match your naming.

**Add ID parameters if missing.** Without ID-based parameters, AnyTrack tracks sessions but cannot align them with ad platform metrics (spend, impressions, ROAS).

**Verify your setup.** Use the **VERIFY ADS SETTINGS** button in your AnyTrack dashboard to check for UTM issues and get fix suggestions. See the [setup validation checklist](/docs/verify-and-validate-anytrack-setup) for full verification steps.

## How AnyTrack Uses UTM Parameters

AnyTrack uses UTM parameters for two functions: **attribution** and **campaign reporting**.

### Attribution

When a visitor lands from an ad, AnyTrack captures UTM parameters and stores them in the visitor session. When the visitor converts (purchase, lead, registration), AnyTrack attributes the conversion using **Last Ad Click** attribution.

This means:
- AnyTrack reads `utm_source` and `utm_medium` to identify which ad platform and channel drove the visit
- AnyTrack uses `utm_id`, `ad_id`, and `adset_id` to pinpoint the exact campaign, ad set, and ad
- AnyTrack sends the conversion back to the ad platform via Conversion API so the platform can optimize

Unlike ad platform self-attribution, AnyTrack applies attribution across all traffic sources, not just one platform. Learn more in the [Attribution Explained](/docs/anytrack-attribution-explained) guide.

### Campaign Reporting

The [Campaign Report](/docs/campaign-report) in AnyTrack merges three data sources:

1. **Ad platform data**: Impressions, clicks, spend pulled via API
2. **AnyTrack session data**: Visitor sessions with UTM parameters and customer journey events
3. **Server-side conversion data**: Purchase events, leads, and registrations from conversion sources

UTM parameters connect these datasets. When your template includes `utm_id`, `adset_id`, and `ad_id`, AnyTrack can drill down from campaign level to ad set to ad level with cost and revenue aligned.

## Best Practices

- **Use lowercase consistently**: `utm_source=Facebook` and `utm_source=facebook` are treated as separate sources
- **Do not use UTMs on internal links**: Adding UTM parameters to your own website links overwrites the original traffic source
- **Always include `utm_source`, `utm_medium`, and `utm_campaign`**: These three are minimum for any analytics platform
- **Add `utm_id` for ad campaigns**: GA4 and AnyTrack use this to match campaign-level data
- **Do not pass unique values in `utm_medium`**: Use standard values (`cpc`, `email`, `social`), not campaign IDs or ad names. Unique values break GA4 channel grouping
- **Test URLs before launching**: Click tagged URLs and verify parameters appear in your AnyTrack real-time dashboard
- **Avoid common mistakes**: See the [UTM Common Mistakes](/docs/utm-parameters-common-mistakes) guide for the seven most frequent UTM errors

<FaqAccordion
  title="UTM Parameters FAQ"
  icon="fa-duotone fa-circle-question"
  items={[
    {
      question: "Where are UTM parameters located in a URL?",
      answer: "UTM parameters are located at the end of your destination URL, after the ? character. Each parameter is a key-value pair (like <code>utm_source</code>=google) and multiple parameters are separated by the ampersand character. When a visitor clicks this URL, the AnyTrack Tracking Tag automatically reads these parameters from the browser address bar and stores them with the visitor session."
    },
    {
      question: "Why should I use the recommended UTM template instead of my own?",
      answer: "The recommended templates include both standard UTM parameters and platform-specific ID parameters (<code>utm_id</code>, <code>ad_id</code>, <code>adset_id</code>). These ID parameters are essential because AnyTrack uses them to match your visitor session data with the campaign data pulled from your ad platform API. Without them, your <a href='/docs/campaign-report'>Campaign Report</a> cannot align spend, impressions, and clicks with conversions and revenue at the ad set and ad level."
    },
    {
      question: "What if I am already using my own UTM parameters?",
      answer: "AnyTrack maps known platform UTM conventions automatically (including HubSpot, Mailchimp, and other common tools), so in many cases your existing UTMs will work. The key requirement is that your UTMs include ID-based parameters (<code>utm_id</code>, <code>ad_id</code>, <code>adset_id</code>) alongside the name-based ones. If your current setup does not include these, add them from the recommended template. Use the VERIFY ADS SETTINGS button in your <a href='/docs/verify-and-validate-anytrack-setup'>dashboard</a> to check for issues."
    },
    {
      question: "How does AnyTrack use UTM parameters for attribution?",
      answer: "AnyTrack captures UTM parameters when a visitor lands on your site and stores them in the visitor session. When a conversion happens (purchase, lead, registration), AnyTrack attributes it to the traffic source using a Last Ad Click attribution model. It uses <code>utm_source</code> and <code>utm_medium</code> to identify the channel, and <code>utm_id</code>, <code>ad_id</code>, <code>adset_id</code> to pinpoint the exact campaign, ad set, and ad. The conversion is then sent back to the ad platform via Conversion API for optimization."
    },
    {
      question: "Can I use UTM parameters alongside third-party tracking tools?",
      answer: "Yes. AnyTrack uses standard UTM parameters that are compatible with Google Analytics, HubSpot, and virtually all marketing platforms. Most third-party tracking tools use custom parameters (like <code>tw_id</code> or <code>h_adid</code>) that do not conflict with AnyTrack UTM parameters. You can safely append third-party parameters alongside the recommended template."
    }
  ]}
/>
