Cost data is essential for understanding marketing performance, yet many eCommerce businesses struggle to track ad spend across multiple platforms. With GA4’s updated Cost Data Import, you can now integrate advertising metrics from non-Google platforms like Facebook, TikTok, and LinkedIn—giving you a clearer picture of your return on ad spend (ROAS) and marketing efficiency.
For eCommerce brands using third-party platforms like Shopify, WooCommerce, and Magento, this update is especially valuable. By importing cost data into GA4, you can unify spend from multiple ad networks, match it with transaction data, and gain deeper insights into profitability. Beyond online ad costs, GA4’s General Data Import allows businesses to merge offline transaction data from POS systems, CRM platforms, and loyalty programs—offering a complete view of customer behavior across digital and physical touchpoints.
In this guide, we’ll explore how to set up GA4’s cost data import, optimize it for Shopify, WooCommerce, and Magento, and leverage GA4’s broader import capabilities to track both online and offline sales data—giving you the insights needed to make smarter, data-driven decisions.
What Is Cost Data Import in GA4?
Cost Data Import is a feature in GA4 that allows you to bring in advertising cost data from external sources — basically, any non-Google ad platform — and integrate that information into your GA4 property. This helps you fill in the gaps so you can analyze cost metrics like:
- Ad Spend
- Clicks
- Impressions
- CPC (Cost per Click)
- CPM (Cost per Thousand Impressions)
- CPA (Cost per Acquisition)
- ROAS (Return on Ad Spend)
Once you’ve imported this data, you’ll be able to measure campaign performance across all platforms in one place, instead of jumping between Meta Ads Manager, LinkedIn Campaign Manager, TikTok Business Center, and even ecommerce sites such as Shopify, Magento and Woocommerce.
Why Does Cost Data Import Matter?
We often talk about “data-driven marketing,” but if you’re not seeing the full picture, you’re not really driving with data — you're flying half blind.
Here’s why Cost Data Import is a important for any digital marketing efforts:
Comprehensive Campaign Performance
GA4 lets you track user behavior and conversions across your site or app. But without cost data from all your paid sources, you can't properly assess how efficient those campaigns are. Importing cost data allows you to analyze efficiency metrics like Return on Ad Spend (ROAS) and CPA across all platforms.
Smarter Budget Allocation
When you can see cost, clicks, and conversions side by side — regardless of the source — you can more confidently shift budget toward campaigns or platforms that are actually driving results, not just traffic.
More Accurate Dashboards
Whether you're using GA4’s Explorations or Looker Studio dashboards, importing cost data helps you build accurate, comprehensive performance reports that don’t just show what users are doing, but how much it cost you to get them there.
What Kind of Data Can You Import? 2025 Update
Google has simplified the cost data import process in GA4 by reducing the required fields to just three: Source, Medium, and Date. This update makes it easier to get started, especially for marketers who want to quickly track ad spend across non-Google platforms.
While Campaign Name and Campaign ID are now optional, including them enables more detailed and granular reporting. Without these fields, GA4 will report cost data in aggregate, which may limit your insights.
Bottom line: The update lowers the barrier for basic cost tracking, but for more in-depth performance analysis, it's still recommended to include campaign-level details when possible.
So to match up with user behavior data already collected in GA4, your cost data import should follow a specific format and contain key fields like:

Note: Your file must be saved as a CSV and formatted precisely, or GA4 will reject the upload.
How Does GA4 Match Imported Cost Data with User Activity?
This is important: GA4 uses source, medium, campaign name, and date to align the imported data with actual user sessions.
So, if your campaign is tagged like this:
https://yourwebsite.com/?utm_source=facebook&utm_medium=paid_social&utm_campaign=spring_sale
Then your cost data row for that campaign must use:
- source: facebook
- medium: paid_social
- campaign_name: FB_bfcm2025
Consistency is everything. If your UTM parameters and cost data don’t match exactly, GA4 won’t be able to stitch the sessions with cost data — and your reports will be incomplete or misleading.
Step-by-Step: How to Import Cost Data into GA4
Let’s break this down into four simple steps:
Step 1: Export Your Ad Platform Data
Start by downloading the data from your advertising platform (e.g., Meta Ads Manager). Export fields like Date, Campaign Name, Spend, Clicks, and Impressions.
Step 2: Format the CSV File
Open the exported file in Excel or Google Sheets and clean it up to match GA4’s expected format - here’s a sample template.
Save as .csv — no extra columns or formatting.
Step 3: Set Up and Upload Your Data Set in GA4
1. In your GA4 property, go to Admin > Data Import

2. Click Create Data Source

3. Choose Cost Data as the import type
4. Name your data set (e.g., “Analytics Mates Meta Ads Spend”)

5. Choose Manual CSV upload → click Next
6. Select the relevant fields (dimensions and metrics) that match your file

7. Once everything is set up, click Import
8. Wait for the status to update — success or failure messages will appear

Important Notes:
- Once your cost data is uploaded, it may take up to 24 hours for the information to appear in your GA4 reports, audiences, and explorations.
- If something’s wrong, GA4 will let you know what’s off (e.g., missing columns, formatting issues).
Where to View Cost Data in GA4
Once uploaded, you won’t see the cost data in the standard reports. Instead, access it via:
Explorations (in GA4):
Be sure to select dimensions related to your traffic sources — such as Session Source/Medium. You can also include additional dimensions like Session Campaign for more detailed analysis.
For the metrics, make sure to include data from all non-Google sources.

Advertising Report (GA4)
1. Navigate to the Advertising Report

2. Then, click on All Channels.

You should now see data related to the ad.
Looker Studio
Use Looker Studio to build blended reports showing cost, revenue, CPC, CPA, and ROAS by campaign or platform — all in one beautiful view.
Cost Data Import for Shopify, Magento & WooCommerce
If your ecommerce site runs on Shopify, Magento, or WooCommerce, you might already be using marketing apps, plugins, or APIs that collect ad performance data across platforms like Meta, TikTok, Pinterest, and more. The good news? You can absolutely take that data and feed it into GA4 to get a unified view of your costs and performance.
Here’s how to approach cost data import based on the platform you're using:
Shopify
Shopify merchants often use apps like Triple Whale, Northbeam, Lifetimely, or even native Meta/TikTok integrations. These tools can export daily spend by campaign, including useful fields like clicks and impressions.
To import cost data into GA4:
- Export your ad cost data from the app or your ad platform (Meta, TikTok, etc.)
- Ensure the data includes fields like date, source, medium, and (ideally) campaign_name
- Format your CSV following GA4’s structure (see template above)
- Upload the file to GA4 via Admin > Data Import
Tip: Some apps like Triple Whale allow for automated cost data exports. Consider setting up scheduled exports that you can clean and upload weekly or monthly to GA4.
WooCommerce
With WooCommerce, many users rely on plugins like PixelYourSite, Metorik, or AdTribes’ Product Feed PRO to manage and track marketing data. While these tools focus on feed optimization or analytics, your ad platforms (e.g., Meta, TikTok) still remain the best place to pull raw cost data.
To prepare WooCommerce cost data:
- Export spend reports from each ad platform (e.g., Facebook Ads Manager)
- Align your campaign UTM tags with GA4: your WooCommerce store must use consistent UTM parameters across campaigns
- Clean and format the CSV before importing it into GA4
Pro Tip: Use Google Sheets to clean your export data, then download it as a .CSV to keep formatting clean for GA4.
Magento
Magento stores often have more complex setups, but the same principles apply. Whether you're using Adobe Commerce, Mirasvit Advanced Reports, or custom APIs, your ad platform data still needs to be manually (or programmatically) exported, cleaned, and imported into GA4.
Steps for Magento:
- Export ad data from your campaign platforms (again, look for Date, Campaign Name, Cost, Clicks, etc.)
- If using a data warehouse or BI tool, build a daily export job in the correct format
- Make sure UTM parameters in your Magento URLs match the cost data rows exactly
- Upload via GA4’s Cost Data Import
Developer-friendly option: Magento users with in-house dev teams may want to automate cost data export and transformation using tools like BigQuery or Zapier before sending it to GA4.
No matter what ecommerce platform you use, the core idea is the same: pull your ad spend data from each channel, align it with GA4’s format and UTM structure, and import it regularly.
Doing this will give you a far more complete view of how your marketing budget is driving revenue—whether your customers are coming from Facebook, a Google Shopping ad, or a TikTok campaign.
Common Pitfalls to Avoid
- Mismatched UTMs – Your cost data must match your campaign URLs exactly. Even small typos break the link.
- Incorrect Date Format – GA4 expects YYYY-MM-DD only.
- Empty Required Fields – GA4 will reject missing cost, source, or medium fields.
- Delayed Uploads – Uploading data weeks later means you'll miss valuable insights when it matters most.
Frequently Asked Questions
1. Can I automate cost data import into GA4, or does it have to be manual?
Yes, you can automate it, but it requires using the GA4 Data Import API or third-party tools like Zapier, Stitch, or a custom ETL script with BigQuery. Most eCommerce platforms with dev support opt for automation to keep reports current without manual uploads.
2. Does imported cost data retroactively apply to past sessions in GA4?
Yes—but only within the data retention window and if the imported data exactly matches historical session dimensions (source, medium, campaign, date). Retroactive analysis works best if your campaign tagging has been consistent.
3. Is there a limit to how much cost data I can import into GA4?
Yes. While Google hasn’t published strict limits, large files (especially over 10MB or 1M rows) can be slow to upload or process. For high-volume accounts, consider breaking up imports by week or using automation.
4. Can I import cost data into a GA4 subproperty or roll-up property?
Currently, cost data import is only available for standard GA4 properties. Subproperties and roll-up properties don’t support manual cost data import, so consider alternative reporting tools like Looker Studio with blended data sources.
5. What happens if I import cost data with duplicate rows?
GA4 will treat each row as a separate record, which can inflate metrics like total cost or clicks. Always clean your CSV and remove duplicates before upload to avoid overreporting.
6. Can I edit or delete cost data after uploading it into GA4?
No. Once data is uploaded, it cannot be edited or deleted via the GA4 UI. To “overwrite,” you must reupload a corrected file for the same source/medium/date combination — it will replace the previous values.
7. What timezone should I use when formatting the date field?
Use the same timezone as your GA4 property settings. If there’s a mismatch, your cost data may appear offset from your user behavior data, leading to inaccurate attribution or reporting.
8. Can I include custom dimensions or metrics in my cost data import?
No — only predefined fields (like source, medium, campaign_name, cost, etc.) are supported in GA4’s cost import schema. For custom dimensions, consider using BigQuery exports or Looker Studio blending for more flexibility.
9. How often should I import cost data to keep reports accurate?
At minimum, aim for weekly uploads. If you’re running high-volume campaigns or managing multiple platforms, a daily or automated import cadence will give you the most up-to-date and actionable reporting.
10. Will imported cost data show up in attribution modeling or conversion paths in GA4?
Not directly. Imported cost data affects metrics like ROAS and CPC, but doesn’t influence GA4’s built-in attribution models. For full attribution analysis with cost inputs, you'll need to use Looker Studio or BigQuery.
Final Thoughts: Why It’s Worth Doing
At first glance, importing cost data into GA4 might seem technical or time-consuming—especially if you're juggling multiple platforms and data sources. But the reality is, the payoff is well worth it.
If you have budgets spread across platforms like Facebook, TikTok, and LinkedIn, relying on Google Ads data alone leaves major gaps. By unifying your ad spend and revenue data in GA4, you gain a clear, complete view of what’s driving results. You’ll eliminate guesswork, unlock meaningful insights, and make smarter, faster decisions about where to invest. It takes a bit of setup—but the clarity and confidence it brings to your reporting is well worth the effort.
Thank you for reading!
We're always looking for ways to improve our Google Analytics 4 blog content. Please share your feedback so we can make it even better.