Wilf

http referer not capturing the query string from search engines

Sunday 23rd July 2023 (updated: Monday 1st January 2024)

PHP

Research

I recently created a small project to capture the URL of sites that have referred to my own website. Interestingly it seems that search engines have suppressed the query string part of the URL.

e.g. for the URL

https://www.google.com/search?client=firefox-b-d&q=wilfs+corner

I would expect to be able to capture this in its entirety using PHP's

$_SERVER["http_referer"]

What is actually sent from the search engines is just the root domain. e.g. https://www.google.com/ Frustrating but then I suppose they have their own analytic tools.