BigQuery is the data warehouse inside Google Cloud: you load data into tables, ask questions of it in SQL, and Google runs the servers. It stores tables column by column, which makes it fast at the questions analysts ask, such as "total clicks per page per month" across millions of rows. You pay for the data you store and for the data each query reads, with a free amount every month.
For SEO work, BigQuery matters because Google Search Console and Google Analytics 4 can both send their raw data there. That gives you every row, kept for as long as you like, and lets you join it with your own data.
When an SEO needs BigQuery
Most small and medium sites don't. Google says these sites already see all their Search Console data in the reports, the Looker Studio connector or the API Google Search Central.
BigQuery earns its setup when:
- your site has tens of thousands of pages or queries, and the reports cut off rows you need
- you want to keep your search data beyond the reporting windows of the tools
- you want to combine search data with sales, CRM or ad cost data in one query
- you build dashboards in Looker Studio that must read large tables quickly
Export Search Console data to BigQuery
Search Console's bulk data export sends a daily copy of your performance data to BigQuery. It isn't limited by the daily row limit of the reports and API. It leaves out anonymized queries, the rare searches Google hides for privacy.
Before you start, you need to be an owner of the Google Search Console property and have a Google Cloud project with billing turned on. Then:
- In Google Cloud, enable the BigQuery API and give Search Console's service account the BigQuery Job User and BigQuery Data Editor roles.
- In Search Console, open Settings > Bulk data export, enter your Cloud project ID and choose a dataset location. You can't easily change the location later.
- Wait. The first export arrives up to 48 hours after setup.
The export starts on the day it first runs. Earlier data is not copied over, so set it up early if you think you'll want the history.
You get three tables in a dataset called searchconsole (or a name that starts with it):
| Table | What it holds |
|---|---|
searchdata_site_impression |
Clicks and impressions for the whole property, by query, country, device and search type |
searchdata_url_impression |
The same, by landing page URL, with extra detail on search appearance |
ExportLog |
One row for each successful export |
Data piles up forever unless you set a partition expiration. Google suggests at least 14 days if you do.
Export GA4 data to BigQuery
Google Analytics 4 can send raw events to BigQuery from Admin > Product Links > BigQuery Links. You need Editor access to the property and Owner access to the Cloud project. Data starts to flow within 24 hours.
You choose how the data arrives:
| Export | Who can use it | When data arrives |
|---|---|---|
| Daily | All properties | Once a day, for the day before |
| Fresh Daily | Analytics 360 only | Usually by 5 a.m., updated through the day |
| Streaming | All properties | Within minutes; best effort, with possible gaps |
Watch the limit: a standard property's daily export allows 1 million events a day. If a property keeps going over, Google pauses the daily export and doesn't reprocess the missed days. Excluding data streams or events keeps you under. Streaming has no volume limit, but it costs $0.05 per GB, about 600,000 events Analytics Help.
What BigQuery costs
Each month, the first 10 GiB of storage and the first 1 TiB of query data are free. After that, on-demand queries cost $6.25 per TiB read at Google's list price Google Cloud.
What you pay for is the data a query reads, not the rows it returns. Three habits keep the bill small:
- Name the columns you need. BigQuery charges for each column a query reads, so
SELECT *costs the most. - Filter on the date. The Search Console tables are split into daily partitions, and a date filter skips the rest.
- Don't count on
LIMITto save money. On most tables it doesn't reduce the data read.
Before you run a big query, the console shows how much data it will read. You can also set a "maximum bytes billed" so an expensive query fails instead of running.
The free sandbox
The BigQuery sandbox lets you try BigQuery without a credit card or billing account. You get the same 1 TiB of free queries a month, but storage is capped at 10 GiB for the life of the project, tables expire after 60 days and it can't take streaming data. That makes it fine for learning and for public datasets, and a poor home for an export you want to keep.
A first query on Search Console data
This query lists your top queries by clicks over the last 28 days. Replace your-project with your project ID.
SELECT
query,
SUM(clicks) AS clicks,
SUM(impressions) AS impressions,
SUM(sum_top_position) / SUM(impressions) + 1 AS avg_position
FROM `your-project.searchconsole.searchdata_site_impression`
WHERE data_date >= DATE_SUB(CURRENT_DATE(), INTERVAL 28 DAY)
AND query != ''
GROUP BY query
ORDER BY clicks DESC
LIMIT 50
The sum_top_position column counts from zero, which is why the query adds 1 to get the average position you see in Search Console.