Webflow sync, pageviews & more.
NEW

How can I allow Webflow Forms to capture the current article's URL so that I can receive emails with that URL and better follow-up on inquiries related to each specific article on my site?

TL;DR
  • Add a hidden form field named pageURL and leave its value blank.
  • Use JavaScript to set the hidden field’s value to the current page URL with window.location.href.
  • Test the form on a live page to ensure the URL is captured correctly.
  • Update the email notification template to include {{pageURL}} for visibility in form submission emails.

To capture the current article’s URL in Webflow Forms and receive it via form submission email, you can pass the page URL to a hidden field in the form using JavaScript.

1. Add a Hidden Field to Your Form

  • Select your form in the Designer.
  • Drag in a “Hidden” form field from the Add panel.
  • Give it a clear name via the Name attribute, such as pageURL (not just the Label).
  • Leave the Value field blank — it will be populated dynamically using JavaScript.

2. Include Custom Code to Autofill the URL

  • Go to Page Settings or use an Embed element if it’s a reusable blog component.

  • Add this script inside an Embed with <script> tags (or add to Project Settings > Custom Code > Footer if site-wide):

    ```

    ```

  • This script finds the hidden input with name="pageURL" and sets its value to the current page’s full URL.

3. Test the Form Submission

  • Publish your site and navigate to a live blog post.
  • Submit the form.
  • Check the form submission email or the Webflow Forms Dashboard.
  • You should see the exact URL of the article included in the field pageURL.

4. Optional: Customize the Email Template

  • Go to Project Settings > Forms.
  • Update the Form Notification Template to display pageURL where you want in the email.
    Example:
    "Article URL: {{pageURL}}"
    This ensures the value shows clearly in email submissions.

Summary

To capture an article’s URL in Webflow Form submissions, add a hidden input named pageURL, then use JavaScript to dynamically populate it with window.location.href. Update email templates to include this value for better visibility when following up.

Rate this answer

Other Webflow Questions