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:
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!
Solved! Go to 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.
What's an example of an exact page URL, including UTM params?
Also, are you using KV HTML?
Here is the one of the URLs: Orchestrating Immersive CX in Your Contact Center | NICE inContact
As for KV HTML, I'm going to say no.
And when I fill in a form using this URL, this is showed on the record, ad this didn't update from previous tests:
UTM Campaign: utm_campaign
UTM Content: utm_content
UTM Medium: Social
UTM Source: inContact
Except you aren't using only Marketo's built-in parameter autofill: you are using third-party JS to manipulate form and cookie values. That's exactly what this broken JS library does, or tries to do. But it suffers from exactly what I predicted above -- it isn't Marketo-literate and has a quite obvious race condition (it doesn't use the Marketo Forms API to know when the form is ready, and furthermore doesn't use the right way of setting values).
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.
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.
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.
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?
Btw you're @ing the wrong account but you don't really need to @ me anyway....
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!
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.