Marketo hidden fields with UTM Parameters

Hi community,

I’m super new to this tool so I barely know where things are and how to share links, but I have a Marketo form and a Webflow form both integrated and working perfectly.

However, I added hidden fields to Marketo, these fields read URL parameters (utm campaign, medium, etc.), but they are not being pulled.

So, I added the hidden fields to the Webflow form and mapped those fields too. But still, the UTMs parameters are not being either pushed from Webflow to Marketo or pulled directly from Marketo.

Any ideas here?

Thanks!


Raul

Hi Raul, can you share both a designer readonly link and a published site link?
Both of them to the page your marketo form is on, which you are trying to pull the UTMs into.

Hi memetician, thanks!

Here is my site Read-Only: LINK
Here is my published site: LINK

Here’s a super easy attribute-based solution for prefilling form fields from URL Params!

Here’s the tutorial - you will need to go to the link above to copy the script.

1 Like

Thanks Julian!

But I have about 11 hidden fields, would I have to do that for all of them?

One of the features of Marketo was that using hidden fields, I simply put in the names of the expected parameters and the form will take them directly from the URL (no code needed), but it seems that with the integration with Weblfow, I am losing that advantage.

Hi Raul, I haven’t checked Julian’s solution, but it’s likely just a custom attribute you add to those fields. If you run into any issues, though, SA5 takes the approach you’re describing.

Just add the lib and then you can add a custom attribute of e.g. wfu-bind=?utm_campaign. The ? at the start of the value indicates you’re wanting a querystring value, there are a lot of other things you can bind too, like domain, URL, path parts, cookies, webStorage values, etc.

1 Like

@memetican thanks for this. I read in the code that we should use defer or async for this script. Which one do you recommend?

Hi Raul, you could defer it like we do for most of our libs, however that will slow pages loads in some specific scenarios.

1 Like

I added the script and the attributes to my hidden fields, however, it’s not working. Can you help me check to see what am I missing, please?

WB Link: LINK
Site Link: LINK

You need to have a ? before your query string values, like this-

wfu-bind="?utm_campaign"

But also I’ve just removed an old piece of jQuery code that’s no longer needed in v5. It looks like it was generating an error, so update your lib to 5.3.4-

Also an unrelated note, you have a piece of JS that’s generating an error, but I don’t think that’s causing any issues with data-binding.

1 Like

Thanks @memetican, for the link tag. Does it matter if it is not closed? I see it ends with a > instead of a />.

<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/sygnaltech/webflow-util@5.3.4/dist/css/webflow-data.css">

It is closed. <link> is a void element. It does not contain content or have a closure.

1 Like