Use Case Concepts
What is campaign tracking?
Campaign tracking is the practice of appending identifying parameters to URLs used in marketing campaigns, enabling analytics platforms to attribute website visits, conversions, and revenue to the specific campaigns, channels, and creative executions that drove them. By adding structured parameter strings to destination URLs before distributing them in emails, advertisements, social media posts, and other marketing channels marketers can answer the fundamental marketing question, which campaigns are driving valuable traffic and generating returns?
Without campaign tracking all organic and direct traffic appears as undifferentiated sessions in web analytics, a visitor who clicked an email link and a visitor who clicked a paid search ad both appear as direct or organic traffic with no indication of what prompted the visit. Campaign tracking transforms this undifferentiated traffic into attributed sessions, each visit tagged with its source, medium, campaign name, and other relevant dimensions that enable performance analysis at any level of granularity.
The most widely used campaign tracking standard is UTM parameters, Urchin Tracking Module parameters, originally developed by Urchin Software and adopted by Google Analytics after Google’s acquisition of Urchin in 2005. UTM parameters are query string parameters appended to destination URLs that Google Analytics and virtually all other analytics platforms recognise and use for campaign attribution. ?utm_source=email&utm_medium=newsletter&utm_campaign=spring-sale appended to any URL tags that visit as originating from an email newsletter in a spring sale campaign.
For redirect management campaign tracking creates specific considerations, tracking parameter URLs are technically distinct from their clean base URLs and require explicit canonical tag management to prevent duplicate content issues while preserving analytics attribution. Understanding how campaign tracking works and how it interacts with redirects enables implementing both correctly without sacrificing either analytics accuracy or SEO health.
UTM parameters
UTM parameters are the standard mechanism for campaign tracking, five defined parameters that communicate different dimensions of campaign attribution.
utm_source: identifies the traffic source, where the visitor came from. utm_source=google for Google paid search. utm_source=newsletter for an email newsletter. utm_source=facebook for Facebook advertising. utm_source=partner-site for a specific referring website. The source parameter is the most fundamental campaign dimension, it identifies which platform or property the visitor came from.
utm_medium: identifies the marketing medium, the type of channel through which the visitor arrived. utm_medium=cpc for cost-per-click paid advertising. utm_medium=email for email marketing. utm_medium=social for social media. utm_medium=organic for organic search, though organic search traffic typically does not use UTM parameters. utm_medium=banner for display advertising. The medium parameter categorises the channel type, enabling cross-platform comparisons within the same medium.
utm_campaign: identifies the specific campaign. utm_campaign=spring-sale-2024 for a spring sale campaign. utm_campaign=new-product-launch for a product launch. utm_campaign=brand-awareness-q1 for a brand awareness initiative. The campaign parameter is the primary dimension for campaign performance analysis, enabling comparison between different campaigns running simultaneously or over time.
utm_term: identifies the paid keyword that triggered the ad, primarily used for paid search campaigns. utm_term=redirect+management+tool identifies the search query that triggered a paid search ad. The term parameter enables keyword-level performance analysis for paid search campaigns, identifying which keywords drive the most valuable traffic.
utm_content: differentiates between multiple links or creative executions within the same campaign. utm_content=blue-button vs utm_content=red-button for an A/B test. utm_content=hero-image vs utm_content=sidebar-link for different placements within the same email. The content parameter enables creative testing and placement analysis within a single campaign.
Complete UTM example: a URL with all five parameters:
How UTM parameters work technically
UTM parameters are query string parameters, they follow the ? character in the URL and are processed entirely by the analytics platform JavaScript running on the destination page.
Client-side parameter reading: when a user lands on a page containing UTM parameters the analytics tracking code, Google Analytics tag, Google Tag Manager, or other analytics platform, reads the UTM parameter values from the URL. The tracking code extracts the parameter values and stores them as session attributes, associating all pageviews, events, and conversions during that session with the UTM-identified campaign.
Cookie persistence: analytics platforms store UTM parameter values in first-party cookies, typically persisting for the session or for a configured attribution window. If a user arrives via a UTM-tagged link and then navigates to other pages within the site all subsequent pageviews in that session are attributed to the same campaign, the UTM values persist through the session even as the URL changes.
Session attribution: the UTM values captured when a session begins are attributed to all subsequent activity in that session. A user who arrives via utm_campaign=spring-sale, browses several pages, and purchases is attributed as a spring-sale conversion in analytics, even though the purchase confirmation page URL may not include the UTM parameters.
Last-touch attribution: Google Analytics 4 and most analytics platforms default to last-touch attribution, if a user arrives via multiple UTM-tagged sessions the most recent session’s UTM values are attributed to conversions. A user who visited via an email campaign last month and returns via a paid search campaign this week and purchases is attributed to the paid search campaign under last-touch attribution.
Campaign tracking and redirects
Campaign tracking and redirect management interact in several important ways, each requiring careful handling to preserve both tracking accuracy and redirect functionality.
UTM parameters in redirect destinations: when configuring redirects from old URLs to new URLs the redirect destination should typically not include UTM parameters. Adding UTM parameters to redirect destinations contaminates the traffic attribution, all visitors to the redirect source URL, regardless of their original traffic source, appear in analytics as arriving via the UTM-attributed campaign. A redirect from old-domain.com/product to new-domain.com/product?utm_source=redirect incorrectly tags every visitor who follows the redirect as a redirect-attributed session.
Redirect destinations should be clean canonical URLs, without UTM parameters, allowing each visitor’s actual traffic source attribution to be preserved through their original session UTM values.
UTM-tagged redirect sources: campaign links that use a redirect source URL as the destination, pointing to a URL that redirects, carry the UTM parameters through the redirect to the destination. old-domain.com/product?utm_source=email&utm_medium=newsletter: where old-domain.com/product redirects to new-domain.com/product: may or may not preserve the UTM parameters through the redirect depending on how the redirect is configured.
Redirect rules should preserve query string parameters, passing the UTM parameters through to the destination URL. A redirect that strips query strings from redirect destinations loses UTM attribution when UTM-tagged URLs are used as redirect sources. Most redirect configurations preserve query strings by default, but verifying this behaviour for any redirect platform handling marketing campaign traffic is important.
301 redirects breaking analytics attribution: 301 permanent redirects cached in browsers present a specific analytics attribution problem for UTM-tracked links. When a user clicks a UTM-tagged URL that 301-redirects to a destination the browser caches the redirect. On subsequent visits the browser goes directly to the destination without visiting the redirect source, the UTM parameters in the redirect source URL are never seen by the destination page’s analytics code. Subsequent visits attributed to that UTM campaign are under-counted because cached 301 redirects bypass the UTM parameter processing.
Using 302 temporary redirects for analytics-tracked redirect sources prevents this caching problem, every click goes through the redirect source URL and processes the UTM parameters before reaching the destination.
Canonical tags for UTM parameter URLs
UTM parameter URLs are technically distinct URLs, example.com/page?utm_source=email is a different URL from example.com/page. Without explicit canonical signals search engines may index UTM-parameterised URLs independently, creating duplicate content issues and fragmenting SEO equity.
Canonical tag implementation for UTM variants: pages accessible at UTM-parameterised URLs should include canonical tags pointing to the clean base URL. <link rel="canonical" href="https://example.com/page"> on the page at https://example.com/page?utm_source=email tells search engines that the clean URL is the canonical version, consolidating equity from all UTM variants to the clean URL.
Most well-configured CMS platforms automatically generate canonical tags pointing to the URL without query parameters, ensuring UTM parameters do not create duplicate content issues. Verifying canonical tag behaviour with UTM parameters appended, checking that canonical tags point to the clean URL regardless of query string, is an important technical SEO verification step.
robots.txt for UTM parameter crawling: some implementations block UTM parameter patterns from crawling through robots.txt:
This prevents Googlebot from crawling UTM-parameterised URLs entirely, reducing crawl budget waste. However robots.txt blocking without canonical tags does not prevent indexation of UTM URLs that are externally linked, canonical tags are still necessary. The combination of canonical tags and robots.txt blocking provides comprehensive UTM parameter management.
Building UTM-tracked redirect links
Campaign tracking links are typically built with URL builder tools, ensuring consistent parameter formatting across campaigns.
Google’s Campaign URL Builder: Google provides a free Campaign URL Builder tool that generates correctly formatted UTM parameter strings. Entering the base URL, source, medium, campaign, term, and content produces a complete tracking URL ready for use in campaigns. The tool handles URL encoding of parameter values, ensuring special characters and spaces are correctly encoded.
Spreadsheet-based UTM management: organisations running many campaigns benefit from maintaining a UTM parameter tracking spreadsheet, documenting all active and historical UTM parameter combinations, their corresponding campaigns, and the performance data associated with each. Centralised UTM management prevents parameter inconsistency, where the same campaign is tracked with slightly different parameter values, utm_campaign=SpringSale vs utm_campaign=spring-sale vs utm_campaign=spring_sale: creating fragmented analytics data.
UTM parameter naming conventions: consistent naming conventions are essential for clean analytics data. Lowercase parameters, utm_campaign=spring-sale rather than utm_campaign=Spring-Sale: prevent case-sensitive fragmentation. Hyphens rather than spaces or underscores as word separators, spring-sale rather than spring sale or spring_sale: maintain consistency. Documented abbreviations for common sources and mediums, fb for Facebook, ig for Instagram, yt for YouTube, enable consistent short parameter values across campaigns.
Beyond UTM, other tracking parameters
UTM parameters are the most widely used campaign tracking standard but other tracking parameters serve similar purposes in different contexts.
gclid, Google Click Identifier: automatically appended by Google Ads to destination URLs when auto-tagging is enabled. ?gclid=TeSter-abc123xyz456 identifies a specific Google Ads click, enabling Google Analytics to attribute sessions to specific Google Ads campaigns, ad groups, and keywords without manual UTM parameter setup. gclid values are unique per click, they should not be included in canonical tags and should be treated as tracking parameters in URL canonicalization configuration.
fbclid, Facebook Click Identifier: automatically appended by Facebook to URLs shared in Facebook content and ads. ?fbclid=IwAR2_abc123 identifies a Facebook-sourced click. Similar to gclid, fbclid values are unique per click and should be excluded from canonical URLs.
msclkid, Microsoft Click Identifier: Microsoft Advertising’s equivalent of gclid, automatically appended to destination URLs for Bing Ads campaigns with auto-tagging enabled.
Custom tracking parameters: organisations building custom analytics or attribution systems may implement their own tracking parameters. ?ref=homepage-banner for internal click tracking. ?source=partner-name for partner referral tracking. Custom parameters serve the same purpose as UTM parameters within custom analytics implementations.
Campaign tracking best practices for redirect management
Consistent parameter preservation in redirects: all redirect rules handling marketing campaign traffic should preserve query string parameters, passing UTM parameters through to redirect destinations. Test redirect behaviour with UTM-parameterised source URLs to verify parameter preservation.
Avoiding UTM parameters in redirect destinations: configure redirect destinations as clean canonical URLs, without UTM parameters. UTM attribution should come from the original click source, not from redirect configurations.
Canonical tags on all parameterised landing pages: verify that all campaign landing pages include canonical tags pointing to the clean URL, regardless of what UTM parameters are appended. Test canonical tag behaviour by checking the canonical URL returned when UTM parameters are present.
Monitoring UTM traffic through redirects: use analytics to verify that UTM-attributed traffic flowing through redirects is correctly attributed. Sessions arriving via redirect chains should show the original UTM source, not the redirect as the source. Unexpected traffic source attribution in analytics may indicate UTM parameter stripping in redirect configurations.