How to catch the search query when the user comes from a search engine to the web site?

Is it possible to transfer a search query to the url or to catch it somehow in order to show more relevant similar products on the landing page ? For ex.

  • if the search query is "red tiles" we would like to show other variants of red tiles
  • if the search query is "Versace tiles" we would like to show other variants from the same brand