Google Explains How to Identify Search Traffic in Your Logs. A Script That Counts It
Google published a new Search Central page on Nov. 12 listing the exact referrer values its Search pages send, and why analytics never matches Search Console. We turned the list into a short script that counts Google landings in a server log.
Google published a new Search Central page on Nov. 12, 2026 that explains how to identify Google Search traffic from the HTTP Referer header in analytics and server logs.
Google Search on the web sends only the origin, such as https://www.google.com/ or a local domain like https://www.google.co.uk/, never the page path or the search query.
The Google app on Android can send android-app://com.google.android.googlequicksearchbox/https/www.google.com, and Discover and Google Images send the same values as Search, so a referrer alone cannot separate them.
Google lists why analytics will show fewer visits than Search Console clicks: missing referrers, client-side redirects, blocked scripts, consent choices, and clicks that never finish loading the page.
The script in this post counts landing pages with a Google referrer in an Apache or Nginx log and leaves out files, redirects, Gmail and look-alike domains.
Google has published a new Search Central page on how to identify Google Search traffic in your analytics and server logs. It went up on Nov. 12, 2026, and it settles a question site owners ask every time their numbers disagree: what exactly does a visit from Google look like when it reaches your server?
The answer is the HTTP Referer header, and Google now lists every value it sends. We turned that list into a short script that counts Google landings in a raw access log, tested it, and put it below. The page applies worldwide: it covers every local Google domain, not only google.com.
What referrer does Google Search send?
Google Search sends only the scheme and host, nothing else. Google says it uses the origin referrer policy, so your server sees https://www.google.com/ and never the page of results or the words someone searched. Searches on a local Google domain send that domain instead, for example https://www.google.co.uk/ or https://www.google.de/.
The values Google lists:
Google Search on the web:https://www.google.com/ or a local Google domain.
Google app on Android:android-app://com.google.android.googlequicksearchbox/https/www.google.com when the link opens in a browser tab inside the app, or the same web values as above.
Google app on iOS:https://www.google.com/ or a local Google domain.
Discover: the same value as the surface the person was using, such as the Google app.
Google Images and other services on the same domains: the same values again.
That last point matters. A Google referrer tells you a visit came from Google, not which part of Google. For Discover clicks on their own, use the separate Discover report in Search Console. And the search query is never in the header: Google sends you to the Search Console Performance report for that.
Does the referrer show AI Mode or AI Overviews clicks?
No. Google's new page doesn't mention AI Mode or AI Overviews at all, and since both live on Google's own Search domains, a click from them carries the same origin value as any other Search click. Nothing in the header separates them. Search Console's Generative AI performance report is the place to see them; we explained how to read it in our post on the Nov. 9 to 11 impressions gap, and how ChatGPT visits show up in analytics in does Google Analytics show ChatGPT traffic.
Why don't Search Console and Google Analytics match?
Because they count different events. Search Console records a click when someone selects your result; analytics records a visit only after your page loads and its tracking code runs. Google's page lists what falls into that gap:
No referrer at all. Private browsing, anti-fingerprinting protection, some browsers when a result opens in a new tab, moving from a phone widget to a browser, and privacy extensions can all blank the header. Those visits land in "direct".
Client-side redirects. A JavaScript redirect replaces Google's referrer with your own page's address. A redirect that drops the query string also drops parameters such as gclid. A stricter Referrer-Policy on the redirecting page can remove the referrer too.
Blocked or delayed tracking. Ad blockers, consent choices and privacy settings stop the script from running at all.
Paid clicks. Search Console counts only organic clicks, while analytics totals can include Google Ads traffic, depending on your setup.
If your analytics files Google visits under "referral" or "direct", Google says to check your custom channel rules, referral exclusions and filters first.
How to count Google Search visits in a server log
Server logs see visits that blocked scripts hide from analytics, so they are the closest you can get to Search Console's click count from your own side. Google gives two rules for logs: match on the Referer field, and count only landing pages, because images, CSS and JavaScript files send your own page as their referrer.
This Node.js script follows both rules. It reads an Apache or Nginx log in the common "combined" format, keeps successful page requests, and counts those whose referrer is a Google Search value from the list above. Save it as google-landings.mjs and run node google-landings.mjs access.log.
// Count Google Search landing pages in a web server access log// (Apache/Nginx "combined" format). Usage: node google-landings.mjs access.logimport { createReadStream } from 'node:fs';import { createInterface } from 'node:readline';// www.google.com and local Google domains such as www.google.co.uk, www.google.com.au, www.google.deconst GOOGLE_WEB = /^https:\/\/(www\.)?google\.(com|co\.[a-z]{2}|com\.[a-z]{2}|[a-z]{2})\/$/;// The Google app on Android, when the link opens in a browser tabconst GOOGLE_APP = /^android-app:\/\/com\.google\.android\.googlequicksearchbox(\/|$)/;// Requests for files, not pages (these carry your own page as the referrer anyway)const ASSET = /\.(css|js|mjs|map|png|jpe?g|gif|webp|avif|svg|ico|woff2?|ttf|xml|txt|json|pdf|mp4|webm)$/i;// "METHOD /path HTTP/x" status bytes "referer" "user-agent"const LINE = /"(GET|HEAD) ([^ ]+) [^"]*" (\d{3}) \S+ "([^"]*)" "([^"]*)"/;const counts = new Map();let pages = 0, fromGoogle = 0, blank = 0;const rl = createInterface({ input: createReadStream(process.argv[2]) });for await (const line of rl) { const m = LINE.exec(line); if (!m) continue; const [, method, target, status, referer] = m; const path = target.split('?')[0]; if (method !== 'GET' || status !== '200' || ASSET.test(path)) continue; pages++; if (referer === '-' || referer === '') { blank++; continue; } if (GOOGLE_WEB.test(referer) || GOOGLE_APP.test(referer)) { fromGoogle++; counts.set(path, (counts.get(path) || 0) + 1); }}console.log(`Page views: ${pages}. From Google Search, Discover or Images: ${fromGoogle}. No referrer: ${blank}.`);for (const [path, n] of [...counts].sort((a, b) => b[1] - a[1]).slice(0, 20)) console.log(String(n).padStart(6), path);
How we tested it
We wrote an 11-line test log with one line for each case on Google's page and each trap we could think of: www.google.com, www.google.co.uk, www.google.com.au and www.google.de referrers, the Android app value, an image request carrying our own page as referrer, a visit with no referrer, a Bing visit, a Gmail (mail.google.com) referrer, a 301 redirect from Google, and a look-alike host, www.google.com.evil.example. The script reported 9 page views, 5 from Google and 1 with no referrer. The five were exactly the four Google domains and the Android app line; the image, redirect, Bing, Gmail and look-alike lines were all left out, as they should be.
Two things to adjust for your own site. If your pages end in .html or .php, they still count; only the file types in the ASSET line are skipped, so add any others your site serves. And if you sit behind a CDN such as Cloudflare, your origin server's log may not see cached page views at all, so run the script on the CDN's logs where you can.
What to do this week
Run the script on a week of logs and set the count next to Search Console clicks for the same week. A gap is normal; a gap that suddenly widens points at a broken redirect, a consent banner or a tracking change.
Look for client-side redirects on your top landing pages, especially old URLs that bounce through JavaScript. Replace them with server-side 301s so the referrer and any gclid survive.
Check your Referrer-Policy header. It controls what your site sends to others, but on a redirect hop it can also strip what Google sent. strict-origin-when-cross-origin, the browser default, is fine.
Don't build a report that splits Discover, Images and Search by referrer. Google has now said in writing that the values are the same.
What we don't know yet
Google's page carries no date for when the Android app value or the origin policy started, and it says nothing about AI Mode, which leaves Search Console as the only place Google reports it. We also haven't seen whether Google will add a way to tell Search, Discover and Images apart in the referrer; nothing on the page suggests it.
Kiran runs Kihan Marketing, a web design, SEO and ads agency, and manages dozens of websites across real estate, home services and healthcare. He writes about SEO, AI search and paid ads news, and what it means for the people who run websites.