How To Use UTM Parameters to Capture Lead Source

In:

You might already be using UTM parameters to track your marketing campaigns with Google Analytics, but are you capturing that information when a lead comes into your database? Capturing this data is critical in order to assess the value of your marketing campaign and is a lead management best practice.

What are UTM Parameters?

UTM parameters are tags you add to a URL. Marketers use this to be able to track the traffic from a variety of sources such as email, social media, banner ads, etc. The tags can be sent back to Google Analytics and tracked which can be used to gauge the effectiveness of campaigns and identify the best ways to drive more visitors to your website.

hidden-fields-in-forms-3

Create New Fields

The first thing you need to do is create 3 new fields in your Marketing database.

  1. utm_source
  2. utm_medium
  3. utm_campaign

hidden-fields-in-forms-2

Add The New Fields to Lead Capture Form

Next, add these new fields to your lead capture form(s). Make sure they are marked as hidden fields

hidden-fields-in-forms

Add Some Code to Your Landing Page

Some javascript code will need to be added to your landing page.

This piece of code will parse the URL parameters and put the values into the hidden fields on your form.

Note: Some Marketing Automation platforms have an option within their form builders set the field value based on a URL parameter. If that’s the case, the javascript code will not need to be added to your landing page.

Create URLs and Test

Now you’re ready to start creating URLs and testing your form. Use this handy URL builder to create your links and then fill out the form to see if the values go into your database.

What if the lead navigates away from the landing page?

If a lead navigates away from the landing page (maybe to the ‘About’ page) and then returns to the landing page to fill out the form, the UTM information will not be captured. To capture that you need to need to use cookies. Check out my tutorial to learn how to use cookies to capture URL parameters.

Questions?

Email me, or send me a tweet @jennamolby.

Related Posts

  • 17/10/2016
    9 Things You Should Know About The Marketo Account Based Marketing Platform

    Earlier this year at Summit, Marketo announced that they would be launching an Account Based Marketing Platform. As of September 2016, Marketo has officially launched their Account Based Marketing Platform as part of their Summer ’16 launch. There’s been a lot of buzz about Marketo ABM and its benefits, so I thought I would break everything down into the top 9 things you should know about the Marketo Account Based Marketing Platform.






  • 14/10/2015
    4 Ways to Capture Lead Source in Marketo

    Lead source is an important data point you need to capture in order to report on the value of your marketing campaigns. Marketo is flexible and offers a couple different ways to capture lead source. Here’s how to capture lead source in Marketo in 4 different ways.






  • 09/10/2015
    How to Capture Lead Source in Pardot

    Lead source is an important data point you need to capture in order to report on the value of your marketing campaigns. This article will walk you through how to setup and track lead source within Pardot.






14 comment(s)
  • vivek kumar

    22/04/2016 at 6:12 am
    Reply

    hi jenna plz give some reply about my query

  • vivek kumar

    22/04/2016 at 3:29 am
    Reply

    Hi Jenna i have done exactly that but i don't get any data coming in database, plz guide to me how can i do..i am new in this task

    • Jenna Molby
      to vivek kumar

      22/04/2016 at 8:39 am
      Reply

      Hi Vivek, I can take a look for you. Email the code your using and the page URL to jennamolby@gmail.com.

  • […] more on how to use UTM parameters to capture lead source in this […]

  • tekboy

    07/01/2016 at 2:56 pm
    Reply

    how to make this work in eloqua, i have form that submit to eloqua, i want to caputure this data in eloqua

    • Jenna Molby
      to tekboy

      07/01/2016 at 3:11 pm
      Reply

      Hello! Since this is javascript, you can use this code on any marketing automation platform, including Eloqua. You would have to add the new fields to your Eloqua database (utm_medium, utm_source, etc) and them add them to a form. The IDs for your form fields might be a little bit different than shown in the example, so you might have to update the javascript to include your form field IDs.

    • tekboy
      to Jenna Molby

      07/01/2016 at 3:34 pm
      Reply

      Hi Jenna i have done exactly that but i dont get any data coming in, so i have created the fields in eloqua and added the code to the form as hidden fields and i have the js script like this but after testing these fields are empty not capture any data did i missed anything? // Parse the URL function getParameterByName(name) { name = name.replace(/[[]/, "\[").replace(/[]]/, "\]"); var regex = new RegExp("[\?&]" + name + "=([^&#]*)"), results = regex.exec(location.search); return results === null ? "" : decodeURIComponent(results[1].replace(/+/g, " ")); } // Give the URL parameters variable names var source = getParameterByName('utm_source'); var medium = getParameterByName('utm_medium'); var campaign = getParameterByName('utm_campaign'); var term = getParameterByName('utm_term'); // Put the variable names into the hidden fields in the form. document.getElementsByName("utm_source").value = source; document.getElementsByName("utm_medium").value = medium; document.getElementsByName("utm_campaign").value = campaign; document.getElementsByName("utm_term").value = term;

    • Jenna Molby
      to tekboy

      07/01/2016 at 4:21 pm
      Reply

      That looks correct to me. Is your URL correct? It should be structured like this http://example.com?utm_source=test&utm_medium=test&utm_term=test.

    • tekboy
      to Jenna Molby

      08/01/2016 at 9:10 am
      Reply

      my url like this, it looks correct to me test.php?utm_source=google&utm_medium=cpc&utm_campaign=landing&utm_term=test

  • Zak

    31/07/2015 at 3:07 am
    Reply

    Thanks for the great tips here. How can we get this method work if the form is on a different page from the landing page?

    • Jenna Molby
      to Zak

      31/07/2015 at 3:07 pm
      Reply

      Hi Zak, You can store a cookie in the visitor's browser to capture UTMs from another page. It's super easy to do using this jQuery cookie plugin: https://github.com/carhartl/jquery-cookie.

Leave A Comment

Your email address will not be published. Required fields are marked *

About Me

I’m a Marketo & Pardot expert with a strong background in design and development. I specialize in email marketing, lead nurturing and CRM integrations for marketing and sales alignment. LEARN MORE

Categories
Most Commented
Popular Posts