Skip to main content

Your first GSC BigQuery query: seven days

Glot Rank Team · Published

Make the first query answer a small question: are seven days of a chosen country and search type present, and how do they aggregate by day? You do not need to begin by joining queries, analytics sessions and customer records into one large table.

Daniel Waisberg and Gaal Yahas’s practical article emphasizes date partitions and query efficiency. Our original exercise follows that scope-first approach. The SQL has not run in your cloud project, and this is not a promise of free processing.

Identify the table you actually have

Ask the data owner to confirm the project, dataset, property, export coverage and access. Bulk export requires separate configuration. Search Console access alone does not mean BigQuery data already exists. If no export is available, review the prerequisites before inventing a table name.

Google’s table reference distinguishes property-aggregated searchdata_site_impression from URL-aggregated data. This exercise uses only the former; do not add the two tables together.

Choose complete dates and raw counts

Inspect the schema, data dates and export records. ExportLog records successful exports; absence of error rows does not establish absence of failures. Check all seven required dates and preserve missing days rather than turning them into zero traffic.

An absent day after the country and search-type filters is not by itself an export gap. Check ExportLog for the matching table namespace and data_date; distinguish a successful export with no rows in this filtered scope from a day without an export record.

The project, dataset, dates and country below are teaching placeholders. Replace them with verified scope. Inspect estimated bytes and use a dry run, then apply execution limits appropriate to the project’s billing model and permissions before deciding to run it.

SELECT
  data_date,
  SUM(clicks) AS clicks,
  SUM(impressions) AS impressions,
  SAFE_DIVIDE(SUM(clicks), SUM(impressions)) AS ctr
FROM `your_project.searchconsole.searchdata_site_impression`
WHERE data_date BETWEEN DATE '2026-10-19' AND DATE '2026-10-25'
  AND search_type = 'web'
  AND country = 'deu'
GROUP BY data_date
ORDER BY data_date;

Dates use Pacific Time. The example country is Germany, deu, not the language code de. Devices are aggregated together. The returned CTR is a ratio: 0.002 displays as 0.2%.

Aggregate rather than casually deduplicating

The export can contain incremental records with repeated dimension keys. Aggregate metrics instead of deleting rows merely because their dimensions match.

This fictional same-day fragment illustrates the calculation:

RecordClicksImpressions
Fragment A2100
Fragment B3400
Aggregate5500

Combined CTR is 5/500, or 1%. It is not the simple average of 2% and 0.75%. The query calculates the ratio from summed counts rather than averaging daily or row-level rates.

Preserve anonymization states. Missing query text cannot be reconstructed into a named query. This query does not filter text; if you later add a brand or regex filter, document the anonymized portion that it excludes.

Align scope before comparing Search Console

Save a Search Console view for the same property, Pacific dates, Web type and country. Confirm data finality. When totals differ, investigate missing days, aggregation, filters and update state before declaring either system wrong. Do not allocate the difference to named queries.

Project, dataset, property and table:
Actual dates, country, device scope and search type:
Export coverage, missing days and update state:
Estimated bytes, execution limits and actual run record:
Daily counts, total CTR and comparison difference:
Unresolved conditions, owner and next check:

Once the summary is trustworthy, continue to query-loss analysis. Seven days is this exercise’s window, not a universal sample size for growth conclusions.

Next check position weighting and missing export days before interpreting a trend.