# Meta Ads

### Sync overview <a href="#syncoverview" id="syncoverview"></a>

You can choose to configure your Facebook Ads connection in two ways:

* **Sync all accounts** syncs all the accounts you have access to.
* **Sync specific accounts** lets you select the accounts you want to sink.

Selecting **Sync all accounts** automatically adds and syncs any new accounts.

We retrieve the following tables and their related data during every sync:

* *all* `AD_ACCOUNTS`
* `ADS`
* `CAMPAIGNS`
* `AD_SETS`
* `AD_CREATIVES`
* `CUSTOM_CONVERSIONS`
* `REPORT`

A sync may be interrupted due to requesting too much data, missing permissions, or a temporary outage of an external API service. When this happens, we use other methods to fetch the data.

We retrieve most metadata tables from Facebook during every sync.

However, we incrementally sync several tables, see our metadata tables documentation for more information.

#### Rollback sync <a href="#rollbacksync" id="rollbacksync"></a>

A rollback sync is a sync that automatically runs once a day. Rollback syncs capture changes that happen outside of the incremental sync time frame.

The rollback window for custom and pre-built reports depends on the maximum value between the **Click Attribution Window** and **View Attribution Window** settings. By default, we sync data from the last seven days during each sync. We perform a one-day rollback sync if you set the **Click Attribution Window** and **View Attribution Window** to `DAY_1`. We perform a 28-day rollback sync if you set both the **Click Attribution Window** and **View Attribution Window** to `NONE`.

The supported values you can set for the **Click Attribution Window** and **View Attribution Window** are:

* `DAY_1`
* `DAY_2`
* `DAY_7`
* `DAY_28`
* `NONE`

### Sync fallback algorithms <a href="#syncfallbackalgorithms" id="syncfallbackalgorithms"></a>

#### Skipping fields in metadata tables <a href="#skippingfieldsinmetadatatables" id="skippingfieldsinmetadatatables"></a>

Fields that require extra permissions or contain too much data may cause a metadata sync to fail. In such cases, we skip querying those specific fields. We display the following notification about this workaround in your dashboard:

<div align="left"><img src="https://fivetran.com/static-assets-docs/_next/static/media/fb_ads_skipped_field_warning.930302e4.webp" alt="Facebook Ads failed jobs warning" width="563"></div>

### Schema information <a href="#schemainformation" id="schemainformation"></a>

This schema applies to all Facebook Ads connections.

{% embed url="<https://docs.google.com/presentation/d/1asDqJrnanE-QTuUOLhe2WyaxxbfJc1GDDIbKCFJieBQ/edit>" %}

Bid and budget (spend) values are stored at the currency's minimum denomination level. For example, US dollar values are stored as cents. Learn more in [Facebook's Budgets documentation](https://developers.facebook.com/docs/marketing-api/bidding/overview/budgets/).

#### Metadata tables <a href="#metadatatables" id="metadatatables"></a>

The `*_HISTORY` tables contain metadata and capture versions of the objects as they are updated. These tables only contain records from the date of a connection's creation because Facebook does not retain change history for these resources. Use `SORT BY id` and `ORDER BY updated_time` to query the `*_HISTORY` tables when available.

Metadata tables do not contain the full change history of the objects within an account. Almost all selected metadata is retrieved from Facebook during every sync, except the tables listed below.

**Incremental update of metadata tables**

We incrementally update the following metadata tables:

* `CAMPAIGN_HISTORY`
* `AD_SET_HISTORY`
* `AD_HISTORY`

We store the latest `updated_time` for these entities after each sync. During the next sync, we only fetch the entities with an `updated_time` value greater than the cursor value.

This behavior differs from reporting tables. Incrementally updated metadata tables can be re-synced on the **Schema** tab, but the re-sync does not restore the entity's change history, it only saves the latest version.

#### Schema notes <a href="#schemanotes" id="schemanotes"></a>

The `*_HISTORY` tables capture versions of the objects as they are updated. This isn't a perfect record of every change; rather, it captures the delta of changes between syncs. To query them, use `SORT BY id` and `ORDER BY updated_time`.

The `bid_info_*`, `global_*`, and `placement_specific_*` columns in the `AD_HISTORY` table can change their names depending on the source data, which is stored in the KEY-VALUE format. For example, depending on the source data, `bid_info_*` would have `bid_info_KEY` as its name, and `VALUE` as its value. For more information regarding the `global` and `placement_specific` fields, see [Facebook's Adgroup documentation](https://developers.facebook.com/docs/marketing-api/reference/adgroup-review-feedback).

### UTC conversion

We don't convert source timestamps to Universal Time Coordinated (UTC). Instead, we use the Facebook Ads account's time zone to store the data in your destination.<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dinmo.io/integrations/dinmo-ingest/meta-ads.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
