Search code examples
javascriptseosearch-engine

How does this website know my GOOGLE Search String


I recently went to the WROX forum. I was led there by GOOGLE. On the top of the page I got this message

Welcome,  user.
Your Google search for 'bosh iis' brought you to Wrox Forum

Out of curiosity, does anyone know how could they track this?

Thanks!


Solution

  • They can read the HTTP referrer header that contains the search string.

    Simplifying a bit: someone clicks a link on a Google search results page (which has the search query as part of the URL) to some other page. This page can read the URL of the previous page (which was the Google search).

    Using the same technique web developers can discover which pages have links to their page.