If you run ads on Facebook and use Google Analytics 4 as your primary analytics solution to analyse the website data, you can find it beneficial to have your ads data (clicks, impressions, costs) and user behaviour metrics in one report.

Google Analytics 4 has a wonderful feature – Data Import – which can help you to achieve it. 

Below are instructions on how to successfully import Meta (or Facebook) ad cost data into Google Analytics 4. This article also includes what you must prepare to allow GA4 to match Facebook data with GA4 data. 

Organise your Facebook ads data to import it into GA4

As mentioned above, the first step you should take is to set up UTM parameters on the Facebook ads manager site right. 

Google Analytics 4 requires you to include the following parameters in UTM parameters. If you don’t have any of them, Google Analytics 4 won’t be able to merge the data. 

ParameterUTM ParameterRule
Campaign IDutm_idRequired
Campaign Sourceutm_sourceRequired
Campaign Mediumutm_mediumRequired
Campaign Nameutm_campaignRequired

Therefore, I recommend you to use Google UTM Builder, or you can use the same structure as my example below:

?utm_source=fb&utm_medium=cpc&utm_campaign=spring_sale&utm_id=13414135

Fortunately, Facebook allows you to use dynamic variables to set up all these parameters. So to set up UTM parameters to the ad level, go to Facebook Ads Manager and add this. 

utm_source={{site_source_name}}&utm_medium=cpc&utm_campaign={{campaign.name}}&utm_content={{ad.name}}&utm_id={{campaign.id}}
Setting up UTM parameters in Facebook Ads Manager
Setting up UTM parameters in Facebook Ads Manager

Once you make all the changes above, you should wait a few days so that Google Analytics 4 can collect the new data. After that, you can move to the next step. 

How to import Facebook Ads Data into Google Analytics 4

So GA4 collected the fresh new data, and it’s time to a) export Facebook cost data and b) import it into Google Analytics 4. Let’s start with the first step. 

How to export Facebook Ads cost data

Facebook Report includes Cost Ads Data
Preparing Facebook Cost Ads Data into Facebook Reporting Interface

To export cost data, you should use Facebook Ads Manager.

  1. In Ads Manager, click “Ads Reporting” icon.
  2. Click on the “Create Report” button and include the following dimensions and metrics:
    1. Day
    2. Campaign ID
    3. Campaign Name
    4. Platform
    5. Impressions
    6. Clicks (all)
    7. Amount Spent
  3. Save the report and Export it as CSV

How to import Facebook Ads cost data into GA4

So, now we have ad cost data in a CSV file, and you need to organise it before uploading it into GA4. You can use Microsoft Excel or Google Sheets for this. I will use Google Sheets. 

Upload the file to Google Sheets and organise it to get the structure in the screenshot below. You can also download my template.

Remember a few things:

  1. You should add medium for all data: “cpc”
  2. You should add source for all data: “fb” for facebook or “ig” for instagram. I used “facebook“ because I have manual UTM parameters (not dynamic ones).
Facebook Ads Cost Import in GA4 Template
Facebook Ads Cost Import in GA4 | Template

After you provide the necessary changes, save the file and download it. Now is the time to import it into Google Analytics 4. 

  1. Open GA4 and go to Admin and click on “Data Import”
  2. Create a new data source and select the following settings:
    1. Data source name – “facebook_cost_data”
    2. Data type – cost data
    3. Import source – Manual CSV upload
  3. Click on button “Upload CSV” and select CSV file you prepared early and click “Next”
  4. Map CSV file columns with GA4 parameters
  5. Click on “Import” to upload your Fb cost data into GA4
Step 3 Succesfully uploaded data
Successfully uploaded facebook ads data

It’s up to you to decide how frequently you want to upload CSV files in GA4; you can do it daily, weekly or monthly. If you want to update it daily or even more frequently, I recommend you look at SFTP data import in Google Analytics. You can also contact me if you need someone to set it up. 

Where to find imported Meta Ads Data in GA4?

If you make everything right, your data is in Google Analytics 4. The next step is to find this data. 

There are two reports where GA4 shows ads cost imported data:

No-Google Ads Cost in Google Analytics 4
No-Google Ads Report with imported Facebook Ads data in Google Analytics 4

In order to see your data in Google Analytics 4 Explore, you should import the following dimensions:

  • Session campaign ID
  • Session campaign name
  • Session source/medium
  • Non-Google impressions
  • Non-Google clicks
  • Non-Google costs
  • Non-Google cost per click
  • Non-Google cost per conversion

In terms of metrics, you can import revenue, total users, new users and many others. 

Facebook Ads Cost Data in GA4 Explore
Facebook Ads Cost Data in GA4 Explore

Why does GA4 not show imported Facebook Ads data?

Sometimes you can encounter that Google Analytics 4 doesn’t upload your data or it’s not showing it. Based on my experience, I collected the most common scenarios:

  1. Check the CSV file with Facebook Ads cost data and see if you used the same campaign id, campaign name, source and medium parameters that you use in Facebook Ads. If one of them is missed or doesn’t match, it’s the issue.
  2. Google Analytics 4 won’t upload the file if it has “null” values. Therefore, always use “0” instead. For instance, if your campaign didn’t generate any clicks, write 0 instead of leaving it empty.

Conclusions

Facebook (Meta) ad cost data can be imported in Google Analytics 4 manually using a CSV file or automatically using SFTP. The latest one requires some engineering resources to set it up. This article covered every step of how to import your data using CSV that, includes the following steps:

Time needed: 30 minutes

  1. Set up UTM parameters for Facebook Ads in Facebook Ads Manager

  2. Export Facebook Ads Cost data using Facebook Ads Reporting Interface 

  3. Organise Facebook Ads cost data according to GA4 practices using Google Sheets

  4. Go to GA4 Admin Data Import page 

  5. Create a new data source and select the following settings:

    1. Data source name – “facebook_cost_data”
    2. Data type – cost data
    3. Import source – Manual CSV upload

  6. Click on button “Upload CSV” and select CSV file you prepared early and click “Next”

  7. Map CSV file columns with GA4 parameters

  8. Click on “Import” to upload your Fb cost data into GA4

If you have any questions, feel free to leave a comment below. 


Frequently Asked Questions


How to import Facebook (Meta) Ads Cost Data into GA4?

You should take the following steps In order to import Facebook Ads data into GA4 using CSV:
1. Set up UTM parameters for Facebook Ads in Facebook Ads Manager
2. Export Facebook Ads Cost data using Facebook Ads Reporting Interface 
3. Organise Facebook Ads cost data according to GA4 practices using Google Sheets
4. Go to GA4 Admin Data Import page 
5. Create a new data source and select the following settings:
5.1. Data source name – “facebook_cost_data”
5.2. Data type – cost data
5.3. Import source – Manual CSV upload
5.4. Click on button “Upload CSV” and select CSV file you prepared early and click “Next”
5.5. Map CSV file columns with GA4 parameters
5.6 Click on “Import” to upload your Fb cost data into GA4


Why does GA4 not show imported Meta Ads data?

Though there are multiple reasons why it can happen, you can look at mapping in GA4 and whether your Meta Ads data include campaign id, campaign name, source and medium parameters. If any of this data is not presented in your file or UTM parameters, GA4 cannot merge two data sources.

Written By

Ihar Vakulski

With over 8 years of experience working with SaaS, iGaming, and eCommerce companies, Ihar shares expert insights on building and scaling businesses for sustainable growth and success.

KEEP LEARNING

6 Replies to “How to import Meta (Facebook) Ads Cost Data into Google Analytics 4”

  1. I followed your steps above but whenever I upload the csv file, I get Unknown status. Do you know why?

        1. You can find info in “Account Change History”. Please let me know the date.

          I’ve checked the file you sent on my test GA4 property and I also tested my Bing Ads and FB Ads cost data.
          I found that .CSV import doesn’t work while SFTP import works successfully at this moment. Perhaps it’s the issue on Google’s side with the storage they used for CSV files.

          I recommend reporting it to them.

          Thank you for the message.

Leave a comment

Your email address will not be published. Required fields are marked *

Leave a Comment

Your email address will not be published. Required fields are marked *

[custom_comment_form]