Analistable

How to merge GA4 data with ad cost data

By the Analistable team · Updated · 2 min read

Link Google Ads to GA4 and the cost appears in GA4's acquisition reports automatically. For Meta, LinkedIn or other platforms, either upload costs with GA4's Data Import (cost data), or export both sides and join them in a spreadsheet on date + campaign (GA4's Session campaign is your utm_campaign). Then calculate ROAS = revenue ÷ cost and CPA = cost ÷ conversions.

Part of our guide: How to join spreadsheets on a common column

Google Ads: link instead of merge

In GA4 Admin → Product links → Google Ads links, link the account (auto-tagging on). GA4 then shows Google Ads cost, clicks and cost per conversion alongside its own conversions in the acquisition and advertising reports. You only need a manual merge for other ad platforms or for custom reports.

Other platforms: export and join

  1. Export GA4's Traffic acquisition report with Session campaign as the dimension (add Date as a secondary dimension in an Exploration if you need daily data). Keep Sessions, Conversions (key events) and Revenue.
  2. Export spend from each ad platform by day and campaign name.
  3. Stack the ad platform exports into one Costs table with columns Date, Platform, Campaign, Cost — see combining sheets into one.
  4. Create a key in both tables: =TEXT([@Date],"yyyy-mm-dd")&"|"&LOWER(TRIM([@Campaign])).
  5. Bring GA4 conversions and revenue into the Costs table with XLOOKUP on the key, or merge in Power Query.
Costs joined with GA4 results, one week
PlatformCampaignCostGA4 conversionsGA4 revenueCPAROAS
Metaautumn_sale640322880204.5
LinkedInb2b_webinar900120750
Microsoft Adsbrand_uk21019171011.18.1

Why campaign names don't match

  • GA4 reads utm_campaign exactly as written in the link; the ad platform shows the campaign's display name. Use the same naming in both or keep a mapping table.
  • Case and spaces: “Autumn Sale” and “autumn_sale” won't match. Normalise with LOWER and SUBSTITUTE.
  • Time zones: an ad account in one time zone and a GA4 property in another shift spend and conversions across midnight. Compare weekly totals if daily numbers look off.
  • Attribution: GA4 credits conversions by its attribution model; the ad platform uses its own. Expect the platforms to claim more conversions than GA4 reports.

GA4 Data Import for cost data

GA4 can import non-Google costs (Admin → Data import → Create data source → Cost data). The upload needs campaign ID, source, medium, date and cost columns that match your UTM tags. Once imported, cost appears in GA4's reports next to conversions. It's the cleaner long-term option; the spreadsheet join is faster for a one-off analysis.

Analistable can load GA4 reports and your cost CSVs together and answer “which campaigns had ROAS above 3 last month?” without building the join yourself.

Frequently asked questions

How do I see Google Ads cost in GA4?
Link Google Ads in GA4 Admin → Product links. Cost metrics then appear in GA4's acquisition and advertising reports.
How do I add Facebook or LinkedIn ad costs to GA4?
Use GA4 Data Import with the Cost data type, or export both datasets and join them in a spreadsheet by date and campaign.
Why do conversions in GA4 and the ad platform differ?
Each uses its own attribution model, conversion window and tracking method, so their counts rarely match.

Related guides