Search code examples
formsurlwufoo

Track the URL page the user filled in an Enquiry form


I'd like to know how can I track the URL than the user filled a form.

I'm have just HTML/CSS knowledge, could someone provide me some sample code in order to incorporate in my code.

Thanks, Bruno


Solution

  • Bruno I'm not sure if I understand your question correctly. If it is you want to track the URL that someone was on before they came to the form then you likely are going to be doing this through either a URL modification or using the document.referrer property in Javascript.

    If you want to pass information on from a link to your wufoo form, let's say you have a field called 'website' which is fieldId 87 then you could send this to the hosted Wufoo form as: http://[yourWufooUrlHere]/def/field87=stackoverflow and it will populate whichever field you pass in the variable into the form.

    However if you don't know where people are coming from you need to embed the form into your website using the Javascript method and you would change/add the line where it says: 'ssl':true}; to 'ssl':true, 'defaultValues':'field87='+document.referrer}; assuming the field you want to change is field87.

    Just tested this and it works fine. Let me know if you need a full code block example.

    Good luck