GA4 Cost Data Import: Complete Step-by-Step Setup Guide
You're spending $20,000/month on LinkedIn Ads, TikTok, and Pinterest. Your GA4 shows beautiful conversion data. But when you try to calculate ROAS...
Cost: $0.00
GA4 has no idea how much you're spending because these platforms don't automatically send cost data like Google Ads and Facebook do.
The solution: Manual cost data import using GA4's Data Import feature.
This guide walks you through the complete setup process in under 30 minutes, with copy-paste-ready CSV templates and troubleshooting for common errors.
🚨 Not sure what's breaking your tracking?
Run a free 60-second audit to check all 40+ ways UTM tracking can fail.
Scan Your Campaigns Free✓ No credit card ✓ See results instantly
Prerequisites (Do This First)
Before setting up cost import, ensure you have:
✅ Requirement 1: utm_id in Your Campaign URLs
Every campaign URL must include utm_id:
✅ Correct:
https://yoursite.com/demo?utm_id=LI-2025-01-DEMO&utm_source=linkedin&utm_medium=cpc&utm_campaign=product-demo
❌ Wrong (no utm_id):
https://yoursite.com/demo?utm_source=linkedin&utm_medium=cpc&utm_campaign=product-demo
Why: GA4 uses utm_id to match your cost data to the correct campaigns. Without it, matching fails and cost import doesn't work.
Read this first if you haven't added utm_id: utm_id: The Missing Link for Cost Data Import
✅ Requirement 2: GA4 Admin Access
You need Editor or Administrator role in GA4 to set up data import.
Check your access:
- GA4 → Admin (bottom left)
- Account Access Management
- Verify your role = Editor or Administrator
✅ Requirement 3: Cost Data from Your Ad Platforms
You need daily cost data from each platform you want to import.
Where to find it:
| Platform | Where to Export Cost Data |
|---|---|
| LinkedIn Ads | Campaign Manager → Performance → Export |
| TikTok Ads | Ads Manager → Reports → Export |
| Pinterest Ads | Ads Manager → Reporting → Download |
| Twitter (X) Ads | Ads Manager → Analytics → Export data |
| Reddit Ads | Ads Manager → Reporting → Download |
| Taboola | Campaign Summary → Export |
| Outbrain | Dashboard → Export CSV |
| Snapchat Ads | Ads Manager → Reports → Download |
Step-by-Step Setup (30 Minutes)
Part 1: Create Data Import Source in GA4 (10 minutes)
Step 1: Open GA4 → Admin (bottom left)
Step 2: In the Property column, click Data import
Step 3: Click Create data source
Step 4: Select Cost data as the import type
Step 5: Click Next
Step 6: Configure data source settings:
Data source name: Ad Platform Cost Data (or be specific: "LinkedIn Cost Data")
Description: Daily cost data import for LinkedIn Ads campaigns
Step 7: Select data source parameters:
Key (required):
- ✅ Campaign ID ← This matches your utm_id
Imported dimensions (optional but recommended):
- ✅ Campaign
- ✅ Source
- ✅ Medium
Imported metrics (required):
- ✅ Cost ← Required for ROI calculations
- Clicks (optional)
- Impressions (optional)
Step 8: Click Next
Step 9: Schema mapping:
GA4 will show you the required CSV format. Note the column names (case-sensitive):
Date ← Required (format: YYYYMMDD)
Campaign ID ← Required (matches utm_id)
Cost ← Required (numeric, no currency symbols)
Campaign ← Optional
Source ← Optional
Medium ← Optional
Step 10: Click Create
Result: You now have a data import source. Next, you'll upload your first CSV.
Part 2: Prepare Your Cost Data CSV (10 minutes)
Step 1: Export cost data from your ad platform
Download daily cost data for your campaigns. Most platforms let you export as CSV or Excel.
Step 2: Create CSV in the GA4 format
Required column format:
Date,Campaign ID,Cost
20250101,LI-2025-01-DEMO,987.50
20250102,LI-2025-01-DEMO,1024.80
20250103,LI-2025-01-DEMO,956.30
20250101,TT-2025-01-BRAND,456.20
20250102,TT-2025-01-BRAND,492.15
20250103,TT-2025-01-BRAND,478.90Column requirements:
| Column | Format | Example |
|---|---|---|
| Date | YYYYMMDD (no dashes/slashes) | 20250109 |
| Campaign ID | Exact match to utm_id in URLs | LI-2025-01-DEMO |
| Cost | Numeric only (no $, commas) | 987.50 |
Optional columns (recommended):
Date,Campaign ID,Cost,Campaign,Source,Medium
20250101,LI-2025-01-DEMO,987.50,product-demo,linkedin,cpc
20250102,LI-2025-01-DEMO,1024.80,product-demo,linkedin,cpcStep 3: CSV Template (Copy This)
Basic template (required fields only):
Date,Campaign ID,Cost
20250101,LI-2025-01-DEMO,987.50
20250102,LI-2025-01-DEMO,1024.80
20250103,LI-2025-01-DEMO,956.30Full template (with optional fields):
Date,Campaign ID,Cost,Campaign,Source,Medium,Clicks,Impressions
20250101,LI-2025-01-DEMO,987.50,product-demo,linkedin,cpc,234,12500
20250102,LI-2025-01-DEMO,1024.80,product-demo,linkedin,cpc,256,13200
20250103,LI-2025-01-DEMO,956.30,product-demo,linkedin,cpc,221,11800Step 4: Save as CSV (UTF-8 encoding)
- Excel: File → Save As → CSV UTF-8 (Comma delimited)
- Google Sheets: File → Download → Comma-separated values (.csv)
Important: Do NOT use Excel's default "CSV (Comma delimited)" - it may cause encoding issues. Use "CSV UTF-8" instead.
Part 3: Upload Cost Data to GA4 (5 minutes)
Step 1: GA4 → Admin → Data import
Step 2: Click on your data source name (e.g., "LinkedIn Cost Data")
Step 3: Click Upload file
Step 4: Click Select file and choose your CSV
Step 5: Click Import
Step 6: Wait for processing (usually 10-30 seconds)
Step 7: Verify upload status
You'll see one of these statuses:
| Status | Meaning |
|---|---|
| ✅ Completed | Upload successful, cost data imported |
| ⚠️ Partial | Some rows imported, some failed (check error log) |
| ❌ Failed | Upload failed (fix errors and re-upload) |
If status = Failed or Partial:
Click View details to see error messages. Common errors covered in Troubleshooting section below.
Part 4: Verify Cost Data Appears in GA4 (5 minutes)
Step 1: GA4 → Reports → Advertising (left sidebar)
If you don't see "Advertising":
- GA4 → Admin → Property settings
- Show advanced → Enable "Advertising features"
- Wait 10 minutes for menu to appear
Step 2: Click Campaign performance
Step 3: Check for cost metrics:
Look for these new columns:
- Cost (should show $ values now!)
- ROAS (Return on ad spend)
- CPA (Cost per acquisition)
Step 4: Verify cost values match your CSV
Filter to one of your campaigns (use utm_campaign or Campaign ID) and verify the cost shown matches what you uploaded.
If cost still shows $0.00:
- Wait 24-48 hours (cost data can take time to process)
- Check utm_id matching (see Troubleshooting below)
- Verify CSV was uploaded successfully
😰 Is this your only tracking issue?
This is just 1 of 40+ ways UTM tracking breaks. Most marketing teams have 8-12 critical issues they don't know about.
• 94% of sites have UTM errors
• Average: $8,400/month in wasted ad spend
• Fix time: 15 minutes with our report
✓ Connects directly to GA4 (read-only, secure)
✓ Scans 90 days of data in 2 minutes
✓ Prioritizes issues by revenue impact
✓ Shows exact sessions affected
Real Example: Multi-Platform Cost Import
Scenario: You're running ads on LinkedIn, TikTok, and Pinterest.
Step 1: Add utm_id to All Campaign URLs
LinkedIn campaign:
https://yoursite.com/demo?utm_id=LI-2025-01-DEMO&utm_source=linkedin&utm_medium=cpc&utm_campaign=product-demo-jan
TikTok campaign:
https://yoursite.com/signup?utm_id=TT-2025-01-BRAND&utm_source=tiktok&utm_medium=cpc&utm_campaign=brand-awareness-jan
Pinterest campaign:
https://yoursite.com/products?utm_id=PIN-2025-01-SHOP&utm_source=pinterest&utm_medium=cpc&utm_campaign=shopping-jan
Step 2: Export Cost Data from Each Platform
LinkedIn Ads:
- Campaign Manager → Performance
- Date range: Last 30 days
- Export → Download CSV
- Open CSV, note daily cost for Campaign ID 123456789
TikTok Ads:
- Ads Manager → Reports
- Date range: Last 30 days
- Export
- Open CSV, note daily cost for Campaign ID 987654321
Pinterest Ads:
- Ads Manager → Reporting
- Select your campaign
- Download data
Step 3: Create Combined CSV
Format:
Date,Campaign ID,Cost,Campaign,Source,Medium
20250101,LI-2025-01-DEMO,987.50,product-demo-jan,linkedin,cpc
20250101,TT-2025-01-BRAND,456.20,brand-awareness-jan,tiktok,cpc
20250101,PIN-2025-01-SHOP,234.80,shopping-jan,pinterest,cpc
20250102,LI-2025-01-DEMO,1024.80,product-demo-jan,linkedin,cpc
20250102,TT-2025-01-BRAND,492.15,brand-awareness-jan,tiktok,cpc
20250102,PIN-2025-01-SHOP,256.40,shopping-jan,pinterest,cpc
20250103,LI-2025-01-DEMO,956.30,product-demo-jan,linkedin,cpc
20250103,TT-2025-01-BRAND,478.90,brand-awareness-jan,tiktok,cpc
20250103,PIN-2025-01-SHOP,228.50,shopping-jan,pinterest,cpcTip: You can combine all platforms into one CSV or create separate data sources per platform. We recommend one CSV with all platforms for easier management.
Step 4: Upload to GA4
- GA4 → Admin → Data import → Your data source
- Upload CSV
- Wait for "Completed" status
- Verify in Advertising reports
Result: Cost data for all three platforms now appears in GA4, enabling full ROI analysis.
Automation Options (Advanced)
Manual CSV uploads work, but if you're running active campaigns, you'll want automation.
Option 1: GA4 Data Import API (Free, Requires Dev)
Google provides an API for automated cost uploads.
How it works:
- Schedule daily script (Python, Node.js, etc.)
- Script pulls cost data from ad platform APIs
- Script formats data as JSON
- Script posts to GA4 Data Import API
- Cost data automatically updated daily
Pros:
- Free
- Fully customizable
- No third-party tools
Cons:
- Requires developer
- Must maintain scripts
- Must handle API changes
Documentation: GA4 Management API - Data Import
Option 2: Third-Party Automation (Paid, No Code)
Several tools automate cost data import:
| Tool | Platforms Supported | Pricing |
|---|---|---|
| Supermetrics | 80+ platforms | From $99/month |
| Windsor.ai | LinkedIn, TikTok, Pinterest, etc. | From $49/month |
| Funnel.io | 500+ connectors | From $299/month |
| Porter | All major platforms | From $199/month |
How it works:
- Connect your ad accounts
- Connect your GA4 property
- Tool automatically syncs cost data daily
Pros:
- No coding required
- Automatic daily updates
- Handles multiple platforms
- Built-in error handling
Cons:
- Monthly cost
- Less customization
Recommendation: If you're spending $10k+/month on ads, a $99/month automation tool is worth it to save 5+ hours/month of manual uploads.
Option 3: Google Sheets + Apps Script (Free, Semi-Automated)
How it works:
- Manually paste cost data into Google Sheet (weekly)
- Apps Script auto-formats to GA4 CSV format
- Apps Script uploads to GA4 via API
Pros:
- Free
- Less manual work than pure CSV uploads
- No dev team needed (basic scripting)
Cons:
- Still requires weekly manual data paste
- Limited error handling
Tutorial: Automate GA4 Cost Import with Google Sheets (external resource)
Common CSV Formatting Errors (And Fixes)
Error 1: "Date column must be in YYYYMMDD format"
Wrong:
Date,Campaign ID,Cost
01/09/2025,LI-2025-01-DEMO,987.50 ← Slashes not allowed
2025-01-09,LI-2025-01-DEMO,987.50 ← Dashes not allowedRight:
Date,Campaign ID,Cost
20250109,LI-2025-01-DEMO,987.50 ← No separatorsError 2: "Cost must be numeric"
Wrong:
Date,Campaign ID,Cost
20250109,LI-2025-01-DEMO,$987.50 ← Dollar sign not allowed
20250109,LI-2025-01-DEMO,1,024.80 ← Commas not allowedRight:
Date,Campaign ID,Cost
20250109,LI-2025-01-DEMO,987.50 ← Plain number
20250109,LI-2025-01-DEMO,1024.80 ← No comma separatorsError 3: "Campaign ID contains invalid characters"
Wrong:
Date,Campaign ID,Cost
20250109,LI 2025 01 DEMO,987.50 ← Spaces cause issues
20250109,LI-2025-01-DEMO!,987.50 ← Special chars (!@#$%)Right:
Date,Campaign ID,Cost
20250109,LI-2025-01-DEMO,987.50 ← Alphanumeric + hyphens onlyError 4: "File encoding not supported"
Problem: CSV saved in wrong encoding (ANSI, Windows-1252, etc.)
Fix:
- Excel: Save As → CSV UTF-8 (Comma delimited)
- Google Sheets: Download → CSV (already UTF-8)
- Notepad: Save As → Encoding: UTF-8
Error 5: "No matching Campaign ID found"
Problem: utm_id in your URLs doesn't match Campaign ID in CSV
URL utm_id:
?utm_id=LI-2025-01-DEMO
CSV Campaign ID:
linkedin-demo-jan-2025 ← Doesn't match!Fix: Ensure exact match (case-sensitive):
Date,Campaign ID,Cost
20250109,LI-2025-01-DEMO,987.50 ← Matches URL exactlyError 6: "Duplicate rows for same date + Campaign ID"
Wrong:
Date,Campaign ID,Cost
20250109,LI-2025-01-DEMO,987.50
20250109,LI-2025-01-DEMO,450.00 ← Duplicate date+IDFix: Combine costs for same day:
Date,Campaign ID,Cost
20250109,LI-2025-01-DEMO,1437.50 ← Sum of bothTroubleshooting: Cost Data Not Showing
Issue: Cost uploaded but still shows $0.00 in reports
Possible causes:
Cause 1: utm_id mismatch
Check:
- GA4 → Reports → Engagement → Pages and screens
- Add secondary dimension: "Campaign ID"
- Verify Campaign ID values match your CSV
Fix: Update CSV to match exact Campaign ID shown in GA4.
Cause 2: Date range mismatch
Check: Your GA4 report date range vs your CSV date range
Fix: Ensure CSV covers same dates as your report.
Cause 3: Processing delay
Wait: Cost data can take 24-48 hours to fully process and appear in reports.
Cause 4: Wrong data source
Check: Did you upload to the correct data source? (If you created multiple)
Fix: Admin → Data import → Verify upload in correct source.
Issue: "Partial" upload status with some rows failing
Check error log:
- Admin → Data import → Your source
- Click on upload with "Partial" status
- View details → Download error log
Common errors:
- Row X: Date format invalid → Fix date format
- Row Y: Cost not numeric → Remove currency symbols
- Row Z: Campaign ID not found → Check utm_id matching
Prevention Checklist
✅ Add utm_id to all paid campaign URLs (non-auto-tagged platforms) ✅ Create cost data CSV in correct format (YYYYMMDD dates, numeric cost) ✅ Verify Campaign ID in CSV exactly matches utm_id in URLs ✅ Save CSV as UTF-8 encoding ✅ Upload to GA4 data import ✅ Wait 24-48 hours for cost data to appear ✅ Verify in Advertising reports (cost > $0.00) ✅ Set up weekly/monthly uploads (or automate)
✅ Fixed this issue? Great! Now check the other 39...
You just fixed one tracking issue. But are your Google Ads doubling sessions? Is Facebook attribution broken? Are internal links overwriting campaigns?
• Connects to GA4 (read-only, OAuth secured)
• Scans 90 days of traffic in 2 minutes
• Prioritizes by revenue impact
• Free forever for monthly audits
Join 2,847 marketers fixing their tracking daily
FAQ
How often should I upload cost data?
Manual uploads:
- Daily for active campaigns (most accurate ROI)
- Weekly for lower-spend campaigns
- Monthly minimum (stale data hurts decision-making)
Automated:
- Daily (recommended for $10k+/month spend)
Can I import historical cost data?
Yes! GA4 allows up to 90 days of backdated cost import.
Example:
Date,Campaign ID,Cost
20241010,LI-2024-Q4-DEMO,850.00 ← 90 days ago, works!
20241120,LI-2024-Q4-DEMO,920.00
20250109,LI-2024-Q4-DEMO,987.50Limitation: Cannot import data older than 90 days.
What if I change my utm_id mid-campaign?
Problem: Historical cost data won't match new utm_id.
Solution:
- Keep old utm_id for historical data
- Create new row in CSV with new utm_id for future costs
- Or create two separate campaigns in GA4
Recommendation: Don't change utm_id mid-campaign. Plan it correctly from the start.
Can I delete old cost uploads?
No. GA4 doesn't allow deletion of imported cost data. You can only:
- Upload new data (overwrites same date + Campaign ID)
- Stop future uploads
Workaround: Upload a CSV with Cost = 0 for dates you want to "remove."
Do I need separate data sources for each platform?
No. You can combine all platforms in one CSV and upload to one data source:
Date,Campaign ID,Cost,Source
20250109,LI-2025-01-DEMO,987.50,linkedin
20250109,TT-2025-01-BRAND,456.20,tiktok
20250109,PIN-2025-01-SHOP,234.80,pinterestRecommendation: Use one data source for all platforms (easier management).
What's the maximum CSV file size?
GA4 limits:
- File size: 1 GB max
- Rows: Unlimited (but upload time increases)
Practical limit: 50,000 rows upload quickly. Above 100,000 rows, consider splitting into multiple files.
Conclusion
GA4 cost data import in 4 steps:
- Add utm_id to campaign URLs (required for matching)
- Create data source in GA4 (Admin → Data import → Cost data)
- Prepare CSV (Date, Campaign ID, Cost in correct format)
- Upload and verify (wait 24-48 hours, check Advertising reports)
Once set up, you'll have full ROI visibility in GA4:
- Cost per acquisition (CPA)
- Return on ad spend (ROAS)
- Campaign profitability
- Data-driven budget allocation
Manual uploads take 10 minutes/week. For automation, consider Supermetrics, Windsor.ai, or custom API integration.