Disclaimer: This post may contain affiliate links. The opinions expressed are mine. Read more.

UTM Tracker WordPress Plugin

UTM Tracker

Last Updated: January 5, 2022.
Current Version: 1.3.1

UTM Tracker is a FREE WordPress plugin to track the source of conversions. UTM parameters are inserted automatically into your website forms.

What Does It Do?

UTM parameters (Urchin Tracking Module) are a useful way to track the source of traffic when using tools like Google Analytics. Wouldn’t it be great if you could also track this info when a visitor signs up with a web form or places an order? Well, now you can!

When passing UTM parameters, GCLID, and other predefined parameters to your website it stores this info via a website cookie for 30 days. It can then be inserted into any lead generation or order form on your website. It automatically adds this extra information as hidden fields in your HTML form.

This is a fork of script utm_form, and made into a WordPress UTM plugin. The script has been modified to already include the additional variables gclid, fbclid, net and match to measure conversions with ad networks like Google, Bing, and Facebook.

Works With

It automatically works with most HTML form submissions such as:

Why Do I Need It?

Google created the UTM parameters standard to help track referrals so you know the exact source of your website traffic. Using website referrals is unreliable at best. In many cases, the referral is blocked or not available. One example is a link in a smartphone app which in most cases comes up as an unknown traffic source.

If you want to know the source of every order or email subscriber, use this plugin.

An Example

You create a Facebook ad, add UTM parameters and send them to your home page.

https://www.yoursite.com/?utm_source=facebook&utm_medium=cpc&utm_campaign=myad&utm_content=version2

The visitor Bob clicks on your Facebook ad and lands on your home page. He then proceeds to visit a few other pages. He eventually visits your mailing list form at https://www.yoursite.com/subscribe/ and submits his email address [email protected] to your MailChimp mailing list.

The Ultimate Guide to UTM Parameters

Learn everything about UTM parameters you wanted to know
but were afraid to ask.

From the information stored in MailChimp you’ll know that Bob came from a paid Facebook ad with the campaign “myad” and was the second version of your ad.

So you can attribute the source of traffic or conversions and know how effective your ad campaigns have been.

Not all traffic is created equal. Once you have this information your use with it can be limitless. You can measure which source of traffic is better performing. It can be used to fire off different events in your mailing list.

Supported Parameters

The plugin supports the standard UTM parameters with also some newer parameters to help track ads as well.

  • utm_source (required) – The platform (or vendor) where the traffic originates, like Facebook or your email newsletter.
  • utm_medium (required) – You can use this to identify the medium like Cost Per Click (CPC), social media, affiliate or QR code.
  • utm_campaign (required) – This is just to identify your campaign. Like your website or a specific product promotion.
  • utm_content – If you’re A/B testing ads, then this is a useful metric that passes details about your ad. You can also use it to differentiate links that point to the same URL.
  • utm_term – You’ll use this mainly for tracking your keywords during a paid Google Ads campaign. You can also use it in your display ad campaigns to identify aspects of your audience.
  • gclid – Google creates a unique id that is passed when a visitor comes from a clicked ad.
  • fbclid – Facebook Ads and organic clicks create a unique id that is passed to your site for tracking purposes. Can be used in conjunction with Facebook server API.
  • place – The content site where your ad was clicked (for keyword-targeted campaigns), or the matching placement targeting criteria for the site where your ad was clicked (for placement-targeted campaigns).
  • net – The network source of the traffic from Google.
  • match – The keyword matching from the ad displayed on Google.

How Do I Use It?

  1. Install and activate the WordPress plugin on your website. This can be done with the “Plugins” section by selecting “Add New”. Then search for “UTM Tracker”.
  2. You need to make your forms accept the new fields. Based on the information available for a visitor, the fields added to your form can be any of the following:
    • USOURCE – Value of ‘utm_source’ parameter if present.
    • UMEDIUM – Value of ‘utm_medium’ parameter if present.
    • UCAMPAIGN – Value of ‘utm_campaign’ parameter if present.
    • UCONTENT – Value of ‘utm_content’ parameter if present.
    • UTERM – Value of ‘utm_term’ parameter if present.
    • IGCLID – Value of the ‘gclid’ parameter if present.
    • IADPOS – Value of the ‘adpos’ parameter if present.
    • IPLACE – Value of the ‘place’ parameter if present.
    • INET – Value of the ‘net’ parameter if present.
    • IMATCH – Value of the ‘match’ parameter if present.
    • IREFERRER – URL of the initial referrer.
    • LREFERRER – URL of the last referrer.
    • VISITS – Number of visits.
  3. Setup any links to your website with the parameters listed above.
  4. Profit!

What Will My Form Look Like?

Here’s what will happen behind the scenes with the HTML. The first example is what an example HTML form would look like without the plugin installed.

<form action="//terminusapp.us6.list-manage.com/subscribe/" method="post"> 
<label for="mce-email" >Email Address</label>
<input type="email" value="" name="email" id="mce-email">
<input type="submit" value="Subscribe" name="subscribe">
</form>

Once the plugin is added, your form will look like this after the page is loaded.

<form action="//terminusapp.us6.list-manage.com/subscribe/" method="post">
<label for="mce-email">Email Address</label>
<input type="email" value="" name="email" id="mce-email">
<input type="submit" value="Subscribe" name="subscribe">
<input type="hidden" name="USOURCE" value="facebook">
<input type="hidden" name="UMEDIUM" value="cpc">
<input type="hidden" name="UCAMPAIGN" value="myad">
<input type="hidden" name="UCONTENT" value="version2">
</form>

The additional hidden fields are added automatically to the HTML form. No additional coding is needed.

When someone submits the form, all the extra information is also sent along with the email address.

In order to store this information, you’ll need to make sure that your form can accept these values. If it is a MailChimp form, configure it to accept these fields. Same for [affiliate_link affiliate=’activecampaign’ child=’plugin’]Active Campaign[/affiliate_link], CampaignMonitor, [affiliate_link affiliate=’aweber’ child=’plugin’]AWeber[/affiliate_link] or any other service. Any HTML form on your website can capture this information.

It needs to match the field name exactly above, or the information won’t be captured by your system.

MailChimp Merge Fields
Example of the merge fields to use with MailChimp

Frequently Asked Questions

What happens if someone visits a bunch of pages on my website/blog before filling out the form?

It doesn’t matter. As soon as they land on your website, the script saves the information in a cookie. This cookie is valid for 30 days. It adds this information automatically to your form from the saved cookie.

Where can I find more about UTM parameters and how to properly use them?

I recommend reading my tutorial on using UTM parameters, standardizing the naming, and tracking them.

How can I track Google Ads parameters?

By default, Google just passes the GCLID variable but you may want more information. Here’s my global configuration setting for my tracking template. Adjust how you see fit. So all ads created will pass this information.

{lpurl}?utm_source=google&utm_medium=cpc&utm_campaign={campaignid}&utm_content={creative}&utm_term={keyword}&adpos={adposition}&place={placement}&net={network}&match={matchtype}

How can I track Facebook Ads?

Unlike Google Ads where you can create a standard option for all ads, Facebook you must set up per ad. Fortunately, Facebook supports variables so to do this is now somewhat easy. I recommend using these parameters for all of your Facebook ads.

utm_source={{site_source_name}}&utm_medium=cpc&utm_campaign={{campaign.name}}&utm_content={{ad.id}}&utm_term={{placement}}

I use Gravity Forms and it’s not storing my information. What am I doing wrong?

Previous versions of Gravity Forms this plugin used to work. The current version of Gravity Forms no longer works.

I recommend using one of the Gravity Forms community plugins.

Changelog

  • 1.3.1
    • labeled as 5.8 WP ‘safe’
  • 1.3.0
    • Added msclkid and IMSCLKID for Microsoft Ads clicks
  • 1.2.0
    • Added latest version of utm_form 1.2.0
    • Added support for ‘fbclid’ and ‘IFBCLID’ for Facebook ads and organic Facebook clicks
    • Removed ‘adpos’ variable and ‘IADPOS’ since Google Ads no longer supports this information
  • 1.0.3
    • fixed bug where documentation and code did not match variables passed.
  • 1.0.2
    • Added latest version utm_form 1.0.4
    • Added options for the domain name (default TLD defined in WordPress setup) and TTL of cookie (default 30 days)
  • 1.0.1
    • First version released to the WordPress community.
Larry Ludwig

About Larry Ludwig

Larry Ludwig is an entrepreneur, financial expert, tech & marketing guru with over 25 years of industry experience.

In July 2018, Larry successfully sold Investor Junkie for $6 million.

You May Also Like