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?
Solved! Go to Solution.
You'll need to use a script to populate this field, something like this:
<script>
MktoForms2,whenReady(function(form){
form.vals({"yourFieldApiName":document.location});
})
</script>
This will add the URL of the page into the specified field, yourFieldApiName.
document.location tho
I've got a one track mind these days. Fixed.
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.
Hi Kenny. I am not a developer. Where would I specifically add this script? Thanks!
You can just add an HTML block to your page and input the script there. The block should be ordered after your form.
This would just be the Marketo Landing Page template HTML correct?
No the page itself, not the template, unless you want this behavior to occur with all forms on pages based on that template.
Hello again Kenny. Below is my script I added as an HTML block and it is below the form block. For some reason it isn't populating that custom field.
<script>
MktoForms2,whenReady(function(form){
form.vals({"Latest_Form_Form_Webpage__c":document.location});
})
</script>