Skip to content

UTM Tracking & Campaign Attribution

Accurately measuring outbound traffic from ads and campaigns in external analytics tools (such as Google Analytics 4, Matomo, Plausible, and Piwik PRO) is essential for publishers and advertisers.

AdFuz Pro UTM Tracking provides automated, zero-touch parameter generation. It intercepts ad destinations at render time, injects clean and standardized UTM query parameters using dynamic tokens (like {campaign}, {ad}, and {ad_space}), preserves existing query strings and URL fragments, and ensures zero impact on ad load speed.


AdFuz Pro integrates directly into the ad rendering lifecycle via the adfuz/ad_rotator/selected_ad pipeline. When an ad is selected for display (whether as a banner, slider, sticky ad, inline shortcode, or global popup), AdFuz dynamically enriches the destination URL before serving it to the browser.

Ad Destination URL (Original):
https://example.com/shop/deals?ref=newsletter#top-deals
▼ AdFuz Pro UTM Engine Interceptor
Dynamic Token Resolution:
• utm_source = adfuz
• utm_medium = display
• utm_campaign = {campaign} ──► summer-sale-2026
• utm_content = {ad} ──► hero-banner-v2
• utm_term = {ad_space} ──► sidebar-leaderboard
▼ Query & Fragment Safe Reconstruction
Enriched Destination URL:
https://example.com/shop/deals?ref=newsletter&utm_source=adfuz&utm_medium=display&utm_campaign=summer-sale-2026&utm_content=hero-banner-v2&utm_term=sidebar-leaderboard#top-deals

To configure your global UTM parameters:

  1. In your WordPress admin, navigate to Ad Fuz → Settings → UTM Tracking.
  2. Toggle the Enable UTM Tracking master switch to ON.
  3. Define your parameter templates using static strings, dynamic tokens, or a combination of both.
  4. Select your Conflict Policy and Value Normalization mode.
  5. Review the Live URL Preview to verify the output in real time.
  6. Click Save Settings.
Parameter Recommended Template Description
utm_source adfuz or {ad_space} Identifies the traffic source or ad placement zone.
utm_medium banner, cpc, or display Identifies the marketing medium or ad format.
utm_campaign {campaign} The name of the campaign serving the ad.
utm_content {ad} Identifies the specific ad creative or variation name.
utm_term {ad_space} or {variant} Keyword, ad space placement, or A/B experiment variant.
utm_id {campaign_id} Numeric campaign or ad ID for automated CRM/GA4 imports.

You can insert dynamic tokens into any UTM parameter field. When an ad is displayed, AdFuz automatically resolves these tokens to their contextual values:

Dynamic Token Description Example Output
{campaign} Campaign slug/title summer-sale-2026
{campaign_id} Numeric database ID of the campaign 42
{ad} Ad creative slug/title hero-banner-blue-cta
{ad_id} Numeric database ID of the ad 108
{ad_space} Ad space slug/title header-top-leaderboard
{ad_space_id} Numeric database ID of the ad space 7
{experiment} Active A/B test experiment name (if applicable) headline-copy-test
{experiment_id} Numeric ID of the running experiment 12
{variant} A/B split testing variant name (variant-a, variant-b) variant-b
{variant_id} Numeric ID of the assigned variant 2
{device} Visitor device type detected at render desktop, mobile, tablet
{country} 2-letter ISO country code from Geo-IP US, GB, DE, IN
{date} Current server date in YYYY-MM-DD format 2026-09-18

4. Conflict Handling & Value Normalization

Section titled “4. Conflict Handling & Value Normalization”

When an ad’s destination URL already contains existing UTM parameters, you can choose how AdFuz handles the collision:

  • Override Mode (override): AdFuz replaces any conflicting pre-existing UTM parameters with your configured templates while preserving non-UTM query arguments (e.g., ?coupon=SAVE20 remains intact).
  • Keep Mode (keep): AdFuz respects existing UTM parameters in the original URL and only appends missing parameters from your settings.
  • Lowercase & Slugify (lowercase) (Recommended): Automatically strips invalid characters, replaces spaces with hyphens, and converts strings to lowercase ("Summer Sale 2026!" → "summer-sale-2026").
  • Preserve Case (preserve): Retains original capitalization while sanitizing unsafe URL characters.

The UTM settings page includes a real-time Live URL Preview:

  • Type or click any dynamic token badge to instantly inspect the generated URL structure.
  • 1-Click Copy: Copy sample generated tracking links directly to your clipboard.
  • Quick Presets: Select one-click templates tailored for:
    • Standard GA4 Preset: utm_source=adfuz&utm_medium=display&utm_campaign={campaign}&utm_content={ad}
    • Placement-Focused: utm_source={ad_space}&utm_medium=banner&utm_campaign={campaign}&utm_content={ad}
    • A/B Split Experimentation: utm_source=adfuz&utm_medium=cpc&utm_campaign={experiment}&utm_term={variant}&utm_content={ad}

Developers can register custom dynamic tokens using the adfuz_pro/utm/tokens WordPress filter hook:

// Register a custom dynamic token {user_role} for UTM tracking
add_filter( 'adfuz_pro/utm/tokens', function( $tokens, $context ) {
$current_user = wp_get_current_user();
$role = ! empty( $current_user->roles ) ? $current_user->roles[0] : 'guest';
$tokens['{user_role}'] = sanitize_title( $role );
return $tokens;
}, 10, 2 );

Does UTM tracking slow down ad rendering or page speed?

Section titled “Does UTM tracking slow down ad rendering or page speed?”

No. The AdFuz Pro UTM resolution engine is highly optimized and executes in memory during ad rotation, processing over 1,000 URL resolutions in under 26 milliseconds (~0.026ms per ad).

Are URL fragments (e.g. #pricing or #faq) preserved?

Section titled “Are URL fragments (e.g. #pricing or #faq) preserved?”

Yes. The URL parser isolates fragment identifiers prior to query string reconstruction and re-attaches them at the very end of the final destination URL.

Section titled “How does AdFuz handle mailto:, tel:, or javascript: links?”

Non-HTTP/HTTPS protocols and internal script links are automatically detected and safely bypassed without modification.

Does UTM tracking work with A/B split testing experiments?

Section titled “Does UTM tracking work with A/B split testing experiments?”

Yes. When an ad is running inside an active A/B Experiment, {experiment} and {variant} tokens automatically resolve to the specific variant (Variant A, Variant B, etc.) being served to the user.