Hi,
I have a form for which I want a hidden field's value to to be automatically populated with a part of the URL of the last page the person visited.
domainname.com/en/products/valueIwanttotrack
I understand the first part of the process which is to hide the field, select a default value, "get value from: Referrer Parameter" but what I don't get is what do I have to put into the parameter name? Tried a couple of options but none are working. I have to track what comes after products/ .
Anyone can help me with this?
I wanted to go into field management and look at some strings to gain a better understanding of the process but all I see is that a field is a "string" but can't see the URL path behind it. How do I get this info?
Thank you!
Solved! Go to Solution.
Add an HTML block (this example assumes product is the name of your hidden field, change appropriately);
<SCRIPT>
MktoForms2.whenRead(function(form){
form.addHiddenFields({ product: document.location.pathname.match(/[^/]*$/)[0] });
});
</SCRIPT>