GA4 Advertising Metrics to BigQuery Mapping
Here’s a breakdown of GA4 Advertising Metrics and their corresponding BigQuery fields:
GA4 Advertising Metrics What it is BigQuery Field Name (Formula) Google Ads clicks The total number of times users have clicked on your ads via Google Ads. SUM(google_ads_clicks)
Google Ads cost The cumulative amount spent on your Google Ads campaigns. SUM(google_ads_cost)
Google Ads cost per click The average cost incurred for each click received through your Google Ads campaigns. SUM(google_ads_cost) / SUM(google_ads_clicks) AS google_ads_cost_per_click
Google Ads impressions The total number of views or exposures your Google Ads campaigns have received. SUM(google_ads_impressions)
Google Ads video cost The total expenditure on video advertising within Google Ads. SUM(google_ads_video_cost)
Google Ads video views The total count of views your video ads have garnered on the Google Ads platform. SUM(google_ads_video_views)
Non-Google clicks The total number of clicks on your advertising campaigns not running on Google Ads. SUM(non_google_clicks)
Non-Google cost The overall cost associated with your non-Google advertising campaigns. SUM(non_google_cost)
Non-Google cost per click The average cost for each click on your non-Google advertising campaigns. SUM(non_google_cost) / SUM(non_google_clicks) AS non_google_cost_per_click
Non-Google cost per key event The average cost incurred for each key event triggered through your non-Google advertising campaigns. SUM(non_google_cost) / COUNT(non_google_key_events) AS non_google_cost_per_key_event
Non-Google impressions The total number of times your non-Google ads were displayed to users. SUM(non_google_impressions)
Return on non-Google ad spend The revenue generated for every dollar spent on non-Google ads, considering all revenue streams against ad costs SUM(non_google_revenue) / SUM(non_google_cost) AS return_on_non_google_ad_spend
Points to consider
BigQuery Field Names (Formulas) provided above are conceptual and assume that you have fields in your BigQuery dataset that directly correspond to these metrics.
If these fields are not directly available, you may need to create them using custom calculations or ensure that your data collection setup in GA4 is configured to capture this data.
For example, the specific BigQuery field names provided, such as SUM(google_ads_clicks)
, SUM(google_ads_cost)
, etc., were illustrative and not directly pulled from the GA4 BigQuery export schema.
GA4’s BigQuery export does not directly provide fields named ‘google_ads_clicks
‘, ‘google_ads_cost
‘, ‘non_google_clicks
‘, ‘non_google_cost
‘, etc.
Instead, advertising metrics and costs are typically derived from the event data that GA4 exports to BigQuery, which requires parsing and aggregating specific event parameters related to advertising.
Let’s construct example SQL queries to calculate various Google Ads and non-Google advertising metrics.
These examples assume that you have linked your Google Ads account with GA4 and are utilizing BigQuery to analyze the exported data.
The metrics will be derived from custom fields or calculations based on the event data available in your GA4 BigQuery export.
Google Ads Clicks
SELECT
SUM(metrics_clicks) AS google_ads_clicks
FROM
`your_project.your_dataset.google_ads_table`
Google Ads Cost
SELECT
SUM(metrics_cost_micros) / 1000000 AS google_ads_cost
FROM
`your_project.your_dataset.google_ads_table`
Google Ads Impressions
SELECT
SUM(metrics_impressions) AS google_ads_impressions
FROM
`your_project.your_dataset.google_ads_table`
Google Ads Video Cost
Assuming video cost is part of the cost metrics and needs to be filtered by video ad interactions:
SELECT
SUM(metrics_cost_micros) / 1000000 AS google_ads_video_cost
FROM
`your_project.your_dataset.google_ads_table`
WHERE
segments_ad_network_type = 'VIDEO'
Google Ads Video Views
Assuming video views are tracked as a specific interaction type:
SELECT
SUM(metrics_interactions) AS google_ads_video_views
FROM
`your_project.your_dataset.google_ads_table`
WHERE
metrics_interaction_event_types = 'VIDEO_VIEW'
Non-Google Advertising Metrics
For non-Google advertising metrics, let’s assume you are tracking these through custom events or parameters in GA4 that are then exported to BigQuery.
The specific field names and calculations might vary based on how you’ve set up tracking for these metrics.
Non-Google Clicks
SELECT
COUNT(*) AS non_google_clicks
FROM
`your_project.your_dataset.events_*`
WHERE
event_name = 'non_google_ad_click'
Non-Google Key Events
Assuming a key event is defined and tracked explicitly:
SELECT
COUNT(*) AS non_google_key_events
FROM
`your_project.your_dataset.events_*`
WHERE
event_name = 'non_google_key_event'
Non-Google Impressions
SELECT
COUNT(*) AS non_google_impressions
FROM
`your_project.your_dataset.events_*`
WHERE
event_name = 'non_google_ad_impression'
Non-Google Revenue
Assuming revenue from non-Google ads is tracked as part of event parameters:
SELECT
SUM(event_params.value.double_value) AS non_google_revenue
FROM
`your_project.your_dataset.events_*`,
UNNEST(event_params) AS event_params
WHERE
event_name = 'purchase' AND
event_params.key = 'non_google_ad_revenue'
Non-Google Cost
Assuming the cost for non-Google ads is tracked similarly:
SELECT
SUM(event_params.value.double_value) AS non_google_cost
FROM
`your_project.your_dataset.events_*`,
UNNEST(event_params) AS event_params
WHERE
event_params.key = 'non_google_ad_cost'
Note: The specific calculations and field names might need adjustments based on your data schema and how you have configured tracking for Google Ads and non-Google advertising metrics.
Other articles on GA4 BigQuery
#1 BigQuery Introduction
- How to create a new Google Cloud Platform account.
- How to create a new BigQuery project.
- What is Google BigQuery Sandbox and how to use it.
- Understanding the BigQuery User Interface.
- What is BigQuery Data Transfer Service & how it works.
- How to create data transfer in BigQuery.
- Connect and transfer data from Google Sheets to BigQuery.
- How to access BigQuery Public Data Sets.
- Best Supermetrics Alternative – Dataddo.
#2 GA4 BigQuery Introduction
- Google Analytics 4 BigQuery Tutorial for Beginners to Advanced.
- GA4 Bigquery Export Schema Tutorial.
- GA4 BigQuery – Connect Google Analytics 4 with BigQuery.
- events_ & events_intraday_ tables in BigQuery for GA4 (Google Analytics 4).
- pseudonymous_users_ & users_ data tables in BigQuery for GA4 (Google Analytics 4).
- How to access GA4 Sample Data in BigQuery.
- Advantages of using Google BigQuery for Google Analytics 4.
- Impact of Google Advanced Consent Mode on BigQuery & GDPR.
#3 GA4 BigQuery Data Transfer
- How to Connect and Export Data from GA4 to BigQuery
- How to backfill GA4 data in BigQuery.
- How to overcome GA4 BigQuery Export limit.
- How to Send Custom GA4 Data to BigQuery.
- How to backup Universal Analytics data to BigQuery.
- How to send data from Google Ads to BigQuery.
- How to send data from Google Search Console to BigQuery.
- Sending data from Google Analytics to BigQuery without 360.
- How to send data from Facebook ads to BigQuery.
- How to pull custom data from Google Analytics to BigQuery.
#4 BigQuery Cost Optimization
- Guide to BigQuery Cost Optimization.
- Using Google Cloud pricing calculator for BigQuery.
- Cost of using BigQuery for Google Analytics 4.
#5 Query GA4 BigQuery Data
- How to query Google Analytics data in BigQuery.
- Query GA4 data in BigQuery without understanding SQL.
- Using GA4 BigQuery SQL generator to create SQL queries.
- New vs Returning users in GA4 BigQuery data table.
- GA4 BigQuery Composer Tutorial for ChatGPT.
- How to track GA4 BigQuery Schema Change.
- Calculating Sessions and Engaged Sessions in GA4 BigQuery.
- Calculating Total Users in GA4 BigQuery.
#6 GA4 to BigQuery Dimension/Metric Mapping.
- GA4 to BigQuery Mapping Tutorial.
- GA4 Attribution Dimensions to BigQuery Mapping.
- GA4 Google Ads Dimensions to BigQuery Mapping.
- GA4 Demographic Dimensions to BigQuery Mapping.
- GA4 Ecommerce Dimensions to BigQuery Mapping.
- GA4 Event-Scoped Ecommerce Metrics to BigQuery Mapping.
- GA4 Item-Scoped Ecommerce Metrics to BigQuery Mapping.
- GA4 Revenue Metrics to BigQuery Mapping.
- GA4 Event Dimensions to BigQuery Mapping.
- GA4 Event Metrics to BigQuery Mapping.
- GA4 Geography Dimensions to BigQuery Mapping.
- GA4 Link Dimensions to BigQuery Mapping.
- GA4 Page/Screen Dimensions to BigQuery Mapping.
- GA4 Page/Screen Metrics to BigQuery Mapping.
- GA4 Platform/Device Dimensions to BigQuery Mapping.
- GA4 User-Scoped Traffic Dimensions to BigQuery Mapping.
- GA4 Session-Scoped Traffic Dimensions to BigQuery Mapping.
- GA4 Session Metrics to BigQuery Mapping.
- GA4 User Dimensions to BigQuery Mapping.
- GA4 User Metrics to BigQuery Mapping.
- GA4 Advertising Metrics to BigQuery Mapping.
-
Here’s a breakdown of GA4 Advertising Metrics and their corresponding BigQuery fields:
GA4 Advertising Metrics | What it is | BigQuery Field Name (Formula) |
---|---|---|
Google Ads clicks | The total number of times users have clicked on your ads via Google Ads. | SUM(google_ads_clicks) |
Google Ads cost | The cumulative amount spent on your Google Ads campaigns. | SUM(google_ads_cost) |
Google Ads cost per click | The average cost incurred for each click received through your Google Ads campaigns. | SUM(google_ads_cost) / SUM(google_ads_clicks) AS google_ads_cost_per_click |
Google Ads impressions | The total number of views or exposures your Google Ads campaigns have received. | SUM(google_ads_impressions) |
Google Ads video cost | The total expenditure on video advertising within Google Ads. | SUM(google_ads_video_cost) |
Google Ads video views | The total count of views your video ads have garnered on the Google Ads platform. | SUM(google_ads_video_views) |
Non-Google clicks | The total number of clicks on your advertising campaigns not running on Google Ads. | SUM(non_google_clicks) |
Non-Google cost | The overall cost associated with your non-Google advertising campaigns. | SUM(non_google_cost) |
Non-Google cost per click | The average cost for each click on your non-Google advertising campaigns. | SUM(non_google_cost) / SUM(non_google_clicks) AS non_google_cost_per_click |
Non-Google cost per key event | The average cost incurred for each key event triggered through your non-Google advertising campaigns. | SUM(non_google_cost) / COUNT(non_google_key_events) AS non_google_cost_per_key_event |
Non-Google impressions | The total number of times your non-Google ads were displayed to users. | SUM(non_google_impressions) |
Return on non-Google ad spend | The revenue generated for every dollar spent on non-Google ads, considering all revenue streams against ad costs | SUM(non_google_revenue) / SUM(non_google_cost) AS return_on_non_google_ad_spend |
Points to consider
BigQuery Field Names (Formulas) provided above are conceptual and assume that you have fields in your BigQuery dataset that directly correspond to these metrics.
If these fields are not directly available, you may need to create them using custom calculations or ensure that your data collection setup in GA4 is configured to capture this data.
For example, the specific BigQuery field names provided, such as SUM(google_ads_clicks)
, SUM(google_ads_cost)
, etc., were illustrative and not directly pulled from the GA4 BigQuery export schema.
GA4’s BigQuery export does not directly provide fields named ‘
google_ads_clicks
‘, ‘google_ads_cost
‘, ‘non_google_clicks
‘, ‘non_google_cost
‘, etc.
Instead, advertising metrics and costs are typically derived from the event data that GA4 exports to BigQuery, which requires parsing and aggregating specific event parameters related to advertising.
Let’s construct example SQL queries to calculate various Google Ads and non-Google advertising metrics.
These examples assume that you have linked your Google Ads account with GA4 and are utilizing BigQuery to analyze the exported data.
The metrics will be derived from custom fields or calculations based on the event data available in your GA4 BigQuery export.
Google Ads Clicks
SELECT
SUM(metrics_clicks) AS google_ads_clicks
FROM
`your_project.your_dataset.google_ads_table`
Google Ads Cost
SELECT
SUM(metrics_cost_micros) / 1000000 AS google_ads_cost
FROM
`your_project.your_dataset.google_ads_table`
Google Ads Impressions
SELECT
SUM(metrics_impressions) AS google_ads_impressions
FROM
`your_project.your_dataset.google_ads_table`
Google Ads Video Cost
Assuming video cost is part of the cost metrics and needs to be filtered by video ad interactions:
SELECT
SUM(metrics_cost_micros) / 1000000 AS google_ads_video_cost
FROM
`your_project.your_dataset.google_ads_table`
WHERE
segments_ad_network_type = 'VIDEO'
Google Ads Video Views
Assuming video views are tracked as a specific interaction type:
SELECT
SUM(metrics_interactions) AS google_ads_video_views
FROM
`your_project.your_dataset.google_ads_table`
WHERE
metrics_interaction_event_types = 'VIDEO_VIEW'
Non-Google Advertising Metrics
For non-Google advertising metrics, let’s assume you are tracking these through custom events or parameters in GA4 that are then exported to BigQuery.
The specific field names and calculations might vary based on how you’ve set up tracking for these metrics.
Non-Google Clicks
SELECT
COUNT(*) AS non_google_clicks
FROM
`your_project.your_dataset.events_*`
WHERE
event_name = 'non_google_ad_click'
Non-Google Key Events
Assuming a key event is defined and tracked explicitly:
SELECT
COUNT(*) AS non_google_key_events
FROM
`your_project.your_dataset.events_*`
WHERE
event_name = 'non_google_key_event'
Non-Google Impressions
SELECT
COUNT(*) AS non_google_impressions
FROM
`your_project.your_dataset.events_*`
WHERE
event_name = 'non_google_ad_impression'
Non-Google Revenue
Assuming revenue from non-Google ads is tracked as part of event parameters:
SELECT
SUM(event_params.value.double_value) AS non_google_revenue
FROM
`your_project.your_dataset.events_*`,
UNNEST(event_params) AS event_params
WHERE
event_name = 'purchase' AND
event_params.key = 'non_google_ad_revenue'
Non-Google Cost
Assuming the cost for non-Google ads is tracked similarly:
SELECT
SUM(event_params.value.double_value) AS non_google_cost
FROM
`your_project.your_dataset.events_*`,
UNNEST(event_params) AS event_params
WHERE
event_params.key = 'non_google_ad_cost'
Note: The specific calculations and field names might need adjustments based on your data schema and how you have configured tracking for Google Ads and non-Google advertising metrics.
Other articles on GA4 BigQuery
#1 BigQuery Introduction
- How to create a new Google Cloud Platform account.
- How to create a new BigQuery project.
- What is Google BigQuery Sandbox and how to use it.
- Understanding the BigQuery User Interface.
- What is BigQuery Data Transfer Service & how it works.
- How to create data transfer in BigQuery.
- Connect and transfer data from Google Sheets to BigQuery.
- How to access BigQuery Public Data Sets.
- Best Supermetrics Alternative – Dataddo.
#2 GA4 BigQuery Introduction
- Google Analytics 4 BigQuery Tutorial for Beginners to Advanced.
- GA4 Bigquery Export Schema Tutorial.
- GA4 BigQuery – Connect Google Analytics 4 with BigQuery.
- events_ & events_intraday_ tables in BigQuery for GA4 (Google Analytics 4).
- pseudonymous_users_ & users_ data tables in BigQuery for GA4 (Google Analytics 4).
- How to access GA4 Sample Data in BigQuery.
- Advantages of using Google BigQuery for Google Analytics 4.
- Impact of Google Advanced Consent Mode on BigQuery & GDPR.
#3 GA4 BigQuery Data Transfer
- How to Connect and Export Data from GA4 to BigQuery
- How to backfill GA4 data in BigQuery.
- How to overcome GA4 BigQuery Export limit.
- How to Send Custom GA4 Data to BigQuery.
- How to backup Universal Analytics data to BigQuery.
- How to send data from Google Ads to BigQuery.
- How to send data from Google Search Console to BigQuery.
- Sending data from Google Analytics to BigQuery without 360.
- How to send data from Facebook ads to BigQuery.
- How to pull custom data from Google Analytics to BigQuery.
#4 BigQuery Cost Optimization
- Guide to BigQuery Cost Optimization.
- Using Google Cloud pricing calculator for BigQuery.
- Cost of using BigQuery for Google Analytics 4.
#5 Query GA4 BigQuery Data
- How to query Google Analytics data in BigQuery.
- Query GA4 data in BigQuery without understanding SQL.
- Using GA4 BigQuery SQL generator to create SQL queries.
- New vs Returning users in GA4 BigQuery data table.
- GA4 BigQuery Composer Tutorial for ChatGPT.
- How to track GA4 BigQuery Schema Change.
- Calculating Sessions and Engaged Sessions in GA4 BigQuery.
- Calculating Total Users in GA4 BigQuery.
#6 GA4 to BigQuery Dimension/Metric Mapping.
- GA4 to BigQuery Mapping Tutorial.
- GA4 Attribution Dimensions to BigQuery Mapping.
- GA4 Google Ads Dimensions to BigQuery Mapping.
- GA4 Demographic Dimensions to BigQuery Mapping.
- GA4 Ecommerce Dimensions to BigQuery Mapping.
- GA4 Event-Scoped Ecommerce Metrics to BigQuery Mapping.
- GA4 Item-Scoped Ecommerce Metrics to BigQuery Mapping.
- GA4 Revenue Metrics to BigQuery Mapping.
- GA4 Event Dimensions to BigQuery Mapping.
- GA4 Event Metrics to BigQuery Mapping.
- GA4 Geography Dimensions to BigQuery Mapping.
- GA4 Link Dimensions to BigQuery Mapping.
- GA4 Page/Screen Dimensions to BigQuery Mapping.
- GA4 Page/Screen Metrics to BigQuery Mapping.
- GA4 Platform/Device Dimensions to BigQuery Mapping.
- GA4 User-Scoped Traffic Dimensions to BigQuery Mapping.
- GA4 Session-Scoped Traffic Dimensions to BigQuery Mapping.
- GA4 Session Metrics to BigQuery Mapping.
- GA4 User Dimensions to BigQuery Mapping.
- GA4 User Metrics to BigQuery Mapping.
- GA4 Advertising Metrics to BigQuery Mapping.
My best selling books on Digital Analytics and Conversion Optimization
Maths and Stats for Web Analytics and Conversion Optimization
This expert guide will teach you how to leverage the knowledge of maths and statistics in order to accurately interpret data and take actions, which can quickly improve the bottom-line of your online business.
Master the Essentials of Email Marketing Analytics
This book focuses solely on the ‘analytics’ that power your email marketing optimization program and will help you dramatically reduce your cost per acquisition and increase marketing ROI by tracking the performance of the various KPIs and metrics used for email marketing.
Attribution Modelling in Google Analytics and BeyondSECOND EDITION OUT NOW!
Attribution modelling is the process of determining the most effective marketing channels for investment. This book has been written to help you implement attribution modelling. It will teach you how to leverage the knowledge of attribution modelling in order to allocate marketing budget and understand buying behaviour.
Attribution Modelling in Google Ads and Facebook
This book has been written to help you implement attribution modelling in Google Ads (Google AdWords) and Facebook. It will teach you, how to leverage the knowledge of attribution modelling in order to understand the customer purchasing journey and determine the most effective marketing channels for investment.