Turning UTM codes into Custom Attributes in Zuko using Google Tag Manager


You may already be using UTM codes in your wider analytics efforts to keep track of where visitors to your online form have come from.

For example you may have something like this in place:

zuko.io?utm_source=google&utm_medium=email&utm_campaign=summer_sale

This URL has a query string (everything after the question mark):

?utm_source=google&utm_medium=email&utm_campaign=summer_sale

This query string has the following parameters within it, separated by the ‘&’ symbol:

utm_source=google
utm_medium=email
utm_campaign=summer_sale

Each of these consists of a key and a value. In the case of the first, the key is ‘utm_source’ and the value is ‘google’. The value is changeable depending on where the user came from, but the key will remain the same.

It is relatively straightforward to turn these pieces of information into Variables in Google Tag Manager. It take just two steps:

  1. Turn UTM parameters into a Variable
  2. Push that Variable into Zuko as a Custom Attribute

Turning UTM parameters into Variables

First, head into your Google Tag Manager account and open up the relevant container, then click on Variables:


Head down to the bottom where you have listed your User Defined Variables, then click New:


Next, you want to choose a Variable type of URL:


Then from the drop down menu, choose ‘Query’:


Next, you need to enter the “Key” from the parameter in the URL that you want to set as a variable:


In the above instance, I have picked utm_source. Next give it a name, then Save.


Now, each time a visitor hits your form and the URL contains the UTM code that includes the utm_source, it will be set as a variable.

Turning Variables into Custom Attributes in Zuko

We’ve written a full guide on how to push variables into Zuko as custom attributes, which you can find here.

In the above case, we would simply need to head to our Zuko Activity Tracking code tag in GTM, then add an additional line of code:

.setAttribute (‘ATTRIBUTE NAME’, ‘{{VARIABLE NAME}}’)



You can see in the above where that extra line should be. You can replace ‘ATTRIBUTE NAME’ with whatever you like - this will be the heading that will appear in Zuko in the filter dropdown menu.

When you type in ‘{{‘ into GTM, a list will appear displaying all of your Variables, including the new User Defined Variable you just set up. Simply click on this and close out the rest of the code as outlined above.

Then save the amended Tag, and Publish. Your UTM parameter will now be converted into a Variable and this information will be captured and pushed into Zuko and you will be able to filter all of our data by these values.

For additional Parameters, simply repeat the process of turning them into Variables, then add lines of code to push those variables into Zuko using GTM.


See more guides
Formisimo Ltd, Colony, 5 Piccadilly Place, Manchester, M1 3BR
VAT Number: GB181252425
Registered in England as company number 08859680
New Business: sales@zuko.io
Support: support@zuko.io
This website stores data such as cookies to enable important site functionality including analytics, targeting, and personalization. By remaining on this web site you indicate your consent.