Re: Grab URL in Hidden Field without JS or parameters

Anonymous
Not applicable

Grab URL in Hidden Field without JS or parameters

Hi All,

I have been searching for this answer already on the Community, but have not found it yet, so I'm hopefully someone can answer me directly or point me to the answer that I have missed.

Using a hidden field on forms 2.0, how do I grab the full URL of a page that a form is filled out on? My goal is to use a single form for gated content on several different web pages. These are basic web pages so they don't have custom URL parameters - Just the URL.

Within the form only (and no javascript if possible), is there a way to grab the full URL of the page the form was filled out on so that the follow up page can direct them to the appropriate content?

Example of how this single form would work.

Name:               Joe Smith

URL (Hidden)    www.website.com/content-ABC-preview

Form completion page --> go.website.com/content-ABC

Name:          Mary Miller

URL (Hidden)    www.website.com/content-XYZ-preview

Form completion page --> go.website.com/content-XYZ

I understand how to do it when we have parameters on the URL, but I can't seem to figure out how to just get the whole URL of the page. Can anyone help? I attempted using a trigger in the hidden field {{trigger.web page}} but that didn't work.

Thank you so much!

Tags (2)
6 REPLIES 6
Geoff_Krajeski1
Level 10 - Champion Alumni

Re: Grab URL in Hidden Field without JS or parameters

The URL will be included in the activity log information as the Referrer

Geoff_Krajeski1
Level 10 - Champion Alumni

Re: Grab URL in Hidden Field without JS or parameters

And if you want the querystring parameters those are also available as an additional constraint

Anonymous
Not applicable

Re: Grab URL in Hidden Field without JS or parameters

What would i put in the hidden field on the form?

Anonymous
Not applicable

Re: Grab URL in Hidden Field without JS or parameters

I'm temporarily using a field called "Burner" to hold the information so that I can

Here is the form:

Capture.PNG

Here the follow up section:

Capture1.PNG

SanfordWhiteman
Level 10 - Community Moderator

Re: Grab URL in Hidden Field without JS or parameters

You cannot do this without JS if you want to switch TY URLs based on the value. That's why you will only see the JS solution in the Community.

<SCRIPT>

MktoForms2.whenReady(function(form){ 

  form.addHiddenFields({ last_form_fill_url : document.location.href });

});

</SCRIPT>

Obviously substitute the actual name of the field in your instance for last_form_fill_url.

Anonymous
Not applicable

Re: Grab URL in Hidden Field without JS or parameters

Thanks All. I guess it was wishful thinking. I appreciate it