Bing Ads CPA Tracking in BigQuery (with GA4)

Enable reliable CPA tracking in auto-refreshing, analytics-ready tables with this ready-to-use BigQuery data model that unifies Bing Ads cost data with GA4 conversion events. Get real-time visibility into campaign performance and optimization opportunities in minutes.

arrow
bing ads cpa tracking data model bigquery

Found this kit useful? Give it a boost by sharing with others!

Cost per action (CPA) tracking is critical for understanding how efficiently your Bing Ads campaigns use your advertising budget. But CPA becomes unreliable when ad costs aren’t connected to actual user conversions.

This data model combines Bing Ads cost data with GA4 conversion events in BigQuery, linking spend, clicks, and impressions to purchases, signups, and other actions. The result is a clear, cost-to-performance view that enables accurate CPA tracking.

With this ready-to-use BigQuery data model, you get auto-refreshing, analytics-ready tables for near real-time insights into Bing Ads campaign performance and optimization opportunities.

A pre-built Bing Ads CPA tracking data model

We start by exporting Bing Ads cost data, including the campaign names used to structure an account. 

Next, we align this data with GA4’s campaign_name field, derived from the UTM parameters. By using the campaign name as a shared reference, we can associate advertising spend with on-site actions, even when Bing campaign metadata is not available inside GA4.

This model lets you:

  • Calculate CPA and ROAS at the campaign level
  • Analyze performance over time
  • Restore missing attribution caused by incorrect tracking setups
  • Build a scalable marketing warehouse in BigQuery

And the best part—Windsor.ai automates data extraction, cleaning, and loading, so you can launch a reliable Bing Ads pipeline in BigQuery in minutes.

How this data model works

To connect Bing Ads spend with GA4 user actions, you need a clear and reliable link between the two datasets:

  1. GA4 captures your UTM parameters, including utm_campaign, while Bing Ads exports always include campaign_id and campaign_name.
  2. By matching GA4’s campaign_name with Bing Ads’ campaign_name, you create the connection between ad spend and user actions. This link allows you to calculate CPA and see exactly which campaigns are driving results.

Our solution uses a standard dimensional modeling approach.

bing ads cpa tracking in windsor

Fact tables:

  • fact_bing_costs – impressions, clicks, cost
  • fact_ga4_actions – GA4 conversions and events

Dimension tables:

  • dim_bing_campaign – maps GA4 campaign_name to Bing Ads campaign_name
  • dim_bing_account – contains Bing Ads account attributes

The campaign dimension is central to this model. Because GA4 doesn’t automatically receive Bing campaign metadata, UTM campaign names act as the shared key. This ensures that every Bing Ads spend entry can be tied directly to GA4 user actions, providing a complete and accurate view of CPA.

How to deploy this model using Windsor.ai

To make your setup easier, we’ve prepared ready-to-use configurations for the tables defined in the above schema. These configurations can be copied right into Windsor.ai to create scheduled export tasks for BigQuery.

Quick setup steps:

  1. Connect your Bing Ads and GA4 account(s) to Windsor.ai and click ‘Next.’
  2. Scroll down to Destinations → BigQuery.
  3. Click “Create destination task” (create separate tasks for each config).
  4. Paste the Connector URL from the config below.
  5. Set Schedule type as proposed in the config (or adjust to your needs).
  6. Set Columns to match from the config below.
  7. Save the task and see it’s running and streaming data to your BigQuery project.

📚 For detailed setup steps (including connecting your BigQuery project), visit documentation: How to Integrate Data into BigQuery with Windsor.ai.

Once set up, Windsor will automatically populate your BigQuery tables with data from Bing Ads and GA4, so you can start analyzing your CPA right away. You can start with a 30-day free trial to test it out at no cost and see how it works for your analytics.

Pre-built configurations for Windsor to BigQuery export tasks

Create BigQuery destination tasks in Windsor.ai with the following configurations (just copy-paste the connector URL and select/adjust the proposed settings).

❗ Important: Make sure to insert your actual API key into these connector URLs. For a quick API key insertion, first, paste a copied connector URL into the data preview field; Windsor will automatically add your API key. Preview your data and copy-paste this complete URL into the BigQuery destination task (repeat for each config).

bing ads cpa to bigquery windsor data model

1) Destination task: fact_bing_costs

Connector URL:

https://connectors.windsor.ai/bing?date_preset=last_7d&fields=account_id,campaign_id,clicks,country,date,impressions,totalcost

api key in connector url windsor

Task settings:

Task nameBing Ads CPA -> BigQuery (fact_bing_costs)
Schedule typeDaily
Columns to matchdate, account_id, campaign_id

2) Destination task: fact_ga4_actions

Connector URL:

https://connectors.windsor.ai/googleanalytics4?date_preset=last_7d&fields=campaign_name,country,date,event_count,event_name,medium,source

Task settings:

Task nameBing Ads CPA -> BigQuery (fact_ga4_actions)
Schedule typeDaily
Columns to matchdate, campaign_name
Filters (optional)If needed, you can also add these filters. Make sure to adjust them for custom UTM setups:

( medium = cpc OR

  medium = search )

AND

( source = bing OR

  source = microsoft )

3) Destination task: dim_bing_campaign

Connector URL:

https://connectors.windsor.ai/bing?date_preset=last_7d&fields=account_id,campaign,campaign_id,campaign_labels,campaign_status,campaign_type

Task settings:

Task nameBing Ads CPA -> BigQuery (dim_bing_campaign)
Schedule typeDaily
Columns to matchcampaign_id

4) Destination task: dim_bing_account

Connector URL:

https://connectors.windsor.ai/bing?date_preset=last_7d&fields=account_id,account_name,account_status,currency

Task settings:

Task nameBing Ads CPA -> BigQuery (dim_bing_account)
Schedule typeDaily
Columns to matchaccount_id

Sample query

Below is a sample SQL query you can use to calculate Bing Ads CPA in BigQuery on top of the deployed data model (❗Don’t forget to replace the placeholder table names with your actual BigQuery table names).

WITH 
ga4_form_submissions AS (
SELECT 
date,
campaign_name,
SUM(event_count) AS form_submissions
FROM `project.dataset_id.fact_ga4_actions`
WHERE 
source IN ('bing', 'microsoft')
AND medium IN ('ppc', 'search')
AND event_name = 'form_submit'
GROUP BY date, campaign_name
),

bing_metrics AS (
SELECT
date,
campaign_id,
SUM(impressions) AS impressions,
SUM(totalcost) AS cost,
SUM(clicks) AS clicks
FROM `project.dataset_id.fact_bing_costs`
GROUP BY date, campaign_id
)

SELECT
ga4.date,
ga4.campaign_name,
ga4.form_submissions,
cmp.campaign_id,
bing.cost,
bing.clicks,
SAFE_DIVIDE(bing.cost, ga4.form_submissions) AS cpa
FROM ga4_form_submissions ga4
LEFT JOIN `project.dataset_id.dim_bing_campaign` cmp
ON ga4.campaign_name = cmp.campaign
LEFT JOIN bing_metrics bing
ON cmp.campaign_id = bing.campaign_id
AND bing.date = ga4.date
ORDER BY ga4.campaign_name, ga4.date;

This query:

  • Aggregates form submissions from GA4
  • Blends them with Bing Ads cost and click data
  • Joins both datasets through the shared campaign name and campaign ID fields 

The result is a clean, campaign-level view of impressions, clicks, cost, and form submissions, along with a calculated CPA you can use for reporting or dashboards.

What you get:

Collecting data is easy. Making sense of it is where most marketers struggle. Bing Ads tells you how much you spent. GA4 tells you what users did. Separately, they only give half the story. Together, they reveal CPA. The single metric that shows the real value of your campaigns.

By building a dimensional model in BigQuery, you bring these two worlds together. Fact tables track spend, clicks, impressions, and conversions. Dimension tables connect campaigns and accounts. The result is a clean, analytics-ready dataset that shows exactly which campaigns generate results and which don’t.

This approach does more than automate reporting. It allows you to:

  • Evaluate the true cost of each user action
  • Compare campaign performance objectively
  • Optimize spend where it matters most
  • Scale analysis across multiple accounts and campaigns

With Windsor.ai’s automated connector feeding BigQuery, your pipeline stays reliable and scalable. You gain confidence in your decisions, clarity in your reporting, and the freedom to focus on strategy instead of data wrangling.

🚀 Integrate your Bing Ads data into BigQuery with Windsor.ai and build your unified CPA dataset right now: https://onboard.windsor.ai.

Explore other kits

connector arrowdestination
Facebook Ads Performance Reporting in BigQuery
connector connector arrowdestination
Google Ads CPA Tracking in BigQuery (with GA4)
connector connector arrowdestination
Facebook Ads CPA Tracking in BigQuery (with GA4)
connector arrowdestination
Google Ads Quality Score Reporting in BigQuery