How To

How to include current URL in a Webflow form?

In the course of my professional endeavors, I consistently inquire about the origins of information, the methods by which our audience discovers us, and the roots of potential leads. These inquiries, among others, are integral to unraveling the complexities of the marketing funnel.

A commonplace challenge encountered by numerous marketers on a daily basis revolves around a pivotal question: which blog post proves most effective in generating leads and conversions?

If you have a blog on Webflow that includes a lead gen form or a newsletter form in all blog posts, when you receive an email from one of the forms – of course, you have to find out the URL of the respective page. This way, you can detect the top converting posts.

I’ve been searching for a solution here and there and finally found it. So, I thought to share it here.

How to automatically include the current URL in the webflow form?

  1. Add an embed code before the submit button of your lead generation form or any other form type – make it hidden, and insert the following code into it then save.
  2. The javascript code you need to make this work:
<script type="text/javascript"> window.onload=function() 
{document.getElementById('pageurl').value = window.location.href;} </script> 
<input type="hidden" id="pageurl" name="pageurl" value="pageurl" />

3. Once published, any new form submission will have a new column called “pageurl” so you can detect the source page of this submission.

Follow us for more Webflow hacks.

More Webflow hacks to check today

Related Articles