Short answer: SQL for SEO means joining Search Console, crawl, server log and conversion data at URL level so that crawl, visibility and revenue can be compared in one query. Load the Search Console bulk data export and GA4 export into BigQuery, add verified log and crawl tables, normalise URLs, then ask commercial questions no single tool can answer.
Key Takeaways
- No single SEO data source is decision grade on its own. Search Console lacks crawl data, logs lack demand, crawlers guess, and analytics lacks both.
- The Search Console bulk data export does not backfill. Every week you delay setting it up is history you never get back.
- The join key is the hard part, not the SQL. Agree URL normalisation rules before anyone writes a query.
- Verify bots by DNS or published IP ranges. A user agent string on its own proves nothing.
- Split AI bots into search, training and user-triggered fetchers. Lumping them together gives you a number nobody can act on.
- Partition by date, filter on the partition, and put a data contract in place before any metric reaches the board.
In This Post
- Why Does Single-Tool SEO Data Mislead Leadership?
- The SEO Data Model: Five Sources, One URL Table
- How Do You Send Search Console Data to BigQuery?
- The Join Key Problem: URL Normalisation
- Five Questions Worth a Query
- How Do You Verify Googlebot and Other Bots in Logs?
- Log File Analysis for AI Bots
- What Does It Cost, and Who Owns What?
- Who Actually Writes the SQL?
- FAQs
- Final Thoughts
- More Resources
Every SEO tool on the market will tell you something true about your site.
But not one of them will tell you which crawled pages earn nothing, because none of them holds all four datasets at once.
SQL for SEO fixes that. It lets you join crawl, server log, Search Console and conversion data at URL level, then ask the questions a board actually cares about.
In this post, you’ll learn how I design the SEO data model my analysts query in BigQuery, the five questions I think are worth a query, how to verify Googlebot and AI bots properly, and what governance has to sit around it.
[DATA: Dan to add one sentence of proof as a ratio, for example “One joined table showed that X% of Googlebot requests on a low-value section went to URLs with zero impressions, and fixing it cut that share by Y%.”]
Make no mistake, this is not a Python tutorial or a log tool review. It’s the plumbing behind SEO measurement and executive reporting that survives scrutiny from a CFO.
Why Does Single-Tool SEO Data Mislead Leadership?
Each SEO data source answers one question well and every other question badly.
Search Console tells you about demand and visibility, but it knows nothing about how Googlebot spends its time on your server.
Server logs are the ground truth for crawling, but a log line has no idea whether that URL earned a single impression.
Crawl tools such as Screaming Frog show you what your internal links and templates expose, which is a model of the site rather than what bots actually requested.
And analytics shows sessions and revenue, but nothing about crawling or rankings.
The four-source rule: no single SEO data source is decision grade on its own.
Take crawl budget as an example. Google’s own guide says crawl budget is mainly a concern for large sites with a million or more unique pages, or sites of 10,000 or more pages that change daily.
If you run a site like that, “are we wasting crawl?” is a question that needs logs and Search Console in the same query. Anything else is guesswork with a nice chart on top.
| Source | What it is good at | What it cannot tell you |
|---|---|---|
| Search Console bulk export | Impressions, clicks and position by URL, query, country, device and search type | What bots requested, what converted |
| Server or CDN logs | Every request, user agent, IP, status code and timing: the ground truth for crawling | Demand, rankings, revenue |
| Crawl export (Screaming Frog) | Indexability, canonicals, internal links, depth, page type | What bots actually did |
| GA4 BigQuery export | Sessions, landing pages, events, ecommerce revenue | Crawling, impressions |
| CRM or affiliate platform | Registrations, deposits, subscriptions, lifetime value | Anything about search |
The SEO Data Model: Five Sources, One URL Table
Think of the model as three layers: raw tables you never edit, a reference layer of rules, and a small set of modelled tables people actually query.
Everything meets on one key: a normalised URL plus a date.
[IMAGE NEEDED] Data model diagram, built as SVG. Left column, five source boxes: (1) Search Console bulk export: searchdata_url_impression, searchdata_site_impression, ExportLog; (2) GA4 export: analytics_<property_id>.events_YYYYMMDD; (3) Server or CDN logs: seo_raw.access_logs; (4) Crawl snapshots: seo_raw.crawl_snapshots; (5) CRM conversions: seo_raw.conversions. Middle column, reference layer: seo_ref.url_key() function, seo_ref.bot_ip_ranges, seo_ref.bot_user_agents, seo_ref.page_type_rules, seo_ref.releases. Right column, modelled layer: dim_url, fct_bot_requests_daily, fct_search_daily, fct_conversions_daily, all feeding fct_url_daily keyed on url_key + date. Arrows labelled "daily, scheduled". Footnote: "All tables partitioned by date." No real project or dataset names. | Alt: SQL for SEO data model diagram showing five SEO data sources joined into one URL-level table in BigQuery | Caption: The SEO data model: five sources, a reference layer and one URL-level fact table. Image created by author, October 2026
Search Console Bulk Data Export
The Search Console bulk data export writes three tables into a BigQuery dataset: searchdata_site_impression, searchdata_url_impression and ExportLog, according to Google’s table guidelines.
The URL table is the one you join on. It holds data_date, site_url, url, query, is_anonymized_query, is_anonymized_discover, country, search_type, device, a set of is_[search_appearance] booleans, plus impressions, clicks and sum_position.
The site table is the property-level view, with sum_top_position instead of sum_position.
Position is stored as a sum, not an average. Look what Google’s own documentation says:
“To calculate average position (which is 1-based), calculate SUM(sum_position)/SUM(impressions) + 1.”
Source: Google Search Console Help, Table guidelines and reference
Rare queries are flagged with is_anonymized_query and the query text is withheld, but the rows still carry impressions and clicks. That matters, because it means URL totals stay complete even when the query detail is missing, a point Trevor Fox makes in his bulk export guide.
ExportLog records each successful export by date and namespace. Failed exports are not recorded, so a missing date in ExportLog is your first data quality alarm.
Crawl Data
Schedule a crawl of each site at a fixed cadence and land the export in seo_raw.crawl_snapshots, one partition per crawl date.
Keep the fields that describe intent: status code, indexability, canonical URL, inlinks, crawl depth, and a page type assigned by URL pattern rules held in seo_ref.page_type_rules.
The page type segment is what turns 400,000 URLs into twelve rows a leadership team can read.
Server and CDN Logs
Logs come from the web server or the CDN: Apache or Nginx access logs, AWS CloudFront, Azure Front Door or Cloudflare. [CONFIRM: Dan to name the log source his teams use.]
Keep the timestamp, host, path, query string, method, status code, bytes, response time, user agent and client IP.
Then deal with personal data straight away. Human visitor IPs are personal data, so the pipeline should keep raw IPs only for rows whose user agent claims to be a bot, and truncate or drop the rest before the table is shared.
Each bot row gets enriched with bot_family, bot_category and is_verified during load, which I cover in the verification section below.
GA4 Export and Conversion Data
The GA4 export lands in a dataset named analytics_<property_id>, with a daily events_YYYYMMDD table, per Google’s GA4 BigQuery export schema.
Page URLs sit inside the repeated event_params record under the key page_location, so you unnest it. Google’s basic query examples show the pattern and use _TABLE_SUFFIX to limit which daily tables are read.
For channel, the session_traffic_source_last_click record holds last-click source and medium. Revenue sits in ecommerce.purchase_revenue for purchase events.
Registrations, deposits and subscriptions usually live in a CRM or affiliate platform, not GA4. Join them through a hashed identifier agreed with the data protection lead, never a raw email address.
Tip: If you only take one thing from this section, take the table schema map below to your data team. It turns a vague “can we get SEO data into BigQuery?” into a scoped piece of work.
| Table | Grain | Key columns | Partition | Owner |
|---|---|---|---|---|
| searchconsole.searchdata_url_impression | URL x query x country x device x search type x day | data_date, url, query, impressions, clicks, sum_position | data_date | Google (export), data team (access) |
| analytics_<id>.events_YYYYMMDD | Event | event_date, event_name, user_pseudo_id, event_params, session_traffic_source_last_click | Daily sharded tables | Google (export), analytics team |
| seo_raw.access_logs | Request | request_ts, host, path, status, user_agent, client_ip | DATE(request_ts) | Data engineering |
| seo_raw.crawl_snapshots | URL x crawl | crawl_date, url_key, status_code, indexability, canonical, inlinks, depth | crawl_date | SEO team |
| seo_raw.conversions | Conversion | conversion_ts, landing_url_key, conversion_type, value, hashed_id | DATE(conversion_ts) | CRM or finance |
| seo_mart.dim_url | URL | url_key, page_type, section, market, is_indexable | None | SEO team |
| seo_mart.fct_bot_requests_daily | URL x bot x day | request_date, url_key, bot_family, bot_category, is_verified, status_class, hits | request_date | Data engineering |
[TEMPLATE LINK: Download the table schema map and URL normalisation rules as a Google Sheet.]
How Do You Send Search Console Data to BigQuery?
Moving Google Search Console to BigQuery is a settings change, not an engineering project. Google’s setup guide breaks it into a handful of steps.
Step 1: Create or choose a Google Cloud project with billing enabled.
Step 2: Enable the BigQuery API and the BigQuery Storage API for that project.
Step 3: In IAM, grant the service account search-console-data-export@system.gserviceaccount.com the BigQuery Job User and BigQuery Data Editor roles.
Step 4: In Search Console, go to Settings, then Bulk data export, enter the project ID, choose a dataset name (it starts with searchconsole) and pick a dataset location. Choose the location carefully, because changing it later is not straightforward.
Step 5: Wait. Google says:
“The first export will happen up to 48 hours after your successful configuration in Search Console.”
Source: Google Search Console Help, Start a new bulk data export
But here’s the catch most guides skip. The export is not retroactive.
Google’s own advice is that if you want historical data from before your setup, you use the Search Console API or the reports instead. Simply put, history starts the day you switch it on.
The feature was announced on the Search Central blog in February 2023, and Search Engine Land reported it was available to everyone by the end of that month. If your properties still don’t have it on, that’s more than three and a half years of URL-level history already gone.
Tip: Set a partition expiration, not a table expiration, if you want to cap storage. Google’s guide says the minimum partition expiration is 14 days, and it warns against changing the table schema, which breaks the export.
The Join Key Problem: URL Normalisation
This is where most SEO data projects quietly fail.
Search Console gives you full URLs with protocol and host. Logs give you a host and a path, often with a query string. Crawl exports give you whatever the crawler found. GA4 gives you page_location with tracking parameters attached.
If those four strings don’t match, the join returns nothing and someone concludes the data is broken.
The fix is one shared function, seo_ref.url_key(), that every table uses. I define the rules; the analysts implement and test them.
| Rule | Example input | Normalised | Watch out for |
|---|---|---|---|
| Drop protocol | https://example.com/a/ | example.com/a | Mixed http and https history |
| Lower-case the host | Example.COM/a | example.com/a | Never lower-case the path unless the server is case-insensitive |
| Strip fragments | example.com/a#faq | example.com/a | None |
| Strip tracking parameters | example.com/a?utm_source=x | example.com/a | Keep an allowlist (pagination, filters you index) |
| Trailing slash | example.com/a/ | example.com/a | Only if the site treats both as one URL |
| Rebuild log URLs | host + path + query | example.com/a | Logs from a CDN may record the origin host |
| Keep market folders | example.com/ie/a | example.com/ie/a | Never merge hreflang alternates; they are separate URLs |
An illustrative version of the function looks like this. It is deliberately simple, and the allowlist logic is left out.
Illustrative, not production
-- Illustrative, not production. Persistent UDF in the reference dataset.
CREATE OR REPLACE FUNCTION seo_ref.url_key(u STRING) AS (
REGEXP_REPLACE(
REGEXP_REPLACE(
REGEXP_REPLACE(u, r'^https?://', ''), -- drop protocol
r'[?#].*$', ''), -- drop query string and fragment
r'/$', '') -- drop trailing slash
);
-- Host lower-casing and the parameter allowlist are applied in the
-- load jobs, where host and path are still separate fields.
Five Questions Worth a Query
Let me save you hours. Most SEO dashboards fail because nobody asked what decision the chart should change.
So every query in the model starts with a plain-English question, a reason a leader should care, and the decision it is meant to drive.
| Question | Sources joined | Decision it drives |
|---|---|---|
| 1. Which URLs does Googlebot crawl that earn zero impressions? | Logs, Search Console, crawl | Noindex, consolidate, block or fix internal links |
| 2. What share of crawling comes from AI bots, by section? | Logs, crawl | robots.txt and CDN bot policy, AI visibility investment |
| 3. Which pages get impressions but no conversions? | Search Console, GA4, CRM | Rewrite for intent, change CTA, or stop investing |
| 4. Did crawl frequency change after a release, and did rankings follow? | Logs, Search Console, releases | Roll back, hotfix, or sign off the release |
| 5. Which orphan pages still get bot hits? | Logs, crawl | Relink, redirect or retire |
All five queries below read from the modelled tables, so they are short. They are illustrative: they show the join logic, not code to paste into production.
1. Which URLs Does Googlebot Crawl That Earn Zero Impressions?
Why a leader cares: every request Googlebot spends on a URL nobody sees is a request not spent on the pages that make money. On a large site, that’s index bloat and slow discovery of new content.
Illustrative, not production
-- Illustrative, not production
DECLARE start_date DATE DEFAULT DATE_SUB(CURRENT_DATE(), INTERVAL 31 DAY);
DECLARE end_date DATE DEFAULT DATE_SUB(CURRENT_DATE(), INTERVAL 4 DAY); -- allow for export lag
WITH googlebot AS (
SELECT url_key, SUM(hits) AS googlebot_hits
FROM seo_mart.fct_bot_requests_daily
WHERE request_date BETWEEN start_date AND end_date
AND bot_family = 'Googlebot'
AND is_verified
GROUP BY url_key
),
search AS (
SELECT seo_ref.url_key(url) AS url_key,
SUM(impressions) AS impressions
FROM `my-project.searchconsole.searchdata_url_impression`
WHERE data_date BETWEEN start_date AND end_date -- partition filter
AND LOWER(search_type) = 'web'
GROUP BY url_key
)
SELECT
d.section,
d.page_type,
COUNT(*) AS urls_crawled,
COUNTIF(IFNULL(s.impressions, 0) = 0) AS urls_with_zero_impressions,
ROUND(SAFE_DIVIDE(
SUM(IF(IFNULL(s.impressions, 0) = 0, g.googlebot_hits, 0)),
SUM(g.googlebot_hits)), 3) AS share_of_crawl_on_zero_impression_urls
FROM googlebot AS g
LEFT JOIN search AS s USING (url_key)
LEFT JOIN seo_mart.dim_url AS d USING (url_key)
GROUP BY d.section, d.page_type
ORDER BY share_of_crawl_on_zero_impression_urls DESC;
A zero doesn’t always mean waste. Parameter duplicates, paginated archives and expired pages often show up here, and they are usually exactly what you are hunting for.
The decision it drove: [DATA: Dan to add the section, the share of verified Googlebot hits on zero-impression URLs before the fix, the action taken, and the share after, as percentages].
2. What Share of Crawling Comes From AI Bots, by Section?
Why a leader cares: AI crawling is now a measurable input to AI visibility, and a cost on your infrastructure. You need a trend, not an anecdote, before you decide what to allow. This is the raw material for tracking AI traffic properly.
Illustrative, not production
-- Illustrative, not production
-- bot_category values: 'search_engine', 'ai_search', 'ai_training', 'ai_user_fetch'
SELECT
DATE_TRUNC(r.request_date, MONTH) AS month,
d.section,
r.bot_category,
SUM(r.hits) AS hits,
ROUND(SAFE_DIVIDE(
SUM(r.hits),
SUM(SUM(r.hits)) OVER (PARTITION BY DATE_TRUNC(r.request_date, MONTH), d.section)
), 3) AS share_of_section_bot_hits
FROM seo_mart.fct_bot_requests_daily AS r
LEFT JOIN seo_mart.dim_url AS d USING (url_key)
WHERE r.request_date >= DATE_SUB(DATE_TRUNC(CURRENT_DATE(), MONTH), INTERVAL 6 MONTH)
AND r.is_verified
GROUP BY month, d.section, r.bot_category
ORDER BY month, d.section, hits DESC;
The decision it drove: [DATA: Dan to add one finding, for example the section where AI training crawlers took the largest share of verified bot hits, and the policy decision that followed].
3. Which Pages Get Impressions but No Conversions?
Why a leader cares: visibility that never converts is either an intent mismatch or a broken journey. Both are fixable, and both are invisible if you only look at traffic. It’s the data side of goal completion and search intent.
Illustrative, not production
-- Illustrative, not production. Assumes 'sign_up' and 'purchase' are the
-- conversion events on this property; swap in your own.
WITH organic_landings AS (
SELECT
user_pseudo_id,
(SELECT value.int_value FROM UNNEST(event_params)
WHERE key = 'ga_session_id') AS session_id,
seo_ref.url_key((SELECT value.string_value FROM UNNEST(event_params)
WHERE key = 'page_location')) AS url_key
FROM `my-project.analytics_123456789.events_*`
WHERE _TABLE_SUFFIX BETWEEN '20260901' AND '20260930'
AND event_name = 'session_start'
AND session_traffic_source_last_click.cross_channel_campaign.medium = 'organic'
),
converting_sessions AS (
SELECT DISTINCT
user_pseudo_id,
(SELECT value.int_value FROM UNNEST(event_params)
WHERE key = 'ga_session_id') AS session_id
FROM `my-project.analytics_123456789.events_*`
WHERE _TABLE_SUFFIX BETWEEN '20260901' AND '20260930'
AND event_name IN ('sign_up', 'purchase')
),
ga4 AS (
SELECT
l.url_key,
COUNT(*) AS organic_sessions,
COUNTIF(c.user_pseudo_id IS NOT NULL) AS converting_sessions
FROM organic_landings AS l
LEFT JOIN converting_sessions AS c USING (user_pseudo_id, session_id)
GROUP BY l.url_key
),
search AS (
SELECT seo_ref.url_key(url) AS url_key,
SUM(impressions) AS impressions,
SUM(clicks) AS clicks
FROM `my-project.searchconsole.searchdata_url_impression`
WHERE data_date BETWEEN '2026-09-01' AND '2026-09-30'
AND LOWER(search_type) = 'web'
GROUP BY url_key
)
SELECT
s.url_key, d.page_type, s.impressions, s.clicks,
IFNULL(g.organic_sessions, 0) AS organic_sessions,
IFNULL(g.converting_sessions, 0) AS converting_sessions
FROM search AS s
LEFT JOIN ga4 AS g USING (url_key)
LEFT JOIN seo_mart.dim_url AS d USING (url_key)
WHERE s.clicks >= 100
AND IFNULL(g.converting_sessions, 0) = 0
ORDER BY s.clicks DESC;
Two caveats. GA4 sessions will never match Search Console clicks exactly, so compare ratios, not raw counts. And consent mode means some organic sessions are missing from the export entirely.
If conversions live in a CRM, swap the converting_sessions block for a join to seo_raw.conversions on the landing URL key.
4. Did Crawl Frequency Change After a Release, and Did Rankings Follow?
Why a leader cares: releases are the biggest uncontrolled risk to organic revenue. A query that compares 28 days either side of a deploy gives you a sign-off step, not a post-mortem.
Illustrative, not production
-- Illustrative, not production. Values would come from seo_ref.releases.
DECLARE release_date DATE DEFAULT DATE '2026-09-15';
DECLARE section_name STRING DEFAULT 'reviews';
WITH crawl AS (
SELECT
IF(r.request_date < release_date, 'before', 'after') AS period,
SAFE_DIVIDE(SUM(r.hits), COUNT(DISTINCT r.request_date)) AS googlebot_hits_per_day
FROM seo_mart.fct_bot_requests_daily AS r
JOIN seo_mart.dim_url AS d USING (url_key)
WHERE r.request_date BETWEEN DATE_SUB(release_date, INTERVAL 28 DAY)
AND DATE_ADD(release_date, INTERVAL 27 DAY)
AND r.bot_family = 'Googlebot'
AND r.is_verified
AND d.section = section_name
GROUP BY period
),
search_perf AS (
SELECT
IF(s.data_date < release_date, 'before', 'after') AS period,
SUM(s.clicks) AS clicks,
SUM(s.impressions) AS impressions,
SAFE_DIVIDE(SUM(s.sum_position), SUM(s.impressions)) + 1 AS avg_position
FROM `my-project.searchconsole.searchdata_url_impression` AS s
JOIN seo_mart.dim_url AS d
ON d.url_key = seo_ref.url_key(s.url)
WHERE s.data_date BETWEEN DATE_SUB(release_date, INTERVAL 28 DAY)
AND DATE_ADD(release_date, INTERVAL 27 DAY)
AND LOWER(s.search_type) = 'web'
AND d.section = section_name
GROUP BY period
)
SELECT *
FROM crawl
JOIN search_perf USING (period);
Note the average position line. It follows Google’s documented formula, the sum of sum_position divided by impressions, plus one.
[IMAGE NEEDED] Before and after chart for one anonymised release: verified Googlebot hits per day and average position for the affected section, 28 days either side of the deploy. Percentages or indexed values only, no section names. | Alt: Verified Googlebot crawl frequency and average position before and after a release | Caption: Crawl frequency and average position 28 days either side of a release. Image created by author, October 2026
[EXAMPLE: Dan to add one anonymised release where this comparison changed the decision, for example a template change that cut crawl frequency on a section and was rolled back.]
5. Which Orphan Pages Still Get Bot Hits?
Why a leader cares: orphan pages that bots still request are either value you have stopped linking to, or junk Google keeps coming back for. Either way, they belong on the architecture fix list from your technical SEO audit.
Illustrative, not production
-- Illustrative, not production
WITH latest_crawl AS (
SELECT url_key, inlinks
FROM seo_raw.crawl_snapshots
WHERE crawl_date = (SELECT MAX(crawl_date) FROM seo_raw.crawl_snapshots)
),
bot_hits AS (
SELECT url_key, SUM(hits) AS hits, MAX(request_date) AS last_hit
FROM seo_mart.fct_bot_requests_daily
WHERE request_date >= DATE_SUB(CURRENT_DATE(), INTERVAL 30 DAY)
AND is_verified
AND bot_family IN ('Googlebot', 'Bingbot')
AND status_class = '2xx'
GROUP BY url_key
)
SELECT b.url_key, b.hits, b.last_hit, IFNULL(c.inlinks, 0) AS inlinks
FROM bot_hits AS b
LEFT JOIN latest_crawl AS c USING (url_key)
WHERE c.url_key IS NULL OR c.inlinks = 0
ORDER BY b.hits DESC;
The crawl has to start from the homepage and follow links only, without sitemap or list inputs. Otherwise every orphan looks linked.
If you are not ready for BigQuery, the Screaming Frog Log File Analyser can import a list of URLs and match it against log data, which covers this one question well. Its free version is capped at 1,000 log events, though, so it won’t take a large site’s logs.
How Do You Verify Googlebot and Other Bots in Logs?
Anyone can put “Googlebot” in a user agent string. Scrapers do it every day.
So the rule is simple. A bot is only counted once its IP passes DNS verification or matches the operator’s published IP ranges.
Google’s documentation sets out the manual method: run a reverse DNS lookup on the IP, check the domain, then run a forward lookup and confirm it returns the same IP.
“Verify that the domain name is either googlebot.com, google.com, or googleusercontent.com.”
Source: Google Crawling Infrastructure, Verify requests from Google crawlers and fetchers
At log scale, you don’t run DNS lookups row by row. You load Google’s published IP range files (common crawlers, special crawlers and user-triggered fetchers) into seo_ref.bot_ip_ranges and match against them during load.
Bing uses the same principle. A Bing Webmaster blog post by Vincent Wehren explains that a genuine Bingbot IP reverse-resolves to a host ending in search.msn.com, and that you confirm it with a forward lookup.
The AI companies publish ranges too. OpenAI lists separate JSON files for each of its bots, Perplexity publishes ranges for PerplexityBot and Perplexity-User, and Anthropic publishes a single list for its crawlers.
| Operator | Bot | Category | Verification source |
|---|---|---|---|
| Googlebot | Search engine | Reverse and forward DNS, or Google’s published IP range files | |
| Microsoft | Bingbot | Search engine | Reverse DNS to search.msn.com, then forward DNS |
| OpenAI | OAI-SearchBot | AI search | openai.com/searchbot.json |
| OpenAI | GPTBot | AI training | openai.com/gptbot.json |
| OpenAI | ChatGPT-User | AI user-triggered fetch | openai.com/chatgpt-user.json |
| Perplexity | PerplexityBot | AI search | perplexity.com/perplexitybot.json |
| Perplexity | Perplexity-User | AI user-triggered fetch | perplexity.com/perplexity-user.json |
| Anthropic | ClaudeBot | AI training | claude.com/crawling/bots.json |
| Anthropic | Claude-SearchBot | AI search | claude.com/crawling/bots.json |
| Anthropic | Claude-User | AI user-triggered fetch | claude.com/crawling/bots.json |
Sources: OpenAI crawler documentation, Perplexity crawler documentation and Anthropic’s crawler help article, all checked October 2026.
Why does this matter so much? Because unverified rows inflate AI crawl share. If spoofed “GPTBot” traffic sits in your numbers, you’ll overstate how much AI engines care about your content and make the wrong robots.txt call.
Screaming Frog’s own AI bot monitoring tutorial says AI bot spoofing is currently rare, but still recommends investigating IPs that fail verification. I’d go further and exclude them from anything that reaches leadership.
Log File Analysis for AI Bots
What is log file analysis? It’s reading server or CDN request logs to see which URLs search and AI bots actually request, how often, and with what status codes. It’s the ground truth that crawl tools and Search Console only approximate.
Log file analysis for SEO used to mean one bot. Now it means at least four kinds of visitor, and they behave differently.
Search engine crawlers such as Googlebot and Bingbot index the web for search results.
AI search crawlers such as OAI-SearchBot, PerplexityBot and Claude-SearchBot index content so it can appear in AI answers. OpenAI states that sites opted out of OAI-SearchBot will not be shown in ChatGPT search answers.
AI training crawlers such as GPTBot and ClaudeBot collect content that may be used to train models.
User-triggered fetchers such as ChatGPT-User, Perplexity-User and Claude-User fetch a page because a person asked a question. They are not crawling in the classic sense, and robots.txt may not stop them.
“Because these actions are initiated by a user, robots.txt rules may not apply.”
Perplexity says much the same about Perplexity-User: because a user requested the fetch, it generally ignores robots.txt rules.
Then there’s Google-Extended, which trips up a lot of log analysis. It’s a robots.txt control token, not a crawler, so you will never see it in a log.
“Google-Extended doesn’t have a separate HTTP request user agent string.”
Source: Google Crawling Infrastructure, List of Google’s common crawlers
Your CDN can change the picture overnight, too. Cloudflare announced in July 2026 separate Search, Agent and Training controls, with new defaults from 15 September 2026 for newly onboarded domains that block Training and Agent bots on pages that display ads.
The bit that should worry an SEO lead: Cloudflare says multi-purpose crawlers are judged by all their behaviours, so a crawler like Googlebot can be blocked by customers who choose to block Training. If somebody in security flips that switch, your logs are where you’ll see it first.
Here’s how I’d report it monthly:
- Verified hits by bot category, by section, as a share of all verified bot hits.
- The month-on-month change for each AI category.
- Status code mix for AI bots (a spike in 403s usually means a CDN rule, not a content issue).
- Any robots.txt or CDN policy change made that month, so the trend has context.
[IMAGE NEEDED] Stacked area chart, last six months: verified bot hits by category (search engine, AI search, AI training, AI user-triggered fetch) as a share of all verified bot hits, for two or three anonymised sections. Percentages only, axis values removed if needed. Data from Question 2. | Alt: Log file analysis for AI bots: verified crawl share by bot category and section over six months | Caption: [DATA: Dan to supply] Verified bot crawl share by category and section. Image created by author, October 2026
Bing deserves its own line in that report. If you want to see how Bing’s own tools fit in, read my post on Bing Webmaster Tools as an AI visibility data source.
What Does It Cost, and Who Owns What?
BigQuery for SEO is cheap until somebody runs SELECT * across three years of URL-level data every morning.
By default, BigQuery bills queries on demand by bytes processed. Google’s pricing page states:
“The first 1 TiB of query data processed per month is free.”
Source: Google Cloud, BigQuery pricing
Above that, the on-demand rate listed on the day I checked was $6.25 per TiB, and storage has its own free tier of 10 GiB a month. Rates vary by location and change, so check the page before you put a number in a budget.
The bulk export is subject to those same storage and query costs. Google’s setup guide notes there is a free usage level, but the data is kept indefinitely unless you set partition expirations.
The cost drivers are predictable:
- Bytes scanned per query. Select only the columns you need. The URL table has a row for every URL, query, country, device and search type combination, so it grows fast.
- Partition filters. Google’s partitioning docs explain that a filter on the partition column lets BigQuery scan the matching partitions and skip the rest. You can also enable a Require partition filter option so nobody can forget.
- Scheduled query frequency. Build the modelled tables once a day, and point dashboards at those, not at the raw export.
- Clustering. Google’s documentation covers combining clustering with partitioning when queries filter on several columns, such as URL and search type.
- Storage. Logs are the heavy table. Decide retention up front.
Tip: Set a maximum bytes billed limit on the project. Google’s pricing page lists it as a custom cost control, and it turns a runaway query into an error instead of an invoice.
Governance matters more than cost, though. Here’s the minimum I’d want in place before any metric from this model reaches a board:
- Dataset ownership: one named owner per dataset, as in the schema map above.
- Access control: raw logs and CRM tables restricted; modelled tables shared.
- PII: no raw human IPs, no raw emails, hashed identifiers only.
- Retention: agreed per table with the data protection lead.
- Data contract: a one-page definition for each board metric covering source tables, filters, known caveats and the acceptance test it passed.
- Sign-off: the analyst who built it and the SEO lead who owns the question both sign before a new metric appears in an exec pack.
[IMAGE NEEDED] One-page data contract mock-up for a single metric ("Share of verified Googlebot crawl on zero-impression URLs"): definition, source tables, filters, refresh cadence, owner, caveats, acceptance test, sign-off boxes. | Alt: Example one-page data contract for an SEO board metric | Caption: A data contract for one board metric. Image created by author, October 2026
Who Actually Writes the SQL?
I’ll be straight with you, because anyone hiring a search leader should ask this question.
In my teams, analysts and data engineers write and maintain the production SQL. [CONFIRM: hands-on SQL. If Dan writes and runs these queries himself, rewrite this section in the first person.]
My job is the part that decides whether the SQL is worth running:
- The questions. I define the business question and the decision each query should change.
- The model. I design which sources feed it, the grain of each table, and the URL normalisation rules.
- The acceptance tests. I set the checks an output must pass, for example “verified Googlebot hits reconcile to the raw log within an agreed tolerance” or “Search Console clicks in the model match the export for the same filters”.
- The review. I read the outputs, challenge anything that looks too good, and decide what goes to leadership.
Here’s why that split matters. A brilliant query that answers the wrong question costs the same as a good one, and it does more damage, because people believe it.
That is also why I argue the analyst should be one of the earliest SEO hires, not the last. I make that case in my post on SEO team structure in a matrixed organisation.
Do you need Python for SEO data work like this? Not for this. SQL in BigQuery covers the joins and aggregation; Python earns its place for scraping, APIs and modelling.
FAQs
What is log file analysis in SEO?
Log file analysis in SEO means reading server or CDN request logs to see which URLs search engine and AI bots actually request, how often, and which status codes they receive. It is the ground truth for crawling, which crawl tools and Search Console only approximate, and it should only count bots whose IPs are verified.
How do you send Search Console data to BigQuery?
Create a Google Cloud project with billing, enable the BigQuery and BigQuery Storage APIs, and grant the Search Console export service account the BigQuery Job User and Data Editor roles. Then open Settings, Bulk data export in Search Console and enter the project ID. The first export arrives within 48 hours and history is not backfilled.
How do you verify Googlebot in logs?
Run a reverse DNS lookup on the requesting IP, confirm the host ends in googlebot.com, google.com or googleusercontent.com, then run a forward lookup and check it returns the same IP. At scale, match IPs against Google’s published IP range files instead. Never trust the user agent string alone, because it is easily spoofed.
How do you measure AI bot crawling?
Classify user agents into search engines, AI search crawlers, AI training crawlers and user-triggered fetchers. Verify each against the operator’s published IP ranges, drop anything that fails, then report each category’s share of verified bot hits by site section every month, alongside any robots.txt or CDN policy changes made that month.
Why use SQL for SEO instead of tools?
Most SEO tools answer one data source at a time. SQL lets you join crawl, log, Search Console and conversion data at URL level, so you can ask commercial questions such as which crawled pages earn nothing, or which pages get impressions but no conversions. Tools still matter for collection; the joins are where decisions come from.
What does it cost to run SEO data in BigQuery?
Costs depend on bytes scanned per query, partitioning and clustering, how often scheduled queries run, and storage, especially for logs. Google’s on-demand pricing includes the first 1 TiB of query data processed each month free. Partition filters, column selection and a maximum bytes billed limit keep most SEO workloads modest.
Do you need Python for SEO data work?
Not for joining and aggregating crawl, log, Search Console and GA4 data, which SQL in BigQuery handles well. Python helps with scraping, calling APIs, automating crawls and statistical modelling. A search leader should be able to read both and know which job each one is for, even if analysts write the production code.
Final Thoughts
SQL for SEO is not about writing clever queries. It’s about deciding which questions deserve one.
- No single SEO data source is decision grade. Join at least two before you put a number in front of leadership.
- Turn on the Search Console bulk data export today. It does not backfill.
- Agree URL normalisation before anyone writes a query.
- Count only verified bots, and split AI bots into search, training and user-triggered fetchers.
- Partition, filter, cap bytes billed, and put a data contract behind every board metric.
Trust me, the first time a joined table shows your board where crawl, visibility and revenue disagree, the conversation about SEO changes for good.
Share this with your Head of Data, and ask them which of the five questions they could answer by Friday.
More Resources
- SEO measurement and executive reporting
- Technical foundations for AI search
- SEO team structure in a matrixed organisation
- The technical SEO audit checklist
- How to track AI traffic
- About Dan Smullen
References
- Google, “Table guidelines and reference” (Search Console bulk data export), Search Console Help. https://support.google.com/webmasters/answer/12917991
- Google, “Start a new bulk data export”, Search Console Help. https://support.google.com/webmasters/answer/12917675
- Google Search Central, “Bulk data export: a new and powerful way to access your Search Console data”, Google Search Central Blog, February 2023. https://developers.google.com/search/blog/2023/02/bulk-data-export
- Search Engine Land, “Google Search Console adds daily bulk data exports to BigQuery”, February 2023. https://searchengineland.com/google-search-console-adds-daily-bulk-data-exports-to-bigquery-393380
- Trevor Fox, “Google Search Console to BigQuery: The Complete Guide to GSC Bulk Export”, trevorfox.com, 28 March 2023. https://trevorfox.com/2023/03/google-search-console-bulk-export-for-bigquery/
- Google, “[GA4] BigQuery Export schema”, Analytics Help. https://support.google.com/analytics/answer/7029846
- Google, “Basic queries for Google Analytics event data export”, Google Analytics developer documentation. https://developers.google.com/analytics/bigquery/basic-queries
- Google Search Central, “Large site owner’s guide to managing your crawl budget”. https://developers.google.com/search/docs/crawling-indexing/large-site-managing-crawl-budget
- Google, “Verify requests from Google crawlers and fetchers”, Google Crawling Infrastructure. https://developers.google.com/crawling/docs/crawlers-fetchers/verify-google-requests
- Google, “List of Google’s common crawlers”, Google Crawling Infrastructure. https://developers.google.com/crawling/docs/crawlers-fetchers/google-common-crawlers
- Vincent Wehren, Bing Webmaster Tools, “How to Verify that Bingbot is Bingbot”, Bing Webmaster Blog, 31 August 2012. https://blogs.bing.com/webmaster/2012/08/31/how-to-verify-that-bingbot-is-bingbot
- OpenAI, “Overview of OpenAI Crawlers”, OpenAI developer documentation. https://developers.openai.com/docs/bots
- Perplexity, “Perplexity Crawlers”, Perplexity documentation. https://docs.perplexity.ai/guides/bots
- Anthropic, “Does Anthropic crawl data from the web, and how can site owners block the crawler?”, Claude Help Center. https://support.claude.com/en/articles/8896518
- Screaming Frog, “SEO Log File Analyser”. https://screamingfrog.co.uk/log-file-analyser/
- Mark Porter, Screaming Frog, “How To Monitor AI Bots In The Log File Analyser”, updated May 2026. https://www.screamingfrog.co.uk/log-file-analyser/tutorials/monitor-ai-bots-in-the-log-file-analyser/
- Cloudflare, “Your site, your rules: new AI traffic options for all customers”, Cloudflare Blog, 1 July 2026. https://blog.cloudflare.com/content-independence-day-ai-options/
- Google Cloud, “BigQuery pricing”. https://cloud.google.com/bigquery/pricing
- Google Cloud, “Introduction to partitioned tables”, BigQuery documentation. https://docs.cloud.google.com/bigquery/docs/partitioned-tables
- Google Cloud, “Query partitioned tables”, BigQuery documentation. https://docs.cloud.google.com/bigquery/docs/querying-partitioned-tables