Articles on: Forms

How to Automatically Capture the Page URL for Every Form Submission in Unicorn Platform and Send It to Google Sheets


You have forms placed across hundreds of pages on your Unicorn Platform website, and you’d like to know which specific page the form was submitted from






  1. Add a Hidden Field to Your Form

In each of your forms, add the following hidden input field

Hidden field must be added manually to each form




  1. Go to Settings → General Settings → Global <body> HTML code and add the following code. It applies to all pages:
<script>

document.addEventListener("DOMContentLoaded", function () {
var pageUrlField = document.getElementById("page_url");
if (pageUrlField) {
pageUrlField.value = window.location.href;
}
});
</script>




  1. If your form is already connected to Google Sheets the 'page_url' value will automatically be passed along with every submission. You’ll see this info as a column (page_url) in your connected Google Sheet


Updated on: 09/07/2025

Was this article helpful?

Share your feedback

Cancel

Thank you!