SOLVED

UTM parameters not populating into utm fields

Go to solution
Anonymous
Not applicable

UTM parameters not populating into utm fields

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%20tr...

but the fields are empty:

Screen Shot 2018-06-11 at 10.14.06 AM.png

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!

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: UTM parameters not populating into utm fields

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.

View solution in original post

31 REPLIES 31
SanfordWhiteman
Level 10 - Community Moderator

Re: UTM parameters not populating into utm fields

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.

Anonymous
Not applicable

Re: UTM parameters not populating into utm fields

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:

pastedImage_0.png

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 - Community Moderator

Re: UTM parameters not populating into utm fields

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.

Anonymous
Not applicable

Re: UTM parameters not populating into utm fields

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?

SanfordWhiteman
Level 10 - Community Moderator

Re: UTM parameters not populating into utm fields

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.

SanfordWhiteman
Level 10 - Community Moderator

Re: UTM parameters not populating into utm fields

Btw you're @ing the wrong account but you don't really need to @ me anyway....

Anonymous
Not applicable

Re: UTM parameters not populating into utm fields

Thanks for letting me know Sanford.

We found the source of the issue. The code was correctly firing on our website but it was not placed on all landing pages hosted within Marketo. Problem solved!

Julz_James
Level 10

Re: UTM parameters not populating into utm fields

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 - Community Moderator

Re: UTM parameters not populating into utm fields

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.