How to Create Custom UTM Parameters via Google Tag Manager

UTM (Urchin Tracking Module) parameters are tags added to URLs that help track the performance of campaigns in Google Analytics. By using UTM parameters, you can gain insights into which campaigns drive traffic, conversions, and engagement on your website.

Google Tag Manager (GTM) simplifies the process of adding and managing UTM parameters, allowing marketers to dynamically set and track these tags without modifying the website’s code.

This guide will provide detailed instructions on creating custom UTM parameters via GTM, ensuring accurate and comprehensive tracking of your marketing campaigns.

Read About: How to Add UTM Parameters to Google Ads?

Overview of Common UTM Parameters

Before creating UTM parameters in GTM, define the parameters you want to track. Common UTM parameters include:

  • utm_source: Identifies the source of the traffic, such as Google, Facebook, or newsletter.
  • utm_medium: Specifies the medium used, such as email, CPC (cost per click), or social.
  • utm_campaign: Names the specific campaign, such as spring_sale or holiday_promo.
  • utm_term: (Optional) Used for paid search to identify keywords.
  • utm_content: (Optional) Differentiates similar content or links within the same ad.

Determine the values you’ll use for these parameters based on your campaign strategy.

How to Create Custom UTM Parameters via Google Tag Manager? A Step-By-Step Guide

To create a custom UTM Parameters via GTM, You’ll need to Log in to GTM > Choose the Container > Create a New Tag > Configure Tag Type > Set Up UTM Parameters > Create Variables > Configure Triggers > Test the Tag > Publish the Container.

STEP 1: Set Up Google Tag Manager

For New Users:

  • Go to the Google Tag Manager (GTM) website and sign up using your Google account.

  • After signing up, create a new container for your website.

    • A container holds all your tags, triggers, and variables.

  • Once the container is created, you will receive a snippet of code.

    • This code needs to be added to your website to allow GTM to manage tags.

For Existing Users:

  • Go to the Google Tag Manager website and log in using your Google account.

  • After logging in, select the existing container for the website you want to manage.

  • If needed, create a new container for a different website by following the same steps as above.

  • You will still receive a snippet of code for the container, which should be added to your website to enable GTM.

STEP 2: Create a New Tag in GTM

  • After logging into Google Tag Manager, select the container for your website.

  • In the left-hand menu, click on “Tags.”

  • Click on the “New” button to create a new tag.

  • Name your tag appropriately, such as “Custom UTM Parameters Tag.”

Create a New Tag in GTM

STEP 3: Configure the Tag Type

  • After naming your tag, click on “Tag Configuration.”

  • Select “Google Analytics: Universal Analytics” as the tag type.

    • This configuration will allow you to track UTM parameters in Google Analytics.

  • Under “Track Type,” select “Page View” to track page views with UTM parameters.

Configure the Tag Type

STEP 4: Set Up the UTM Parameters

  • In the Tag Configuration, scroll to the “Fields to Set” section.

  • Click “Add Row” to add a new field.

  • For each UTM parameter you defined earlier, enter the following:

    • Field Name (e.g., “campaignSource” for utm_source).

    • Value (the corresponding value for that UTM parameter).

  • You can use GTM variables to dynamically set these values based on user actions or predefined constants.

STEP 5: Create Variables for Dynamic Values

  • In GTM, click on “Variables” in the left-hand menu.

  • Click on “New” to create a new variable.

  • Name your variable appropriately, such as “{{Campaign Source}}”.

  • Choose the appropriate variable type based on how you want to set the value:

    • Select “URL” to extract parameters from the URL.

    • Select “Data Layer Variable” to use values from the data layer.

STEP 6: Configure Triggers

  • After setting up your tag and variables, click on “Triggers” in the tag configuration.

  • Click on “Add Trigger.”

  • Choose an appropriate trigger type based on your tracking needs:

    • Select “Page View” to fire the tag on every page load.

    • Select “Click” to fire the tag when a user clicks on specific elements.

  • Configure the trigger conditions based on your tracking requirements.

Configure Triggers

STEP 7: Test Your Tag

  • Before publishing your tag, click on “Preview” in the GTM interface to enter preview mode.

  • In preview mode, navigate to your website and interact with the elements you configured triggers for.

  • Use the GTM preview panel to:

    • Verify that your tags are firing as expected.

    • Ensure that UTM parameters are being set correctly.

Test Your Tag

STEP 8: Publish Your Container

  • Once you’ve tested your tag and confirmed it’s working correctly, click on “Submit” in the GTM interface.

  • Provide a version name and description for the changes.

  • Click “Publish” to make your changes live.

  • Your GTM container will now start tracking UTM parameters based on your configuration.

Publish Your Container

STEP 9: Monitor and Analyze Data

  • After publishing your container, go to Google Analytics to monitor UTM parameters’ performance.

  • In Google Analytics, navigate to the “Acquisition” section.

  • Click on “Campaigns” to view the traffic and engagement metrics for your campaigns.

  • Use this data to analyze the effectiveness of your marketing efforts and make informed decisions to optimize future campaigns.

Summary

Tracking UTM parameters through Google Tag Manager (GTM) is a powerful method for gaining valuable insights into your marketing campaigns. By defining and managing these parameters, you can pinpoint which channels, campaigns, and content are driving traffic, conversions, and engagement. With the ability to dynamically track and optimize your marketing efforts, UTM parameters provide a data-driven approach to refining your strategy and maximizing ROI. By continuously monitoring your campaign performance in Google Analytics, you can make informed decisions, optimize your efforts, and ultimately drive better results.