Connect Data from Facebook Ads to Google Docs

This simple and quick guide gives you easy instructions on how you can extract your data from Facebook Ads and then analyze it in Google Docs.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Facebook is the world's most popular social network, equipped with a powerful advertising network where billions of dollars are spent each year. Marketers love using Facebook Ads ads to reach their target audience at scale.

Google Sheets is an excellent, fully featured web spreadsheet application. It helps businesses create, collaborate on and share spreadsheets on the web and mobile devices. Your business can use Google Sheets for maintaining data consistency across various departments in your company and ensuring that every member of your team is on the same page.

Google Sheets is available to your business as a web application and is accessible through Google Chrome, Firefox, Microsoft Edge, Internet Explorer 11, and Safari.

Extracting data

Before loading your data into Google Docs, you will have to prep it first. If you don't already have a data structure in which to store the data you retrieve, you'll have to create a schema for your data tables. Then, for each value in the response, you'll need to identify a predefined datatype (INTEGER, DATETIME, etc.) and build a table that can receive them.

Facebook Ads's documentation should tell you what fields are provided by each endpoint, along with their corresponding datatypes. Complicating things is the fact that the records retrieved from the source may not always be "flat" – some of the objects may actually be lists. In these cases you'll likely have to create additional tables to capture the unpredictable cardinality in each record.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Preparing data

You have three options for extracting data from Facebook:

  1. You can retrieve data programmatically through the Facebook Ads Insights API. It is available to all users who use the platform. Follow the API documentation, and you will enjoy access to endpoints, like impressions, CTRs, and CPC. You can access the API through the SDKs which Facebook offers. Officially, the platforms support SDKs for PHP and Python, while there’re also a number of SDKs (community supported) for languages such as R, Ruby, and JavaScript. Data will be returned in either CSV or XLS format, and when your report is ready based on the request you may access it from a URL.  
  2. You can export a report that you have created and saved. All you have to do is navigate to Ads reporting from the Facebook Ads Manager navigation and click on the report and then click Export.
  3. You can use a tool like Improvado. By leveraging Improvado, you can easily and quickly integrate, connect, and see all your Facebook Ads Insights data flow seamlessly into your desired visualization tool or database. Improvado does not require any technical skills to operate. You can sync your data over with just a few clicks.

Loading data

Google Sheets is an online spreadsheet that you can use to share data, but what in case your data currently is on another app or in a different file format, such as TXT or CSV? Don’t worry as we have you covered. Here's how you can import your data into Google Sheets.

If there is a file on your system that you would like to add to a new spreadsheet in Google Sheets, you could do it easily.                                                                                                                                                                  

Keep in mind that Google Sheets can import many different file types, such as:

  • Microsoft Excel (.xls,  .xlxm, xlsx, .xltx, .xltm)
  • Text files (.txt)
  • MapInfo (.tab)

On your computer or tablet, open a spreadsheet in Google Sheets. Create or open a sheet. Go to the File tab at the top and click Import.

You can choose a file (non-password protected) in one of the following file types:  

  • .xls  
  • Xlsm
  • xlsx
  • .xlt

Now choose an import option out of six available options. Keep in mind that not all types of files have all the options.

  1. Create a new spreadsheet: This option allows you to create a spreadsheet from your imported data contained in your new browser tab.
  2. Insert a new sheet:  This option allows you to add new sheets along with the imported data to the existing spreadsheet.
  3. Replace the current sheet: This option allows you to replace the content of the current sheet with the imported data.
  4. Replace a spreadsheet: This option allows you to replace the open spreadsheet with all the data in the imported file.
  5. Append rows to a current sheet: This option allows you to add the imported data to your current sheet after the last row using any data.
  6. Replace data starting at a selected cell:  This option allows you to replace the data contained in a range of selected cells with your imported data.

An optional technique: In case you import a plain text file, such as .txt or .csv, under "Separator character," you have the option to pick what symbol or letter Google Sheets uses for separating cells.

Detect automatically: This option will automatically find some ways to split your data set.

Custom:  You can choose a custom character in order to split your  data.

Now click Import

Keeping data up to date

If you've made it this far, congrats! You probably have written a program or script to extract your data and move it into Google Sheets.

Now it's time to think about how you will keep this data up-to-date by loading updated or new data. Of course, you can just replicate all your data every time you have updated your records, but that would be extremely manual and time-consuming.

Luckily there is a better way. The key is building your script so that it can sense incremental updates made to the data.

Thankfully, Facebook’s API results include fields like "date" so that you can identify those records which are new since the last update you made (or since the most recent record you have copied). Once you have taken new data into consideration, you can easily set your script either as a continuous loop or cron job to pull down new data as soon as it appears.

The Easiest And Fastest Way To Do It

If all this sounds a bit overwhelming, don't worry -- there is an easier way to get this done!

Thankfully, products like Improvado were developed to move data from Facebook to Google Sheets automatically. Using Improvado, you can easily combine the most crucial and relevant data from your social media ad campaign into a dashboard. You can then connect this data to Google Sheets.