All resources

A Comprehensive Guide on How to Upload Facebook Ads to BigQuery

With over 2.6 billion monthly active users, Facebook is the world’s most widely used social network. It has become an essential promotional channel for businesses running ad campaigns. Over 7 million advertisers use the platform to promote their products and services. Facebook also owns Instagram, WhatsApp, and Messenger, the three largest social media platforms globally.

i-radius

Connecting a Facebook Ads Account is crucial for extracting and analyzing data in BigQuery to send data seamlessly. Before starting the integration process, users need to sign in to both their Facebook Ads and Google accounts.  This enables businesses to retrieve data through the Graph API and load it into BigQuery for deeper analysis.

Advertisers also prefer Facebook and Instagram due to their cost-effective reach and precise audience targeting, which deliver meaningful insights.

Note:* This post was originally published in August 2019 and was completely updated in June 2025.

Why Extract Data from Facebook Ads?

Extracting data from Facebook Ads enables more in-depth analysis, allowing for the integration of this information into simple spreadsheet tools, such as Excel or Google Sheets.

Transferring Facebook data, whether manually or using OWOX Connectors, enables you to identify trends, assess the effectiveness of various strategies, and determine the most successful approaches for your business to get more customers.

If you prefer working in spreadsheets, OWOX connectors can also collect Facebook Ads data directly into Google Sheets via the OWOX Data Marts (Community Apps Script Edition),  ideal for quick access, lightweight reporting, or marketing team collaboration.

You can easily connect Facebook Ads with reporting and data visualization tools like Tableau, Power BI, or Looker Studio to build detailed, customizable dashboards.

Exporting your Facebook Ads data is also useful when you want to combine it with data from other platforms. This helps you work with larger datasets, link ad performance to on-site behavior and conversions, and include user-level insights. All of that makes it easier to plan budgets and share clear reports with your team or stakeholders.

Bringing data together from Facebook Ads and other marketing platforms gives you a more complete view of your performance and helps you manage your data more effectively. To get started, check out some of the best Looker Studio templates we’ve put together for analyzing ad data.

Social media ads from platforms like Facebook, WhatsApp, Instagram, and Messenger, displaying interactive content and promotional messages.

What Data Does Facebook Collect?

Facebook offers businesses and marketers tools for managing advertising campaigns, including Facebook Ads Manager, Facebook Pixel, and Facebook Analytics. By default, Ads Manager provides information about Facebook ad insights, including coverage, views, clicks, and ad costs.

If you install the Facebook pixel on your website and set up event tracking, you can find out the behavior of users who go from the Google app engine to your website by clicking on an ad. You can track all conversions on any device your ad brings to your website and see how much a desired action costs. Facebook reports show you all leads, registrations, orders, purchases, revenue, etc.

How can you evaluate the effectiveness of the Facebook channel in this case? You won’t know how it interacts with other email marketing apps and sources and how they affect the business, until you consolidate your data. In large companies, marketing is not limited to Facebook ads; sales can be made online, offline, or over the phone.

Therefore, it’s necessary to combine data from your account with the data from your website analytics system (such as Google Analytics 4 or OWOX BI Streaming), under the project name of your choice other advertising services, and your CRM so you can see the whole picture: how much money is spent on advertising, which advertising channels are more effective, and what the financial results are. To ensure successful integration, it is vital to identify and prepare your source data and website analytics before combining them.

Why Collect Facebook Ads Data in Google BigQuery?

By uploading cost data from Facebook Ads to BigQuery, you can associate costs with post data, user activities on the website, calls to the call center, emails, and purchase orders from the CRM system. You can also blend advertising cost data to view your advertising performance comprehensively.

To get started, you must set up a Google Cloud Project to manage datasets and BigQuery Tables. Facebook Ads data transfer and storage happen in BigQuery tables, where you can configure table settings and refresh schedules to ensure your data is always up-to-date.

An ad offering plant care services with a "Contact us" button

Use Cases of Facebook Ads Data in BigQuery

  1. Blend data from multiple sources for a unified view of ad performance. Seamlessly integrate data from Facebook Ads and other platforms to create analytics-ready datasets for improved marketing insights.
  2. Attribute ad costs to sessions from the analytics system for a better understanding of the ads’ efficiency;
  3. Use data from advertising services uploaded to Google BigQuery to build your attribution models for advanced channel-performance analysis.
  4. You can use the data in BigQuery to pass the calculations back to Facebook Ads for automatic bid management.
  5. Also, in Google BigQuery, you can create custom audiences based on combined data and the results of attribution calculations, and then you can automatically send those audiences to advertising services.
  6. Finally, you can use Facebook data collected in BigQuery to build any reports you need without any restrictions in tools like Looker Studio to visualize Ads data better.

Benefits of Using Google BigQuery as a Cloud Storage

Leading cloud platforms, such as Amazon Redshift, Snowflake, Google BigQuery, and Microsoft Azure, share several advantages over traditional data warehouses.

  • You don’t need to maintain servers and connect new ones when the load grows. Cloud storage scales automatically.
  • Cloud platforms are faster than traditional storage and automatically redistribute the load.
  • You don’t need to install a server on your computer to get into cloud storage. Just open your browser and log in to the cloud.

We’ve chosen Google BigQuery and recommend it for the following reasons:

  • Google is the leader in the number of native data sources for marketers: Ads, Analytics, Search Console, and YouTube. All these services seamlessly integrate with BigQuery, and BigQuery also enables seamless integration with Facebook Ads for effortless data syncing and analysis.
  • It processes large amounts of data fast.
  • It’s easy to get started with BigQuery without the help of database administrators. Just create a Google Cloud account.
  • You only pay for what you process and store.
  • Ready-made templates are available to prepare data for reporting in Google BigQuery without requiring coding or a developer.

Setting Up Facebook Ads Prerequisites

Before we load Facebook Ads data into BigQuery, make sure your Facebook Ads account and API access are appropriately configured for secure data extraction.

  • Create or log in to your Facebook Ads account to serve as the data source.
  • Generate an access token via Meta for Developers with the correct API permissions (e.g., ads_read, read_insights).
  • Set up and authorize the Facebook Marketing API to enable data access.
  • Confirm your account has the necessary business verification and app permissions.
  • Ensure the token is securely stored and ready for use in your connector or script.

This setup ensures a smooth and secure connection between Facebook Ads and BigQuery, allowing you to load Facebook Ads data without disruption.

Understanding the Methods to Connect Facebook Ads to BigQuery

There are a few ways you can load data from the Facebook Ads Manager:

  1. Native Google BigQuery tool - Data Transfer;
  2. Uploading data manually using CSV files;
  3. Writing your custom scripts;
  4. Using various third-party party-tools;
  5. Automatically uploading data using OWOX Data Marts (Community Apps Script Edition). Manual data transfer can be time-consuming and prone to errors, making automated solutions more appealing for larger datasets.

Let’s take a closer look at each of these options for how to integrate and send Facebook Ads to BigQuery.

 1. Native BigQuery Data Transfer

Google BigQuery interface showing the Data Transfer Service section. i-shadow

The BigQuery Data Transfer Service (DTS) simplifies the integration of Facebook Ads data by enabling automated, scheduled transfers directly into BigQuery, no coding required. Using the console, the bq CLI, or the DTS API, you can configure data sources like Facebook Ads, Google Analytics 4, Google Ads, and more. To create a transfer, you need to select Facebook Ads as the source in the Data Source Details section. 

You must specify the start date and set time for the data transfer job. After configuring these options, click Save to activate the transfer. Once set up, DTS runs transfers on a recurring schedule and supports backfills to fill gaps in historical data. Be sure to monitor each transfer run to ensure successful data imports.

DTS operates within your dataset’s region, ensuring data processing and storage comply with the location settings. Beyond data ingestion, it also supports scheduled query execution. Transfers are monitored through quotas and reservation slots, with pricing aligned to standard BigQuery storage and processing rates.

For businesses seeking a low-maintenance pipeline, DTS offers a reliable, scalable, and managed solution to keep Facebook Ads performance data updated in BigQuery without scripting.

Configuring Google BigQuery for the BigQuery Data Transfer

Once your Facebook Ads API access is ready, configure BigQuery to store and manage your incoming ad data effectively.

  • Log in to Google Cloud Console and open BigQuery
  • Create a new project or select an existing one for storing data
  • Go to BigQuery and click “Create dataset” to set up a dedicated data destination
  • Open the Data transfers section and click “Create transfer”
  • Select Facebook Ads as the source and configure settings such as schedule, data range, and target table

By carefully configuring your BigQuery account, dataset, and data transfer settings, you ensure that your Facebook data is loaded efficiently and accurately, ready for analysis and reporting within your Google BigQuery environment.

Limitation to note: The service does not support real-time or intra-day data syncing for Facebook Ads.

2. Import data manually with CSV files

A report export dialog showing the option to download a report in CSV format, with a selection for export options.

You can download cost data from the Facebook data, transfer its advertising profile into separate files, and manually upload them through the BigQuery interface. Building a data warehouse for Facebook Ads reports without requiring significant engineering resources or a substantial software budget is feasible.

Digital advertisers can utilize Google BigQuery, which allows the direct import of data from CSV files. This feature enables advertisers who download Facebook Ads to BigQuery as their data warehouse. 

Manually transferring Facebook Ads data to BigQuery involves exporting the data to a CSV file or Excel workbook and then uploading it to BigQuery. If your Ads data is provided as an XML file, you must convert it to a compatible format like CSV or JSON before importing it into BigQuery.

This manual approach is cost-effective. While uploading Facebook Ads to BigQuery is free, costs may arise if the Google-set thresholds for data querying and storage are exceeded. Regularly updating Facebook Ads data, especially on a daily basis and across various report types, can become challenging.

More importantly, digital advertisers must ensure their uploaded reports maintain a consistent data schema, including metrics, headings, and formats. Field lengths and types in Facebook Ads should be consistent with BigQuery’s requirements. Inconsistencies in these areas could quickly diminish the value of the data warehouse by a data validation system, leading to incomplete or incorrect data. Additionally, duplicates and null values in the data should be addressed to improve quality in BigQuery.

The disadvantages of this method of loading data are apparent: a lot of inefficient work and no automation.

3. Writing Custom Scripts to Move Data from Facebook Ads to BigQuery

This involves automating the migration of data from Facebook Ads to Google BigQuery, which is done in three primary steps: Writing your custom scripts; you may need to write custom code to automate the extraction, transformation, and loading of Facebook Ads data into BigQuery.

Step 1: Extracting Data from Facebook

This step involves gathering relevant Facebook Ads data, which can be utilized for various business purposes. There are two primary methods to extract this data:

  • Using APIs: Facebook’s APIs can be accessed through its SDKs, which support languages such as Python, PHP, JavaScript, R, and Ruby. The Facebook Marketing API, a RESTful API, enables users to make specific requests to endpoints, including the Graph API for ad and statistics data, as well as Facebook Insights for detailed ad statistics.
  • Through webhook notifications: Subscribe to Facebook’s webhooks (formerly Realtime Updates API) for lead ads and ads insights. These push updates to your endpoint immediately when events occur, enabling an almost real-time pipeline into your system, with no need for constant polling.

Step 2: Preparing Your Data from Facebook Ads to BigQuery

Before loading your Facebook Ads data into BigQuery, it’s important to ensure it’s in a compatible format. Facebook APIs return data in JSON, which is natively supported by BigQuery. However, the data may need to be normalized and flattened, especially when nested structures or arrays are involved.

Additionally, you should align your data types with BigQuery’s schema requirements. BigQuery supports the following data types:

  • FLOAT
  • RECORD
  • TIMESTAMP
  • INTEGER
  • STRING

This preparation phase is not just about format conversion; it's also about aligning your data from Facebook ads to BigQuery to match its capabilities, facilitating smooth data integration. Proper data preparation avoids compatibility issues during import into BigQuery.

Proper preparation is key to leveraging, which involves connecting and integrating Facebook Ads data with BigQuery, thereby significantly enhancing the insights gained from your Facebook Ads data. This connection enables a more in-depth analysis and understanding of your advertising strategies, thereby maximizing the potential benefits of your data.

Step 3: Importing Data into BigQuery

To load data from Facebook Ads to BigQuery, you can use:

  • Google Cloud Storage
  • Direct POST requests to BigQuery
  • Google Cloud Datastore

You can send data from Facebook Ads or cloud storage directly to BigQuery using supported import methods.

For example, upload data directly from Facebook Ads to BigQuery through the console or via a JSON API using HTTP POST requests. After importing raw data back into Google Cloud Storage, a Load Job is created to import data from the cloud into BigQuery. This method involves specifying data source URLs in POST requests.

Limitations of Custom APIs and Scripts

Creating custom scripts for this data transfer has limitations:

  • Code Maintenance: Self-built code requires constant monitoring and updates, especially when Facebook modifies its API.
  • Data Consistency: A system to ensure data integrity and prevent leakage is necessary. Poor data quality can lead to suboptimal solutions, which can have a significant impact on your business.
  • Real-time Data: For real-time data analysis, additional coding is required.
  • Data Transformation: Transforming data, such as adjusting time zones or currencies, demands extra effort. Estuary Flow enables real-time syncing of data from various sources to destinations.

4. Using Various Third-party Tools

If you’re looking to automate Facebook Ads data transfers to Google BigQuery without coding, several third-party ETL tools offer ready-made integrations: 

  • Improvado: Tailored for enterprise users, Improvado connects Facebook Ads and hundreds of other sources to BigQuery with customizable schemas.
  • Adverity: Offers advanced data integration, transformation, and visualization capabilities, supporting BigQuery as a native destination for Facebook Ads data. RudderStack automates data routing and pipeline management for data integrations.
  • Supermetrics: Offers connectors to move marketing data from Facebook Ads to BigQuery, Google Sheets, or Looker Studio. Known for ease of use and granular control over metrics and dimensions.
  • Funnel.io: Designed for marketers, Funnel lets you blend, map, and export Facebook Ads data to BigQuery and other destinations with prebuilt data models.
  • Windsor.ai: Focuses on multi-touch attribution and omnichannel marketing performance, supporting direct exports from Facebook Ads to BigQuery.

Limitations: While these tools simplify setup, they often come with higher costs, limited access to historical data, and restricted customization compared to full-control solutions like OWOX Connectors or custom scripts.

5. Import Data from Facebook Ads to Google BigQuery with OWOX Connectors

Running Facebook Ads is straightforward, but reporting on them at scale, especially inside BigQuery, can be frustrating. To address this, OWOX developed a free, open-source, no-code tool that grants analysts complete control over their Facebook Ads data flow,  the OWOX Data Marts (Community Apps Script Edition).

Why We Built This Connector

Most Facebook Ads connectors are expensive, limited, or too opaque for data teams to trust. We built this open-source connector to give analysts full ownership and control over their data.

Here’s what makes it different:

  • Cost-free and open-source: No usage fees, no subscriptions, no vendor lock-in.
  • Full API access: Pull every metric, dimension, and breakdown available in the Facebook Ads API.
  • Custom extraction logic: Define exactly how your data is fetched, structured, and loaded.
  • Transparency-first design: View, edit, and extend the entire pipeline using Google Apps Script.
  • Built for ownership: Empower teams to control their workflows – without depending on third-party limitations.

How OWOX Connectors Work

The OWOX connectors, built on OWOX Data Marts (Community Apps Script Edition), run entirely in your Google Sheets environment and handle everything from data extraction to BigQuery upload, without third-party middleware, paid tools, or complex setup.

Here’s what happens under the hood:

  • Google Apps Script-based: The connector runs as a script in Google Sheets, where you configure your parameters (e.g., metrics, breakdowns, filters).
  • Direct API connection: It pulls raw performance data from the Facebook Marketing API using the fields you specify.
  • No CSVs or staging: Data is loaded straight into BigQuery – clean, structured, and analysis-ready.
  • Schedule-ready: You can automate daily or weekly imports by triggering the script on a schedule.
  • Self-hosted and editable: The whole codebase is open-source, so you can inspect, tweak, and extend it as needed.

Benefits of OWOX Connectors

This tool comes with several key benefits. 

  • First, it’s 100% free and open-source, with no usage-based pricing or hidden costs. 
  • Second, it provides a direct data path from Facebook Ads to BigQuery, cutting out third-party dependencies.
  • It also offers complete API coverage so that you can fetch any metric or breakdown available through Meta’s Ads API.
  • Fully customizable schema: Choose exactly which fields to extract and define how your data should be structured in BigQuery, no fixed templates or field limitations.

You can also set up automatic cost import with OWOX BI Connectors from various advertising platforms into Google BigQuery. These open-source connectors let you pull cost data from services like Facebook Ads, Google Ads, and TikTok Ads without relying on proprietary tools.

How to Import Facebook Ads Data to BigQuery with OWOX Connector

With the OWOX Data Marts (Community Apps Script Edition), analysts can import Facebook Ads data into BigQuery using just Google Sheets, no coding, no lock-in, and no external tools. This free connector gives you complete control over which fields you pull, how you send data, and where it lands in your BigQuery project.

Target audience filters for Facebook ad targeting, including options for location, interests, age, and gender.

To simplify the process, OWOX offers a ready-to-use Google Sheets template built on the Community Apps Script Edition.  It handles configuration, field selection, destination setup, and API access. 

You simply need to:

  • Copy the template
  • Fill in your Facebook Ad Account ID(s)
  • Select your desired metrics and breakdowns
  • Send data to your BigQuery destination

The schema is fully customizable, so you can track performance across multiple ad accounts and import only the data that matters most. 

Authorization is handled securely using a token from Meta’s Marketing API. Here’s what you need to do here:

  • Complete business verification through Meta for Developers
  • Generate a token with the required permissions
  • Connected this token directly to the sheet through a simple interface
  • Start importing data instantly without dealing with backend configuration

Once everything is set up, you can trigger the import directly from the spreadsheet. The OWOX Data Marts (Community Apps Script Edition) streams data into your specified BigQuery dataset, ready for analysis in Looker Studio, SQL queries, or advanced attribution models.

After importing, you can use an SQL query in BigQuery to analyze your Facebook Ads data and generate custom reports. You also have access to import logs and control over refresh schedules, making the process both visible and repeatable.

For complete setup instructions and a detailed walkthrough, visit our guide on how to use the OWOX Facebook Ads → BigQuery connector.

The Difference Between Google BigQuery Data Transfer and OWOX Facebook Ads to BigQuery Connector

Google's native BigQuery Data Transfer Service (DTS) for Facebook Ads automatically syncs ad data into BigQuery on a daily schedule. It supports tables for Ads, AdInsights, and AdInsightsActions, with a configurable refresh window of up to 30 days, allowing you to retain historical data instead of overwriting it daily. Data is partitioned by date, and subsequent transfers replace existing partitions instead of accumulating duplicates.

However, DTS has several limitations:

  • Only a fixed set of tables is supported – no custom reports 
  • Lacks support for incremental loads on AdInsights tables; transfers reload complete daily data
  • Has a maximum duration of six hours and enforces a minimum 24-hour interval between runs
  • Requires a long-lived Facebook access token refreshed every 60 days. The long-lived user access token is populated in the transfer configuration after the user authorizes the Facebook account.

How OWOX Connector Compares:

It offers a more flexible alternative:

  • Full API coverage: You control exactly which fields, metrics, and breakdowns are fetched.
  • Unlimited historical data: No restrictions on importing past periods.
  • Flexible schema: Customize the data structure stored in BigQuery.
  • No black boxes: Open-source, editable code – no vendor lock-in.
  • Daily refreshes using Google Apps Script – scheduled directly from a sheet.

Differences Between DTS vs. OWOX Data Marts (Community Apps Script Edition)

Feature BigQuery DTS (Native) OWOX Data Marts (Community Apps Script Edition)
Setup Ease Simple via console Easy via Sheets + Apps Script
Custom Fields & API Access Fixed tables only All fields available
Historical Data Import Only within the refresh window Unlimited
Incremental Updates Not supported Supported via custom schedule
Transparency Closed-source, limited visibility Fully transparent
Cost Included in GCP Free & open-source

While Google’s DTS provides a managed and simple setup, it imposes constraints on flexibility, historical data access, and customization.

In contrast, OWOX Data Marts (Community Apps Script Edition), referred to broadly as OWOX connectors, provide analysts with full ownership of their Facebook Ads data pipeline, offering complete flexibility, unlimited access, and zero vendor dependency.

Key Takeaways

Basic advertising metrics, such as CTR, CPC, CPA, CR, sessions, bounce rate, viewing depth, RPC, and ROAS, can be analyzed using the Facebook Ads interface and standard web analytics tools. This level of insight is generally sufficient for small businesses with limited advertising channels.

However, if your business involves multiple customer touchpoints or offline sales, and you need visibility into the full path to purchase, it's worth investing in advanced analytics. Setting up an auto-updating dashboard with key performance metrics will provide a more complete view of your campaigns.

With this setup, you’ll always have real-time insights, enabling you to thoroughly evaluate advertising effectiveness and make faster, more informed decisions.

FAQ

What are the benefits of using BigQuery for large data sets?
Can I upload data to Facebook and BigQuery without a technical background?
How do I upload data from Facebook to BigQuery?
Is it necessary to format Facebook data before uploading it to BigQuery?
Can I automate the data transfer from Facebook to BigQuery?
Are there any size limitations when uploading data from Facebook to BigQuery?

You might also like

2,000 companies rely on us

Oops! Something went wrong while submitting the form...