SOLVED

Want to populate a field that has the actual URL a web form is filled out on.

Go to solution
Nate_Oosterhous
Level 7

For our Marketo Landing Pages with Forms on them we want to capture what webpage url the form was filled out on.  {{trigger.Web Page}} does not work because that only give the Marketo description name.  We need the full url of the Landing Page.  How can we do this?

1 ACCEPTED SOLUTION
SanfordWhiteman
Level 10 - Community Moderator

Actually, our bad, do

form.addHiddenFields

not

form.vals

View solution in original post

28 REPLIES 28
Kenny_Elkington
Marketo Employee

You can change document.location to document.location.toString.split('?')[0]

Nate_Oosterhous
Level 7

Here is what I have but it is not removing the UTM parameters:

<script>

MktoForms2.whenReady(function(form){

     form.addHiddenFields({"Latest_Form_Form_Webpage__c":document.location.toString.split('?')[0]});

})

</script>

SanfordWhiteman
Level 10 - Community Moderator

document.location.toString().split('?')[0]

or (my preference)

document.location.href.split('?')[0]

Nate_Oosterhous
Level 7

Kenny and Sanford thank you for your help!  You guys are awesome!

SanfordWhiteman
Level 10 - Community Moderator

Cool man, keep asking the good questions...

Kenny_Elkington
Marketo Employee

I've got a one track mind these days.  Fixed.

SanfordWhiteman
Level 10 - Community Moderator

I don't think I could ever love/hate anyone as much as I love/hate documentation. If you're in a doc groove, I'm jealous.

SanfordWhiteman
Level 10 - Community Moderator

document.location tho