UTM parameters are crucial to tracking and analyzing marketing campaigns. These small snippets at the end of a URL help identify the source, medium, and campaign name, allowing marketers to track campaign performance.
Removing UTM parameters from URLs can significantly impact your marketing campaign's performance evaluation. In this article, we will consider why your UTM parameters can be removed and how you can fix this problem.
UTM parameters are the most common and easy way to determine the traffic source and associated data. These parameters are added to the URL of your page when a user clicks on the link and contains the source data, for example, https://example.com?utm_source=google&utm_medium=cpc
In some platforms, UTM parameters are added automatically to the URL when clicked, while in others, you should add and configure them manually.
So, why are UTM parameters so important? The definition of the traffic source in Google Analytics 4 (as well as in most other analytics) is based on UTM parameters. Any problem with UTM parameters can cause increased unassigned traffic in Google Analytics.
Although UTM parameters do not contain personal data but only data about the source from where the user came to the site, some browsers (e.g., Safari, Brave) and plugins (e.g., uBlock) may truncate these parameters. They can be removed by default, or the user can activate such an option. This leads to inaccurate analytics performance. You won't get reliable data if many website visitors use such browsers or plugins.
Most analytics platforms (including GA4) focus only on UTM parameters, and you can't replace them with other custom parameters to bypass the problem of UTM removal.
But with the help of server-side tracking, you can transform your custom parameters back to UTMs. In this way, the browser won't be able to determine and remove the parameters from the URL. Thanks to such a transformation, your analytics platform will get the correct UTM parameters, allowing smooth data collection and providing accurate attribution.
To configure the transformation of custom parameters to UTMs, you will need to:
If you are using Google Analytics, check our step-by-step guide on how to set up GA4 tracking using a Google Tag Manager server-side container. |
You can use anything you like; we decided to use the following mapping for our example:
utm_source → st_src
utm_medium → st_mdm
utm_campaign → st_cmp
Note:
Most marketing platforms allow you to manage UTM parameters. You just need to replace UTM parameters with the custom ones you created in the previous step.
For example, in Google Ads, you can do this in the Campaigns → Settings section and specify your custom parameters that will be added to the URL when clicked.
In GA4, UTM parameters are taken from the page URL (page_location in event data) where an event occurs.
So we need to configure transformation on the page_location event data parameter and transform our st_ parameters into utm_ parameters based on their value.
There are no in-built tools that can replace this data in server GTM, so you need to use a custom "Query Replacer" variable. You can download the Query Replacer variable on GitHub.
Add it to your server container. To do it, go to Templates → Variables → New → three dots in the top right corner → Import → select the .tpl file you downloaded → save changes.
Go to the Variables section of the server GTM container → next to User-Defined Variables, click "New" → select "Query Replacer" as Variable Configuration.
In the variable, you need to specify which parameters to replace with which ones.
In our example, it looks like this:
To do it, go to the Transformations tab and create a new transformation.
As a transformation type, you need the "Augment event," which allows you to modify event data.
In the parameters, specify "page_location" and select the variable you created in the previous step as a value.
In the "Affected Tags" section, select the appropriate tags to apply only to GA4 tags.
In our example, it looks like on the screenshot below:
Run container previews as usual (click "Preview") and check if everything works as expected.
Specify some test URLs with your fake UTM parameters, and check in preview mode that for the GA4 tag, the parameters are transformed.
If everything is correct - publish the changes in the container.
After that, we recommend checking your traffic acquisition reports after a few days (in GA4, data can be processed for 24+ hours) to ensure no problems with them.
In case of difficulties with configuration, check our guide on debugging and monitoring server-side tracking configuration. |
While UTM removal has not yet become a widespread issue and is not a default feature in most popular browsers, it poses a challenge for website owners targeting a "more tech" audience, who are more likely to use ad blockers and privacy-focused browsers.
If this issue affects you, implementing a UTM replacement solution is a handy and straightforward way to improve your analytics results significantly.
Stape has lots of tags for server GTM! Click on Try for free to register and check them all.