Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I put this basic code on my website, and alert with document.referrer:


And when I do a search the link is:


But when I click on my website the alert that pops up is:


I am trying to make a script that reacts based on different search terms that people use to enter my website, but this is stopping me dead in my tracks.

share|improve this question

migrated from stackoverflow.com Jan 3 '13 at 12:47

This question came from our site for professional and enthusiast programmers.

up vote 4 down vote accepted

This is deliberate. To quote from this post on the Official Google Webmaster Central blog:

"Starting in April, for browsers with the appropriate support, we will be using the "referrer" meta tag to automatically simplify the referring URL that is sent by the browser when visiting a page linked from an organic search result. This results in a faster time to result and more streamlined experience for the user.

What does this mean for sites that receive clicks from Google search results? You may start to see "origin" referrers—Google’s homepages (see the meta referrer specification for further detail)—as a source of organic SSL search traffic. This change will only affect the subset of SSL search referrers which already didn’t include the query terms. Non-HTTPS referrals will continue to behave as they do today."

The fundamental reason for this feature is privacy: if you're using HTTPS to protect your search queries and results from eavesdropping, it's a pretty good bet that you also wouldn't want those same search terms sent out along with any link you click from those results (possibly over an unsecured HTTP connection, too).

For details, see What can I expect from search over SSL? on Google Web Search Help pages.

share|improve this answer
...of course, since Google now serves search results over HTTPS by default for logged in users, I doubt most users are using SSL deliberately to protect the privacy of search queries. – josh3736 Jan 3 '13 at 1:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.