Facebook Ads

Facebook Ads is a service promoting customer products, services, websites, etc. from Facebook.

Data integration: Skyvia supports importing data to and from Facebook Ads, exporting Facebook Ads data to CSV files, replicating Facebook Ads data to relational databases, and synchronizing Facebook Ads data with other cloud apps and relational databases.

Backup: Skyvia Backup does not support Facebook Ads backup.

Query: Skyvia Query supports Facebook Ads.

Establishing Connection

To create a connection with Facebook Ads, sign in with Facebook Ads and specify the Ad Account Id.

Getting Credentials

You can find the Ad Account Id in your Facebook Ads Manager. The Ad Account Id value is located above the search and filter bar, in the account dropdown menu or in the page URL.

Connection Editor window

Creating Connection

To connect to Facebook Ads, perform the following steps:

Connection Editor window

  1. Click Sign In with Facebook.

  2. Enter your facebook credentials and click Log In.

    Facebook Sign In window

  3. Enter your Ad Account Id

Additional Connection Parameters

View Attribution Window

Specifies how many days to go back from the last sync time when fetching conversions based on ad impressions during Incremental Replication.

Click Attribution Window

Specifies how many days to go back from the last sync time when fetching conversions based on ad clicks during Incremental Replication.

Include Incomplete Data in Reports

Enables including current days and months in Daily*...*Insights and Monthly*...*Insights reports. Data in reports might be incomplete. Default value is true.

Connector Specifics

Object Peculiarities

There are two types of objects in Facebook Ads: standard objects and *Insights objects.

Insights Objects

Objects with *Insights suffix in their names are the metrics for the random period from DateStart to DateStop. Default reporting period is last 36 months up to and including the current date.

Objects with Monthly*...*Insights names are the metrics for the completed calendar months. Default reporting period is last 36 full months (includes only the months whose first date falls within this period).

Objects with Daily*...*Insights names are the metrics for the completed days. Default reporting period is 6 months.

By default daily and monthly reports include data for the current periods in the query results and might be incomplete. Disable the Allow Incomplete Data in Reports parameter in the connection to include only the complete days or months. To set a custom period in daily or monthly report, add filters by the DateStart field with the following operators >=, >, <=, <.

For example, to get data for the last year in a daily report, you can add the following filters:
SELECT * FROM DailyAccountInsights WHERE DateStart >= '2025-03-01' and DateStart < '2026-03-01'

Breakdowns

When you query the *Insights objects, you can group the query results data by one or several compatible breakdowns. Each breakdown corresponds to an enum value in the Breakdowns field. The Breakdowns field lets you choose how your data should be grouped. Skyvia represents it as a field for filtering, but it doesn’t work like a regular SQL filter. Instead, it reorganizes the query results based on one or more selected breakdowns. When you use filter by the Breakdowns field, you may see more rows, your metric values are recalculated for each group.

For example, to group the campaign analytics by devices, we use the following query:

1
2
3
SELECT CampaignId, ImpressionDevice, Clicks, Impressions, Breakdowns
FROM CampaignInsights
WHERE Breakdowns = '["ImpressionDevice"]'

Make sure you use native filters when querying the *Insights objects with breakdowns. Otherwise, data will not be grouped.

The ActionBreakdowns field works similarly to Breakdowns, but it affects only action-related metric fields such as Actions, Conversions, and associated fields.

The list of available breakdowns is the following:

Type Breakdown value
General AdFormatAsset, Age, AppId,
BodyAsset,
CallToActioAsset, CoarseConversionValue, ConversionDestination, Country,
DescriptionAsset, DevicePlatform, Dma,
FidelityType, FrequencyValue,
Gender,
HourlyStatsAggregatedByAdvertiserTimeZone, HourlyStatsAggregatedByAudienceTimeZone, Hsid,
ImageAsset, ImpressionDevice, IsConversionIdModeled,
LandingDestination, LinkUrlAsset,
MarketingMessagesBtnName, MdsaLandingDestination, MediaAassetUrl, MediaCreator, MediaDestinationUrl, MediaFormat, MediaOriginUrl, MediaTextContent, Mmm,
PlacePageId, PlatformPosition, PostbackSequenceIndex, ProductId, PublisherPlatform,
Redownload, Region,
SkanCampaignId, SkanConversionId, SkanVersion, StandardEventContentType,
TitleAsset,
VideoAsset
Action breakdowns ActionCanvasComponentName, ActionCarouselCardId, ActionCarouselCardName, ActionDestination, ActionDevice, ActionReaction, ActionTargetId, ActionType, ActionVideoSound, ActionVideoType,
ConversionDestination,
MatchedPersonaId, MatchedPersonaName,
SignalSourceBucket, StandardEventContentType

Campaigns

Campaigns in the Draft status are not displayed in the query results by default.

Filtering Specifics

Facebook Ads API supports the following native filters for the *Insights objects:

Field Operator
AuctionBid, AuctionCompetitiveness, AuctionMaxCompetitorBid, CanvasAvgViewPercent, CanvasAvgViewTime, Clicks, CostPerDdaCountbyConvs, CostPerEstimatedAdRecallers, CostPerInlineLinkClick, CostPerInlinePostEngagement, CostPerUniqueClick, CostPerUniqueInlineLinkClick, Cpc, Cpm, Cpp, Ctr, DdaCountbyConvs, EstimatedAdRecallers, Frequency, Impressions, InlineLinkClickCtr, InlineLinkClicks, InlinePostEngagement, Instant_experience_outbound_clicks, InstantExperienceClicksToOpen, InstantExperienceClicksToStart, Reach, Spend, UniqueCtr, UniqueInlineLinkClicks, UniqueLinkClicksCtr >, >=, <, <=, IN, NOT IN
ActionBreakdowns, Breakdowns, ReportTime =
DateStart in the Daily*...*Insights and Monthly*...*Insights objects =, >, >=, <, <=
DateStart, DateStop in the *Insights objects =

For other Facebook Ads objects the native filters are the following:

Object Field
Campaigns Id, Name, Objective, BuyingType, SpendCap, CreatedTime, EffectiveStatus, UpdatedTime
AdSets Id, Name, CampaignId, BillingEvent, OptimizationGoal, BidAmount, LifetimeBudget, DailyBudget, CreatedTime, UpdatedTime
Ads Id, Name, CampaignId, AdSetId, BidAmount, CreatedTime, UpdatedTime
AdCreatives, AdVideos, AdImages Id

DML Operations Support

Operation Object
INSERT, UPDATE, DELETE Campaigns, AdSets, Ads
INSERT, DELETE AdImages, AdVideos
INSERT LeadgenForms

Incremental Replication and Synchronization

Skyvia supports Replication with Incremental Updates for the following Facebook Ads objects:

AdImages, Ads, AdSets, AdVideos, Campaigns, DailyAccountInsights,DailyAdInsights, DailyAdSetInsights, DailyCampaignInsights, LeadgenForms, MonthlyAccountInsights, MonthlyAdInsights,MonthlyAdSetInsights, MonthlyCampaignInsights.

Skyvia detects only new records and doesn't track the updated records for the LeadgenForms object.

By default, Skyvia replicates Monthly*...*Insights data for the last 36 months and Daily*...*Insights data — for the last 6 months from the initial replication run. To replicate daily reports for earlier periods, you can set the LastSyncTime parameter to the needed start date before the initial replication run.

Skyvia supports Synchronization for the following Facebook Ads objects: Ads, AdSets, Campaigns.

Supported Actions

Skyvia supports all the common actions for Facebook Ads.