> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.unicornplatform.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# 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
###### 


### ![](https://storage.crisp.chat/users/helpdesk/website/-/7/e/7/8/7e782a40c0560c00/powertoysyapl21zw68_4da32q.gif =900x600)



1.  **Add a Hidden Field to Your Form**
In each of your forms, add the following hidden input field


![](https://storage.crisp.chat/users/helpdesk/website/-/7/e/7/8/7e782a40c0560c00/discordhtjmqe41om_4k0q4f.png)

|| Hidden field must be added manually to each form



2. 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 urlFields = document.querySelectorAll(".page-url"); 
  urlFields.forEach(function(field) {
    field.value = window.location.href;   
  });
});
</script>
```



3. 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
![](https://storage.crisp.chat/users/helpdesk/website/-/7/e/7/8/7e782a40c0560c00/image_1570gjw.png =500x500)
