Document.referrer not working properly in netlify forms

Hi folks,

I added the document.referrer into my contact form data.

When I monitor the requests in the network tab, the referrer field I set is being submitted however in netlify forms it is being overwritten by the landing page.

Is netlify setting the document.referrer for me?

If so, why is it setting the wrong url? I’d like my form submission emails to include the document.referrer (the real one - google or bing) not the landing page/url which netlify seems to be setting for me. When I test the site local host/inspect element, the referrer is corrent it shows http://google.com, however on the production site it is wrong.

Please help.

Hiya, sorry you are having trouble getting your forms to work.

This Support Guide is the first port of call to debug any forms issues. There are also many other Support Guides for forms - you can find them here: #Netlify-support:support-guides

We also recommend trying to search the forums or look at topics tagged Netlify forms if you haven’t already - it’s likely your question was already asked by someone else!

If you are still having problems, please provide more information such as what you have already tried, and a link to your live form. :slight_smile:

I have already tried everything.

If I found a solution in the support guides, I wouldn’t be posting here.

Please read my thread.

Current issue: netlify forms is overriding the document.referrer

This is my code

Screen Shot 2021-03-11 at 9.10.56 PM

Hey there, @emediately :wave:

Thanks for following up. On the Support Team, we know firsthand just how much information can be in the Forums! That is why we always want to double check that folks have found and seen any applicable resources.

If the forms support guide was not beneficial, please respond to this post with:

  1. The URL for your live form as you want visitors to use it
  2. The URL of your deployed html form. In case you have a javascript form, we need to literally be linked to the html version you’ve deployed, as mentioned above (look for “ pure javascript form ”)
  3. The form name that you’ve set and that shows in our UI
  4. Any errors or logs from the Netlify build logs, dashboard or browser developer console
  5. Description of anything you have tried that did or didn’t help or make things better/worse

Thank you!