Track UTM Parameters and Click IDs using Google Tag Manager

Ensure UTM parameters and Click IDs are tracked on any click in managed digital properties with Google Tag Manger.

What You'll Need

If you're using buttons or other non-Demand IQ calls-to-action (CTAs) on your managed web properties such as your website or landing pages, you might be dropping critical marketing data contained in the URL parameters of clicks (such as UTM parameters) from tracking with the associated leads. 

This article will show you how to pass UTM parameters, click IDs and other query parameters via button clicks to Demand IQ on any managed digital property where you can deploy Google Tag Manager. 

If you're only using Demand IQ-provided CTAs such as the banner or embedded versions of Demand IQ, this article does not apply to your marketing data. Demand IQ created widgets and snippets have this functionality natively integrated. 

Instructions

Part 1: Edit Google Tag Manager Tag

  1. Download the Template GTM Trigger and Template GTM Tag.
  2. Open Template GTM Tag in a code or text editor. Locate the URLs as shown in the red box below. 
  3. Enter your company domain in each instances of SOLARCOMPANY. Your script should now look similar:

Screen Shot 2022-07-28 at 2.32.24 PM

Part 2: Google Tag Manager - Tag Configuration

  1. Sign in to your Google Tag Manager account. 
  2. Click New Tag, then Edit Tag Configuration (pencil icon) > Custom HTML.
  3. Paste your edited script into the HTML field.

Screen Shot 2022-07-28 at 2.36.12 PM

Screen Shot 2022-07-28 at 2.39.36 PM

Part 3: Google Tag Manager - Trigger Configuration

Triggers occur when ALL conditions are met, meaning you'll need different triggers for various types of query parameters.

Trigger on UTM Parameter

  1. Scroll to Triggering > Edit (pencil icon).
  2. Click Add New Trigger (+ icon)
  3. Select Page View - DOM Ready as the event trigger.
  4. Add the other settings as found in Template UTM Trigger:
    1. Some DOM events, Page URL, matches RegEx (ignore case), utm_(medium|source|campaign|term|content)= 
  5. Save changes to the trigger. 

Screen Shot 2022-07-28 at 2.47.56 PM

Trigger on FBCLID or GCLID Parameter

  1. Add a new Trigger in Google Tag Manager. 
  2. Select Page View - DOM Ready as the event trigger.
  3. Select "Page URL" contains "fbclid" or "gclid" for Meta and Google respectively. 
  4. Save changes to the trigger. 
  5. Apply to the Trigger to the Tag you created in Part 2. 

Screen Shot 2023-12-18 at 10.15.52 AM

Screen Shot 2023-12-18 at 10.16.08 AM

 

You’re all set! UTM parameters will now be passed to Demand IQ on button clicks by decorating the link with any existing UTM parameters or click IDs.