UTM parameters not populating into utm fields | Community
Skip to main content
June 11, 2018
Solved

UTM parameters not populating into utm fields

  • June 11, 2018
  • 7 replies
  • 12279 views

We're having a consistent issue where a record will enter our database from a URL that has UTM parameters within the link. However, those UTM parameters do not populate from the referrer into the UTM fields (utm_medium, utm_ source, etc.). I've scanned the community and have not seen anyone discuss the same issue (< if you have, please point me in that direction).

For example, a lead would enter our database from this referrer: https://tripactions.com/?utm_source=google&utm_medium=sem&device=t&matchtype=b&keyword=business%20travel&campaignid=7497…

but the fields are empty:

This happens for multiple sources, both within Marketo hosted pages as well as external ads: paid search, paid social, our unsubscribe landing page, webinar landing pages, etc.

An outside resource brought the idea that the lead could have deleted the part of the URL that has UTM parameters within it in an attempt to untrack themselves, however this is not the case as the original referrer and the referrer url have the full link with utm parameters in it.

To try to fix this originally, we added code on our forms a while back that could capture UTM parameters for about a day in case something was dropping them on the backend. This would ensure the utm parameters would persist from page to page as a record flipped throughout various web pages. To do so we added cookied fields ft_utm_medium, ft_utm_source, etc. that would hold the value then populate the real utm fields.

In addition to this fix, I have a workflow running within our Global Lead Source program that looks for records that have utm parameters within the original referrer and reads the UTMs to correctly attribute the record. But this catch does not populate the utm fields.

We're eager to find the source of this issue and a fix. Has anyone seen this before? Does anyone think a reasonable fix is to create a smart campaign that finds anyone with utm parameters in the original referrer and has a flow step that populates the utm fields?

Thanks for the help!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

Sanford Whiteman​ Ok thanks, we're checking the code to see if it has the order based conditions to copy when the form is rendered.

How have you seen other companies deal with this issue in the past? Do a similar cookie storage or other solution?


Code that properly avoids the race condition between the form load and the cookie set will be fine. It's not difficult, once you understand the problem.

I don't usually add the form fields to the form (in Form Editor) at all, rather setting them using the Forms API addHiddenFields method to allow for more granular logic (for example, using cookie values or current values depending on detailed priority levels and different field names).

However, using the standard Hidden type in Form Editor is fine as long as the code to set cookies works.

7 replies

SanfordWhiteman
Level 10
June 11, 2018

Laura, I think you've misunderstood what does and doesn't require manual config in Marketo.

Moving query parameters into lead fields always requires you to add the fields as hidden at the form level. It's not automatic.

June 11, 2018

Hi Sanford Whiteman,

We have UTM parameters set as hidden on all our forms to capture these UTMs. See example snapshot from one of our demo forms:

In this example, we are using the custom cookie parameters to hold the value of the utms to make sure we capture the data even as a lead moves from page to page on our website.

SanfordWhiteman
Level 10
June 11, 2018

That's fine, but unless the cookies are guaranteed to have stored the current utm values ("current" meaning "on the URL currently being viewed") at the time the form is rendered then the current values will not be captured.

Frequently people write broken JS that they think has copied the current query params into cookies before loading the form, but actually the order is random based on browser and network conditions, i.e. the code has a race condition.

Level 8
June 22, 2018

Hi Laura and Sanford!

I'm having a similar issue with an instance I'm working in.  Sometimes the UTM parameters are captured, and sometimes they aren't.  They always capture when its a new lead, but if it's someone who has been on various pages and downloaded various things with different URL's and UTM parameters then it doesn't always capture the information. 

I'm going to be doing some testing tomorrow, however, I was wondering if the issue could be in the cookies that are being places on machines, as when I clear all mine or use the private browsing windows, the UTM parameters always pull into the fields in Marketo without any issues.

Thanks

Julz

SanfordWhiteman
Level 10
June 22, 2018

Well, it depends on what (if any) code you're using to persist UTM parameters from one page to another, whether it's running on all pages (it should be), whether its internal logic is sound, and whether it's aware of script load + execution order (so it's always finished when the cookies are needed).

If you're not using any special code, then UTM params will never fill from cookies, ever, so you must have something.

If you're using code that stores empty values in cookies instead of overwriting them (which can sometimes be strategically sound) then params may in fact be getting filled, they'll just be getting filled with a stored empty string.

But any number of things can go wrong when code isn't properly tested or implemented. I'd have to see what you're using to be able to tell.

Level 8
June 26, 2018

Hi Sanford,

There is no special code being used, just the UTM parameters in the URL and then the hidden fields on the forms.  It seems to be an intermittent problem where sometimes it works if the lead has visited the site a number of times, but all the time if it's a new lead into Marketo.  The only parameters we want to capture is when they fill in a form, and for the parameters to change on each form fill (as long as they are present in the URL).

Can I message you privately to show you some examples?

Thanks

Julz

Sant_Singh_Rath
Adobe Champion
Adobe Champion
June 22, 2018

Hi Laura,

We have been using 'URL Parameter' instead of Cookie value and it's working fine for us as of now.

~ Sant Singh Rathaur
Dan_Stevens_
Level 10
June 22, 2018

This is fine if you’re sure the user will be submitting the form with the hidden UTM fields on the first page they visit. After that, those parameters are lost. The reason cookies (or even LocalStorage (https://blog.teknkl.com/quick-and-dirty-utm-forwarder/ )) are a better approach is it keeps the last set of parameters persistent. For example, when a person (anonymous or known) navigates multiple pages of your site before ultimately converting. Or even multiple sessions.

Conor_Fitzpatri
Level 5
June 26, 2018

Sanford, I am running into issues similar to Laura and am testing out your approach (that Dan referenced above). I'm working with native Marketo landing pages and am wondering how I can place the forwarding script in between the forms2.min.js and MktoForms2.loadForm scripts.

SanfordWhiteman
Level 10
June 27, 2018

On a Marketo LP, you can add another remote <script> that loads forms2.min.js to the <head>. Follow that directly by the forwarder code.

<script src="/js/forms2/js/forms2.min.js"></script>

<script>

// UTM forwarder goes here

</script>

Conor_Fitzpatri
Level 5
June 27, 2018

You're awesome, thanks!

Level 2
June 28, 2018

I am a little late to the party here... we developed a solution (with someone's help on this thread!) which we used to distribute open source. It's now a one-time affordable install fee and includes a workshop on taxonomy / tracking utm parameters.

Yes-without a special code, you are lucky to capture Last Touch, but only and only if the lead landing on the web page fills out the form right away. If they flipped through a couple of pages and came back to fill out the form, they will inevitably lose all utm parameters. We utilize javascript to capture this information and then, it's automatically disseminated into marketo fields. (But our solution will record both First Touch and Last Touch; First Touch is especially useful to those in tradition B2B models as the lead lifecycle is longer).

Check the solution out on our site or on Launchpoint or let me know if you have any questions!

http://romanoff.live/solutions

tracking marketing attribution - ConversionPath » Marketo LaunchPoint®

June 29, 2018

Also late to the party, but for about a year now, I have been using this code from this Digital Pi article ​with zero problems.

It creates a cookie that stores a visitor's UTM parameters (you can also change the parameters to be any custom parameters - just make sure that what you put in the urls matches what the script is looking for), and those values persist for 365 days or until new values overwrite them. This is important for people who click a link to a landing page, but subsequently navigate around to other pages or maybe come back during separate session.

One word of caution there: if you send someone a link with an incomplete set of parameters (say you just input medium, source, campaign, but left term and content blank) the new values will overwrite, but the old values will stay the same, meaning when that visitor submits a form you'll have inaccurate information on the content + term.

The instructions are pretty clear around setting up your form and implementing the code, but just make sure you're loading the script in the body below the form and swapping out the domain (if you want to use on subdomains and main site, you'll need to use ".yoursite.com") or custom parameter names that you want to use.

Also, its easy to overlook the link to the actual code in that article, which is here.

SanfordWhiteman
Level 10
June 29, 2018

One word of caution there: if you send someone a link with an incomplete set of parameters (say you just input medium, source, campaign, but left term and content blank) the new values will overwrite, but the old values will stay the same, meaning when that visitor submits a form you'll have inaccurate information on the content + term.

Better implementation NULLs those fields.

August 29, 2018

We're using Overstack's attribution touchpoints capturing tool to automatically track visit sources.

It works great and without making any changes to web forms.

Marketing Attribution Tracking in Marketo - Aren’t You Forgetting Something? - Overstack.io Blog