Request a demo

Public dataset · Web, code and analytics

Google Analytics 360 Sample in BigQuery

The google_analytics_sample dataset is an obfuscated Google Analytics 360 (Universal Analytics) export from the Google Merchandise Store, one table per day from August 2016 to August 2017. It is 5.4 GiB in total, with one row per session and hits nested inside, so session-level queries read only a few MiB.

bigquery-public-data.google_analytics_sample · Google (Google Merchandise Store) · US · Sizes measured November 23, 2026

369tables
5.4 GiBin the tables below
904,386rows
$0.03to scan every column once, on-demand

bigquery-public-data.google_analytics_sample holds obfuscated Google Analytics 360 data from the Google Merchandise Store, published by Google so people can practice analyzing GA360 data in BigQuery. The dataset description gives 2019-09-19 as its last update. It uses the older Universal Analytics export schema, not the GA4 one: if you work with GA4, use the GA4 sample instead.

There is one table per day, ga_sessions_YYYYMMDD, from 2016-08-01 to 2017-08-01. Each row is a session. Session totals are in the totals record, acquisition in trafficSource, device and geography in device and geoNetwork, and every pageview, event and transaction in the repeated hits record, which itself contains a repeated product record. Revenue fields are stored multiplied by 1,000,000, so divide by 1e6.

Three extra tables were added in 2025 and have no description: daily_total_visits, daily_visits and an empty Google-ecommerce-dataset-table.

Tables and sizes

The dataset has 369 tables; the main ones are listed.

TableRowsSizeFull scanLayout
ga_sessions_YYYYMMDD
366 daily tables, ga_sessions_20160801 to ga_sessions_20170801. Rows and size are the total of all 366.
903,6535.4 GiB$0.03None
daily_visits
No description in the metadata.
3675.7 KiBunder $0.01None
daily_total_visits
No description in the metadata.
3665.7 KiBunder $0.01None
Google-ecommerce-dataset-table
Empty.
00 Bunder $0.01None

Full scan = every column of the table at the on-demand list price of $6.25 per TiB, before your free TiB each month. Selecting fewer columns costs proportionally less. See BigQuery pricing.

Example queries

Sessions, pageviews and revenue per day in July 2017

Scans 1.8 MiB · under $0.01 on-demand

Session-level totals live in the small totals record, so a month costs under 2 MiB.

SELECT
  PARSE_DATE('%Y%m%d', date) AS day,
  SUM(totals.visits) AS sessions,
  SUM(totals.pageviews) AS pageviews,
  SUM(totals.transactions) AS transactions,
  SUM(totals.totalTransactionRevenue) / 1e6 AS revenue
FROM `bigquery-public-data.google_analytics_sample.ga_sessions_*`
WHERE _TABLE_SUFFIX BETWEEN '20170701' AND '20170731'
GROUP BY day
ORDER BY day;

Sessions and transactions by source and medium, whole year

Scans 23.7 MiB · under $0.01 on-demand

All 366 tables, but only four small columns.

SELECT
  trafficSource.source,
  trafficSource.medium,
  SUM(totals.visits) AS sessions,
  SUM(totals.transactions) AS transactions
FROM `bigquery-public-data.google_analytics_sample.ga_sessions_*`
GROUP BY 1, 2
ORDER BY sessions DESC
LIMIT 20;

Top products by revenue, whole year (expensive)

Scans 603 MiB · under $0.01 on-demand

Unnesting hits and hits.product reads the nested hit data, which is most of the dataset's bytes.

SELECT
  p.v2ProductName AS product,
  SUM(p.productQuantity) AS units,
  SUM(p.productRevenue) / 1e6 AS revenue
FROM `bigquery-public-data.google_analytics_sample.ga_sessions_*`,
  UNNEST(hits) AS h,
  UNNEST(h.product) AS p
WHERE p.productRevenue IS NOT NULL
GROUP BY product
ORDER BY revenue DESC
LIMIT 20;

Top products by revenue for one month

Scans 38.6 MiB · under $0.01 on-demand

The same query with a _TABLE_SUFFIX range reads 31 tables instead of 366, about 16 times fewer bytes.

SELECT
  p.v2ProductName AS product,
  SUM(p.productQuantity) AS units,
  SUM(p.productRevenue) / 1e6 AS revenue
FROM `bigquery-public-data.google_analytics_sample.ga_sessions_*`,
  UNNEST(hits) AS h,
  UNNEST(h.product) AS p
WHERE _TABLE_SUFFIX BETWEEN '20170701' AND '20170731'
  AND p.productRevenue IS NOT NULL
GROUP BY product
ORDER BY revenue DESC
LIMIT 20;

Querying it cheaply

  • Answer session-level questions from totals, trafficSource, device and geoNetwork. They are tiny compared with hits.
  • Add a _TABLE_SUFFIX range to every ga_sessions_* query that does not need the full year.
  • Unnesting hits (and hits.product) reads the nested hit columns, the bulk of the 5.4 GiB. Select the specific hit fields you need rather than h.*.
  • The data no longer changes, so repeated identical queries are served from the cache for free.

FAQ

How much does it cost to query the Google Analytics sample dataset?

Very little. The whole dataset is 5.4 GiB, so even a query over every column of every day is about half a percent of the free 1 TiB a month. Session-level queries read a few MiB.

Is the google_analytics_sample dataset free?

Yes for storage: the data sits in the bigquery-public-data project and Google pays to store it. You pay for the queries you run from your own project. On-demand, the first 1 TiB scanned each month is free, then you pay per TiB scanned (see BigQuery pricing).

Is google_analytics_sample GA4 data?

No. It is Google Analytics 360 data in the Universal Analytics export schema (ga_sessions_*, one row per session). GA4 exports one row per event in events_* tables; for that schema use ga4_obfuscated_sample_ecommerce.

Why is revenue so large in the GA360 sample?

Revenue fields such as totals.totalTransactionRevenue and hits.product.productRevenue are stored multiplied by 1,000,000. Divide by 1e6 to get currency units.

All public datasets · BigQuery cost queries · Pricing calculator

Cut BigQuery spend without guessing

Masthead attributes compute and storage cost to every project, user, pipeline and table, finds unused and dead-end tables, and shows where editions or on-demand pricing is cheaper. Mnemonic cut its BigQuery compute cost by 20% within 24 hours of onboarding.