> AI agents: this is one page from Mammoth Analytics documentation. The index of all pages as Markdown is https://docs.mammoth.io/llms.txt. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get Markdown.

# Facebook Ads Manager

> Connect Mammoth to Facebook Ads Manager with OAuth, query your ad account tables with SQL, and save the results as a dataset.

The Facebook Ads connector imports advertising data from your Facebook Ads Manager account into Mammoth as a dataset. Authenticate with OAuth—no API keys required.

## Before you start

You need:

- A Facebook account with access to the **Ads Manager** ad accounts you want to import data from

## Step 1: Select the Facebook ads connector

1. In Mammoth, go to **Data Library** and click **+ New Dataset**
2. Select **Connectors**
3. Search for **Facebook**
4. Click the **Facebook Ads Manager** tile

## Step 2: Authenticate with Facebook

Click **New Connection** to start the OAuth flow.

Mammoth sends you to Facebook's authorization page in the same browser tab. Sign in with your Facebook account and authorize Mammoth. You're redirected back to Mammoth automatically.

## Step 3: Select Facebook Ads data and query

Select the connection under **Existing Connections** to open the query builder. The **List of tables** panel shows the tables this connector exposes. Click a table to load a `SELECT *` query for it and its preview.

### Write a custom Facebook Ads query

Edit the SQL in the **Enter SQL query** editor and click **Run**. Use the table and column names shown in the table list and the preview.

See [Understanding data preview & query](https://docs.mammoth.io/learn/connectors/understanding-data-preview-query/) for a full guide.

## Step 4: Save the Facebook Ads dataset

1. Enter a **dataset name** in the **Save table as** field (e.g., *"Facebook Ads Campaign Performance"*)
2. Check the **Update Method** (the default is **Replace all data**). To change it, click the edit icon, pick an option, and click **Save changes**:
   - **Replace all data**—Replaces all existing data
   - **Add new data**—Adds new data based on a unique sequential column
   - **Replace with new data**—Replaces existing data with new data based on a unique sequential column
   For **Add new data** and **Replace with new data**, also choose a **Key column**—a numeric or date column with incrementing values, such as an ID or a date.
3. Click **Save as dataset**. When the dataset is saved, click **Done**

## Troubleshoot Facebook Ads connections

### Authorization fails

- Mammoth sends you to Facebook in the same browser tab and returns you to Mammoth afterwards. If you close the tab or deny access, start the connection again
- Make sure you're authorizing with the Facebook account that has access to the ad accounts you need

### No ad accounts visible

- Confirm the authorized Facebook account has access to the ad account in Ads Manager

---
Source: https://docs.mammoth.io/learn/connectors/facebook-ads-manager.md · Updated: 2026-10-13