Question

I use document.referrer to read the referrer url via JavaScript e.g. if a user clicked a google search result link and lands on my website:

http://www.google.com -> Click on search result -> redirect -> http://www.mysite.com => document.redirect returns correct referrer

Now, this works fine as long as the google search result was delivered via http but if instead httpS is used, document.referrer is always empty:

https://www.google.com -> Click on search result -> redirect -> http:/www.mysite.com => document.redirect is empty

How can I work around this?

Was it helpful?

Solution

When you search from https://www.google.com, websites you visit from our organic search listings will still know that you came from Google, but won't receive information about each individual query.

Please read: http://googleblog.blogspot.com/2011/10/making-search-more-secure.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top