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
- Add a Hidden Field to Your Form
In each of your forms, add the following hidden input field
- 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>
- 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
Thank you!