Skip to contentSkip to navigationSkip to topbar
On this page
Looking for more inspiration?Visit the
(information)
You're in the right place! Segment documentation is now part of Twilio Docs. The content you are used to is still here—just in a new home with a refreshed look.

Facebook Ads Source


Source Info
  • The Facebook Ads Source is an Object Cloud source. This means that it sends information (traits) about a thing that exists and persists over time, such as a person or company, and which can be updated over time. Data from this source can only be exported directly to a warehouse, but it can then be used for further analysis. Learn more about cloud sources.

Facebook is one of the most efficient ways to advertise online. Take your company's analysis to the next level by adding Facebook Ads(link takes you to an external page) as a Source to Segment.


Getting Started

getting-started page anchor
  1. From your workspace's /sources page, click add source.

  2. Choose Facebook Ads.

  3. Give the source a nickname. The nickname is a label used in the Segment interface, and Segment creates a related schema name which you query against in your warehouse. The nickname can be whatever you like, but we recommend sticking to something that reflects the source itself, like Facebook Ads or Facebook Ads Prod.

    Screenshot of the Facebook Ads setup flow in the Segment app.
  4. Click Create And Continue then Connect to OAuth into Facebook.

  5. Select which accounts you would like to sync (you may change this selection later).

The second step in the Facebook Ads setup flow in the Segment app.
  1. Click Finish.

Permissions

permissions page anchor

If your Facebook user has read permissions to Facebook Ads account's data, you should be able to use your account for the Source.


Facebook Ads has a sync component, which means we'll make requests to their API on your behalf on a 3 hour interval to pull the latest data into Segment. In the initial sync, we'll grab all the Facebook objects (and their corresponding properties) according to the Collections table below. The objects will be written into a separate schema, corresponding to the source instance's schema name you designated upon creation. For example, if you went with fb_ads, the ads collection will be accessible at fb_ads.ads in SQL.

Our sync component uses an upsert API, so the data in your warehouse loaded using sync will reflect the latest state of the corresponding resource in Facebook Ads. For example, if budget from 0 to 100 between syncs, on its next sync that tickets status will be 100.

The source syncs and warehouse syncs are independent processes. Source runs pull your data into the Segment Hub, and warehouse runs flush that data to your warehouse. Sources will sync with Segment every 3 hours. Depending on your Warehouses plan, we will push the Source data to your warehouse on the interval associated with your billing plan.


Collections are the groupings of resources we pull from your source. In your warehouse, each collection gets its own table.

CollectionTypeDescription
ad_accountsobjectAn ad account is an account used to manage ads on Facebook
ad_setsobjectAn ad set(link takes you to an external page) is a group of ads that share the same daily or lifetime budget, schedule, bid type, bid info, and targeting data
adsobjectAn ad(link takes you to an external page) object contains the data necessary to visually display an ad and associate it with a corresponding ad set.
campaignsobjectA campaign(link takes you to an external page) is a grouping of ad sets which are organized by the same business objective.
insightsobjectInsights(link takes you to an external page) contain performance statistics for an ad broken down by day.

The following tables outline the properties included in collections.

Property NameDescription
idAd Account ID.
balanceBill amount due.
nameName of the account. If the account name is not set, the name of the first admin visible to the user will be returned.
partner_idThe ID of a Facebook Page or Facebook App.
spend_capThe maximum that can be spent by this account after which campaigns will be paused. A value of 0 signifies no spending-cap and setting a new spend cap only applies to spend AFTER the time at which you set it. Value specified in basic unit of the currency, e.g. cents for USD.
Property NameDescription
idAd set ID.
account_idAd Account ID.
campaign_idCampaign ID.
configured_statusThe status set at the ad set level. It can be different from the effective status due to its parent campaign.
daily_budgetThe daily budget of the set defined in your account currency.
effective_statusThe effective status of the ad set, which can be either its own status or caused by its parent campaign.
end_timeEnd time, in UTC UNIX timestamp.
nameName of ad set.
Property NameDescription
idThe ID of this ad.
adset_idID of the ad set that contains the ad.
account_idThe ID of the ad account that this ad belongs to.
bid_amountBid amount for this ad which will be used in auction instead of the ad set bid_amount, if specified.
bid_typeBid type.
campaign_idID of the ad campaign that contains this ad.
nameName of the ad.
statusThe configured status of the ad.
url_parametersURL parameters.
utm_sourceUTM source.
utm_mediumUTM medium.
utm_campaignUTM campaign.
utm_termUTM term.
utm_contentUTM content.
Property NameDescription
idCampaign's ID.
account_idID of the ad account that owns this campaign.
buying_typeBuying type.
effective_statusThe effective status of this campaign.
nameCampaign's name.
spend_capA spend cap for the campaign, such that it will not spend more than this cap. Expressed as integer value of the subunit in your currency.
start_timeStart time.
stop_timeStop time.
Property NameDescription
idSegment internal ID.
ad_idThe unique ID of the ad you're viewing in reporting.
clicksThe number of clicks on your ads.
date_startThe start date for your data.
date_stopThe end date for your data.
frequencyThe average number of times each person saw your ad.
impressionsThe number of times your ads were on screen.
inline_post_engagementsThe total number of actions that people take involving your ads.
social_spendThe total amount you've spent so far for your ads showed with social information.
spendThe estimated total amount of money you've spent on your campaign, ad set or ad during its schedule.
unique_clicksThe number of people who performed a click (all). This metric is estimated.
unique_impressionsDeprecated in favor of reach . You can continue to query unique_impressions for this metric, but zero-values will now be null.
reachThe number of people who saw your ads at least once. Reach is different from impressions, which may include multiple views of your ads by the same people.

Additional Insights fields

additional-insights-fields page anchor

Segment supports both Breakdowns for Insights(link takes you to an external page) and Ads Actions Stats(link takes you to an external page). Breakdowns and Ads Action Stats are not enabled by default; reach out to Segment support(link takes you to an external page) to enable them.

The following table lists the Ads Action Stats that Segment supports:

FieldDescription
actionsThe total number of actions people took that are attributed to your ads.
actions_valuesThe total value of all conversions attributed to your ads.
unique_actionsThe total number of unique actions attributed to your ads.
video_p25_watched_actionsThe number of times your video played at 25% of its length, including plays that skipped to this point.
video_p50_watched_actionsThe number of times your video played at 50% of its length, including plays that skipped to this point.
video_p75_watched_actionsThe number of times your video played at 75% of its length, including plays that skipped to this point.
video_p95_watched_actionsThe number of times your video played at 95% of its length, including plays that skipped to this point.
video_p100_watched_actionsThe number of times your video played at 100% of its length, including plays that skipped to this point.
video_30_sec_watched_actionsThe number of times your video played for at least 30 seconds, or for nearly its total length if it's shorter than 30 seconds.
video_avg_time_watched_actionsThe average time a video played, including any time spent replaying the video for a single impression.

For more information, view Meta's Insights documentation(link takes you to an external page).


Currently, Warehouses are the only supported destination for object-cloud sources.