LOG IN OR SIGN UP
Log in to your account
Sign up

How To Pass UTM Tracking To A Third Party Page

10 October 2025 | 0 comments | Posted by Che Kohler in nichemarket Advice

pass utm to third party website

UTM parameters are the unsung heroes of digital marketing, providing invaluable insights into where your website traffic comes from and how effective your campaigns are. But what happens when your user journey takes them off your primary domain and onto a third-party site or a different subdomain?

This is where things can get a little tricky, and understanding how UTMs behave in these scenarios is crucial for accurate analytics.

The Power of Persistent Tracking: Why Pass UTMs to a Third-Party Site?

Imagine you're running a campaign that drives users to a landing page on your site. From there, some users click a button that takes them to a partner's website to complete a purchase, fill out a form, or download a resource.

If your UTM parameters stop at your site, you lose visibility into the origin of those valuable conversions on the third-party platform. This is where passing UTMs becomes essential.

By appending your original UTM parameters to the outbound link that directs users to the third-party site, you can:

  • Attribute Conversions Accurately: Know exactly which of your campaigns led to a specific action on a partner's site. Was it your email newsletter, a paid ad, or an organic social post?
  • Optimise Partner Performance: If you're driving traffic to an affiliate or partner, understanding which of your campaigns perform best for their conversions allows for more effective collaboration and optimisation.
  • Create a Seamless User Journey Analysis: Get a holistic view of the user's path, from their initial interaction with your content all the way through to an action on another domain.

Think of it like a digital breadcrumb trail. You want those crumbs to lead all the way to the final destination, no matter whose kitchen it is!

The UTM Challenge: Why Don't They Persist Across Different Domains?

Here's the fundamental reason why UTM parameters don't automatically carry over when a user clicks from yourdomain.com to thirdpartysite.com: web browsers and analytics tools treat each domain as a separate entity.

When a user lands on your site with UTMs in the URL

(e.g., yourdomain.com?utm_source=email&utm_medium=newsletter),

your analytics platform (like Google Analytics) reads those parameters and records them for that session on yourdomain.com.

However, when the user navigates to a completely different domain, say thirdpartysite.com, it's a new "origin."

The browser doesn't automatically transfer the query parameters from the previous URL to the new, unrelated URL.

Visualising the Domain Barrier:

Imagine your website as one house, and a third-party site as a completely different house. UTMs are like a guest list for your house. When guests leave your house and go to another, they don't automatically take your guest list with them. You need to explicitly give them a new "invitation" with the relevant details for the next house.

Here's a simple diagram to illustrate this concept:

UTM passing on across domains issue

Essentially, each new top-level domain (.com, .org, .net, etc.) acts as a boundary for automatic UTM passing.

The Nuance of Secondary Domains (Subdomains) vs. Different Domains

It's important to distinguish between entirely different domains and secondary domains, often referred to as subdomains.

Different Domains: yourdomain.com to anotherdomain.com – UTMs will NOT pass automatically. This is the scenario we've been discussing. Secondary Domains (Subdomains) under the same top-level domain: blog.yourdomain.com to shop.yourdomain.com – In this case, UTMs often can persist automatically if your analytics tracking (like Google Analytics) is configured correctly for "cross-domain tracking" within the same primary domain.

This usually involves ensuring your GA property is set up to track all subdomains under yourdomain.com.

Why the difference?

Analytics platforms can be configured to recognise subdomains, like blog.yourdomain.com and shop.yourdomain.com as part of the same overall property or entity. They share a common root domain, making it easier for cookies and tracking information to be shared.

However, nextdomain.com and partnerdomain.com are distinct entities, requiring a more explicit approach.

How to Pass UTM Tracking to a Third-Party Site

Since UTMs don't automatically jump the domain barrier, you need to manually append them to the URLs that lead to the third-party site. This is often done dynamically.

Here’s the general process:

  1. Capture the Original UTMs: When a user lands on your page, your website code needs to read the UTM parameters from the current URL. This can be done using JavaScript.
  2. Identify Outbound Links: Determine which links on your page point to the third-party site you want to track.
  3. Append UTMs to Outbound Links: Before the user clicks, modify these outbound links to include the captured UTM parameters.

A Simplified JavaScript Example:

Let's say a user lands on yourdomain.com/landing?utm_source=ad&utm_medium=cpc.

On this page, you have a link to thirdpartysite.com/product.

You would use JavaScript to:

Capture the UTM parameters

  1. Head over to your Google Tag Manager Account and create a new tag
  2. Select the custom HTML tag template
  3. Give your tag a name - cjs - Append UTM to Outbound Links - Tag
  4. Paste in the following script

(function() { // Get current UTM parameters function getUTMParams()

{ var search = window.location.search;

if (!search) return {};

var params = new URLSearchParams(search); var utmParams = {};

var utmKeys = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content']; utmKeys.forEach(function(key)

{ if (params.has(key)) { utmParams[key] = params.get(key); } }); return utmParams; }

// Append UTM params to a URL function appendUTM(url, utmParams)

{ if (Object.keys(utmParams).length === 0) return url;

try { var urlObj = new URL(url, window.location.origin); Object.keys(utmParams).forEach(function(key)

{ urlObj.searchParams.set(key, utmParams[key]); });

return urlObj.toString(); } catch (e) { return url; } }

// Check if link is outbound function isOutbound(link)

{ return link.hostname !== window.location.hostname; }

// Apply UTM to links function applyUTMToLinks() { var utmParams = getUTMParams();

if (Object.keys(utmParams).length === 0) return;

var links = document.querySelectorAll('a[href]'); links.forEach(function(link) { var href = link.getAttribute('href');

// Skip anchors, javascript, and mailto links

if (!href || href.startsWith('#') || href.startsWith('javascript:') || href.startsWith('mailto:')) { return; }

// Only process outbound links (optional - remove this check to apply to all links) if (isOutbound(link))

{ link.href = appendUTM(href, utmParams); } }); }

// Run on page load applyUTMToLinks();

// Also observe for dynamically added links var observer = new MutationObserver(function(mutations) { applyUTMToLinks(); });

observer.observe(document.body, { childList: true, subtree: true }); })();

Convert these UTM parameters into readable variables 

  1. Save the tag template
  2. Set a trigger
  3. Select link click trigger
  4. Name your trigger - UTM Pass On Trigger
  5. Select click URL as the trigger method
  6. Put in the domain of the third party you're sending the user to from your site
  7. Click save and publish

Now test a UTM link you created and see if it passes on those readable variables into constructing a new UTM that fires based on a specific link click

This is a basic example; in a real-world scenario, you'd want a more robust script that handles various edge cases, like ensuring proper URL encoding and checking if UTMs already exist in the third-party URL.

Tools and Platforms for Easier Implementation:

  • Google Tag Manager (GTM): GTM is an excellent tool for this. You can create a custom JavaScript variable to extract UTMs and then use a trigger to modify outbound link URLs dynamically before the click.
  • CMS Plugins: Some Content Management Systems (CMS) like WordPress have plugins that can help automate this process for affiliate links or specific external domains.
  • Server-Side Logic: If your site is dynamically generated, you can implement this logic on the server side before the page is even sent to the user's browser.

Keeping tracking consistent

Maintaining UTM tracking across third-party sites is a vital strategy for marketers seeking a complete and accurate picture of their campaign performance.

While UTMs don't automatically cross domain boundaries, with a bit of thoughtful implementation—whether through JavaScript, Google Tag Manager, or server-side logic—you can ensure your valuable tracking data follows your users wherever their journey takes them.

By doing so, you'll unlock deeper insights, optimise your spend more effectively, and truly understand the impact of every marketing effort.

Contact us

If you want to know more about digital marketing or feel this entire GA thing is too much of a bother and you need it sorted by experts, then we’re happy to assist. Simply contact us, and we can sort out your tracking.

Are you looking to promote your business?

Business owners can create their free business listings on nichemarket. The more information you provide about your business, the easier it will be for your customers to find you online. Registering with nichemarket is easy; all you will need to do is head over to our sign-up form and follow the instructions.

If you require a more detailed guide on creating your profile or listing, we highly recommend you check out the following articles. 

Recommended reading

If you enjoyed this post and have a little extra time to dive deeper down the rabbit hole, why not check out the following posts about Google Analytics?


Tags: Tracking, Big Data

Previous: {{ previousBlog.sTitle }}

Posted {{ previousBlog.dtDatePosting }}

Next: {{ nextBlog.sTitle }}

Posted {{ nextBlog.dtDatePosting }}

You might also like

Hygiene Heroes Launches to Champion Cleaning Quality and Safety in South African Businesses

Hygiene Heroes Launches to Champion Cleaning Quality and Safety in South African Businesses

25 September 2025

Posted by Shamima Ahmed in Press Releases


Hygiene Heroes’ launch in South Africa - a fresh initiative promoting better hygiene, awareness and healthier living in local communities.

Read more
Picking an auto detailing company near you

How to Choose the Best Auto Detail Shop Near You

11 September 2025

Posted by Eva Vergis in Petrol heads


Choosing the right auto detailer is key to a pristine car. Our guide shows you what to look for and where to find the best local shops in Canada to w...

Read more

Leave us a comment


{{comment.sUserName}}

{{comment.iDayLastEdit}} day ago

{{comment.iDayLastEdit}} days ago

{{comment.sComment}}

Sign up for our newsletter