Sub topic 8
Tying Organic Landing Pages to Revenue with BigQuery
Assume you already understand GA4 events, organic sessions, ecommerce purchase revenue, and basic SQL. You also need access to the GA4 BigQuery export. This chapter uses session-level attribution: revenue is credited to the organic landing page that began the same session.
Why connect clicks to revenue?
A lower organic click-through rate (CTR) does not automatically mean lower business value. AI Overviews may reduce clicks for informational searches while leaving product-page visits and revenue unchanged. They may also send fewer visitors who are more likely to buy.
Track these outcomes together:
| Metric | What it tells you |
|---|---|
| Organic sessions | How much traffic reached the site |
| Engaged sessions | Whether visitors interacted meaningfully |
| Purchases | How many orders resulted |
| Revenue | The monetary value of those orders |
| Revenue per session | Revenue efficiency of the traffic |
Search Console can show clicks and impressions. It does not normally connect those clicks to purchases. GA4 records sessions and purchases, while BigQuery lets you query the event-level export and group results by landing page.
Build a session-level revenue query
GA4 exports events into daily tables. Each event includes a user identifier and often a session identifier in event_params. The query below:
- Finds sessions during the study period.
- Finds the first page viewed in each session.
- Keeps organic sessions.
- Aggregates purchases by session.
- Groups sessions and revenue by landing page.
WITH session_starts AS (
SELECT
user_pseudo_id,
(SELECT value.int_value
FROM UNNEST(event_params)
WHERE key = 'ga_session_id') AS session_id,
(SELECT value.string_value
FROM UNNEST(event_params)
WHERE key = 'medium') AS medium
FROM `project.analytics_123456.events_*`
WHERE event_name = 'session_start'
AND _TABLE_SUFFIX BETWEEN '20260101' AND '20260331'
),
first_pages AS (
SELECT
user_pseudo_id,
(SELECT value.int_value
FROM UNNEST(event_params)
WHERE key = 'ga_session_id') AS session_id,
(SELECT value.string_value
FROM UNNEST(event_params)
WHERE key = 'page_location') AS landing_page
FROM `project.analytics_123456.events_*`
WHERE event_name = 'page_view'
AND _TABLE_SUFFIX BETWEEN '20260101' AND '20260331'
QUALIFY ROW_NUMBER() OVER (
PARTITION BY user_pseudo_id,
(SELECT value.int_value
FROM UNNEST(event_params)
WHERE key = 'ga_session_id')
ORDER BY event_timestamp
) = 1
),
purchases AS (
SELECT
user_pseudo_id,
(SELECT value.int_value
FROM UNNEST(event_params)
WHERE key = 'ga_session_id') AS session_id,
SUM(COALESCE(ecommerce.purchase_revenue, 0)) AS revenue
FROM `project.analytics_123456.events_*`
WHERE event_name = 'purchase'
AND _TABLE_SUFFIX BETWEEN '20260101' AND '20260331'
GROUP BY user_pseudo_id, session_id
)
SELECT
p.landing_page,
COUNT(DISTINCT CONCAT(
s.user_pseudo_id, '.', CAST(s.session_id AS STRING)
)) AS sessions,
COUNTIF(COALESCE(r.revenue, 0) > 0) AS purchasing_sessions,
COALESCE(SUM(r.revenue), 0) AS revenue,
SAFE_DIVIDE(
COALESCE(SUM(r.revenue), 0),
COUNT(DISTINCT CONCAT(
s.user_pseudo_id, '.', CAST(s.session_id AS STRING)
))
) AS revenue_per_session
FROM session_starts AS s
JOIN first_pages AS p
ON s.user_pseudo_id = p.user_pseudo_id
AND s.session_id = p.session_id
LEFT JOIN purchases AS r
ON s.user_pseudo_id = r.user_pseudo_id
AND s.session_id = r.session_id
WHERE s.medium = 'organic'
GROUP BY p.landing_page
ORDER BY revenue DESC;Replace the project and dataset names with your export location. Confirm how your implementation stores medium and landing-page values. Some GA4 setups store traffic-source data in dedicated session fields rather than in event parameters.
Connect the result to AI Overview exposure
Create a page-level table containing:
- The landing page
- Its AI Overview exposure status or exposure rate
- The measurement period
- Organic sessions
- Purchases
- Revenue
- Revenue per session
Then compare exposed and comparison pages. A page belongs in the comparison group only if it was eligible for similar search demand but had little or no measured AI Overview exposure.
Attribution choices and failure modes
Session-level attribution is simple and reproducible, but it answers a narrow question: “What happened after this organic landing session?” A first-touch model credits the first known marketing interaction. A data-driven model distributes credit across interactions. Choose one model before comparing periods.
Check for these problems:
- Duplicate purchase rows caused by joining purchases before aggregating them.
- Missing
ga_session_idvalues. - Internal traffic or test orders included in revenue.
- Currency values mixed across stores.
- Landing-page URLs split by tracking parameters.
- Consent or tagging changes that alter session counts.
- Revenue from refunds or cancellations not reflected in purchase events.
Measurement flow
Exercise
A landing page has 10,000 organic sessions and $25,000 in session-attributed revenue. What is its revenue per session, and what does that metric not prove?
Show answer
Revenue per session is $2.50. It does not prove that every session caused the purchase or that AI Overviews caused a change in revenue.