Custom campaign tracking (or utm tracking), is Google Analytics' URL tagging system that allows collected data to be properly labeled for custom reporting needs. It has been a foundational element of Google Analytics since the purchase of Urchin Software Corporation and is the only way for marketers to reliably tag their custom marketing campaigns. The process of tagging a custom marketing campaign is a fairly simple task, requiring a marketer to append a short query string parameter at the end of a URL path, but is a process that many marketers botch without knowing that an issue is ever present. This is scary to think about as these mistakes dirty data, making way for misguided marketing actions to be taken. This blog outlines two of the more common utm tagging mistakes that marketers tend to run into and how to debug and fix them.
Issues:
- Server redirects
- Exclusion of "?" and "utm_source"
Redirects
Redirects are web server functions that create rules to send users temporarily or permanently from one URL to another. The importance of using redirects are to ensure that any URL structural changes that are made to a website still support the old URL path and properly redirects users accessing that old path to its new location. Using a redirect has many benefits like improving user experience and helping search engine bots, but causes a major roadblock for utm query parameter tracking unless proper server-side modifications are made.
Query parameters, unfortunately do not persist during the redirect process, which means that anything that is appended to the end of the redirected URL will be stripped and the information will not carry over to the new URL. Since custom campaign tracking is dependent on having utm query parameters present in the URL of the landing page, the stripping of these parameters prevents any utm parameter data to be captured.
How to test:
If you think a redirect (301, etc.) is stripping the query parameter tracking for your landing page url, then run a test by passing in dummy labels for each utm parameter field to the end of a URL and then load the URL. If the utm parameters stay at the end of the URL when the page is loaded, then it is very likely that your information is being tracked. However, assuming your tracking is correct is not as good as knowing it is correct, so to confirm, it is best to check your developer console to see if a Google Analytics cookie is present that contains the utm parameter information you passed and then take a look at the "Real-Time" report in GA to see if the values you passed are being reported. If the query string is removed and or the Google Analytics cookie does not contain information related to your dummy values, then you have a redirect issue.
The same process should be used to test for automated query parameter tagging, like the process commonly used by Google AdWords. Enter your destination URL in your browser and append ?gclid=test to the end of the URL (e.x. www.test.com/?gclid=test) and load the page. The gclid should remain at the end of the URL when the page loads and information should be stored in a Google Analytics cookie. If this query parameter disappears and a Google Analytics pixel does not fire containing this information, then you have a redirect issue.
Solution:
Configure your server to pass gclid's and utm tracking parameters on redirects.
This is a technical process, so please consult your webmaster about making the necessary changes. A simple Google search should give you various solutions, but I did my own searches and have provided some links to resources that should help resolve your redirect issues.
Apache Server – RewriteQueryString Documentation
Apache Server – Pass Full Path with Query String
Nginx Server – With Nginx How to Forward Query Parameters
Nginx Server – Nginx Wildcard 301 Redirects with Query Strings
Exclusion of "?" and "utm_source"
"?"
The question mark, “?”, in our query parameter string is universally designated as the separator between the URL path and the variable values that are placed directly after the “?”. HTTP requests look for this question mark to understand what section of the URL contains variable values and what pieces of the URL are related to site structure. Without this question mark, the server protocol does not know what to do with this information and as a result any utm parameter information that is passed in the URL is never registered by Google Analytics.
"utm_source"
utm_source exclusion is a little bit more difficult issue to debug as there isn't a lot of documentation on the issues that are created by leaving out this specific parameter field. It is not universally known that utm_source is the primary utm parameter field Google Analytics' back-end uses to identify tracking information and for this very reason, many marketers run into serious issues when leaving this field out of their full query parameter setup. This field is the key trigger that manually sets the __utmz cookie, which contains all of the query parameter information. Without this crucial element, the Google Analytics javascript bypasses the rest of the utm parameters and uses the standard source tracking process. As a result, it is extremely important to make sure that utm_source is always defined when using utm parameters.
How to test:
Both issues should be caught by double checking your query parameter setup, but if you want to ensure that you are using the correct structure, then run a test with a url and check both real-time reporting and acquisition reporting to see if your test query parameters were correctly picked up by Google Analytics servers and reported with the right information.
Solution:
Before you use a link template that will be used to track a campaign, make sure to pass in dummy values to the utm parameters to make sure that the data is being recorded correctly for each utm parameter that you plan on using.
If you are a very error prone person, then use Google's free resource, URL builder, to build out your campaign tracking, and then copy and paste the correctly formatted links into your campaigns.