Form Autofill hidden field - Current page URL

Jonathan_Haines
Level 2

Form Autofill hidden field - Current page URL

I am creating a single form that will be on multiple client pages (same website, we just provide our clients a special non-marketo landing page). I would like to have a hidden field on the form that tells me what page the form was completed on so we know which client it came from.

 

How the typical flow goes:

Step 1: Visit the /client-name/ webpage

Step 2: Click "Sign Up" button

Step 3: Complete form on /client-name-get-started/ webpage

 

So the Referrer Parameter autofill would be the most obvious choice. But what happens if they get to the "get started page" from elsewhere (such as an email or a different webpage)?


Is there an easy way to have the hidden field populate with the current get started page's url? (the same form will just be added to each custom get started page). I wish there was something similar to the {{trigger.webpage}} token for alerts.

Jonathan Fox-Haines
3 REPLIES 3
SanfordWhiteman
Level 10 - Community Moderator

Re: Form Autofill hidden field - Current page URL

Create a field like Last Form URL and manage it like so:

Beautifying fields like ‘Last Form URL’ by stripping uninteresting query params

Jonathan_Haines
Level 2

Re: Form Autofill hidden field - Current page URL

That seems a bit more complex for someone without any coding experience. If I were to figure that out - that article still doesn't really tell me how to then get the URL to populate into the form field or where/how to implement the script.

Jonathan Fox-Haines
SanfordWhiteman
Level 10 - Community Moderator

Re: Form Autofill hidden field - Current page URL

? The very first code snippet is how you populate the field.

 

Like all custom form behaviors, put the code in a <script> after the form embed. On a Marketo LP, this means just before the closing </body> tag.

 

There’s no other way to do this, as you specifically said you wanted a hidden field and to not use a {{trigger.token}}.