Why would you want to import data into Google Analytics 4? We all know that GA4 collects behavior data regardless of the traffic channel that brings visitors to your website. But these traffic channels often cost you money, and if they are not Google advertising, it's not possible to see what you spent to bring that traffic i.e. you can not calculate the profitability of a particular channel.
To solve this, GA4 introduced a convenient way to manually import cost data, allowing you to assign a monetary value to a particular traffic channel. This feature enables better Return on Ad Spend (ROAS) calculations and cross-platform performance comparisons.
In this guide we’ll walk through a step-by-step process of importing cost data into GA4, troubleshoot common issues, and explore how this data enhances your reporting.
GA4’s cost data import allows you to upload costs incurred on platforms that don’t have a native integration with GA4, such as Facebook Ads, ShopApp Ads, TikTok Ads or any other channel. In this example we’ll focus on importing the cost of Tapcart App, so we can analyze the profitability of that channel.
Note that Littledata GA4 integration allows you to properly attribute revenue in GA4 to an external Shopify App (such as Tapcart). You can import cost data for a good ol' Facebook campaign as well, applying the method that will be described in the following text.
In the Google Analytics official data import help article you can find an example csv file - a template for data import.
Here's how the template looks:
You can notice that column names define information that can be imported. To measure the performance of your external marketing spend, GA4 allows you to import the following key metrics:
Please note that out of the three metrics, at least one is obligatory - here's the screenshot from the GA4 import process:
Once the data is imported, it gets matched with behavior metrics as well as conversions and revenue inside GA4 to help marketers evaluate campaign effectiveness and calculate ROAS across all traffic sources. The import works retroactively meaning that you can enrich any existing traffic in GA4 with monetary value.
Before uploading cost data, you need to format your CSV file properly to match GA4’s schema.
The fields in the example csv provided by Google are:
Campaign ID Campaign name Source Medium Date (YYYY-MM-DD format) Impressions Clicks Cost
NB: Campaign ID and Campaign Name are no longer required fields (as of early 2025).
Now that you’ve prepared your data, let’s create a cost data import source inside GA4. Go to Admin → Data Import
Click Create Data Source, select the cost data CSV file, name your source and click Next
In the next step you get to map the fields, and once you’re done click Import
💡 Error: "Invalid Date Detected" ✔️ Solution: Go back to your CSV and ensure the date format is YYYY-MM-DD. Reformat if needed and re-upload.
💡 Error: "Missing Required Field" ✔️ Solution: Ensure all column headers are correctly spelled and included in the CSV. Even if you don’t have clicks/impressions, keep the column headers.
💡 Error: "Duplicate Data Detected" ✔️ Solution: Make sure you don’t upload the same data twice for the same date range.
💡 Error: "File Formatting Issue" ✔️ Solution: Save the file as a CSV UTF-8 (comma-separated values) format.
Once the import is successful, you can immediately view the cost data in GA4’s reports and combine it with purchase data. Create a New Exploration and add Session source/medium dimension and all the Non Google ads metrics from the following screenshot:
Analyze return and cost per acquisition for external sources - in this example, an e-commerce store is driving revenue from an external Shopify app called Tapcart at a superb ROAS:
In GA4, we see the high performing Tapcart channel:
By importing ad cost data, GA4 now calculates ROAS (Revenue / Ad Spend) directly in reports, allowing better budget allocation and performance evaluation for non-Google ad platforms.
Once you start importing cost data into GA4, you'll gain a full picture of your marketing spend and efficiency, especially for non-Google ad platforms like Facebook, TikTok, and LinkedIn. This process helps you:
Start importing your ad cost data today and get better insights into your marketing performance! Happy analyzing! 🎯