Start replicating your Facebook Ads data
Select your integrations, choose your warehouse, and enjoy Stitch free for 14 days.
Set up in minutes Unlimited data volume during trial
Facebook Ads is one of the most efficient ways to advertise online. The Stitch Facebook Ads integration will ETL your Facebook Ads data to Microsoft Azure Synapse Analytics in minutes and keep it up to date without the headache of writing and maintaining ETL scripts.
Advertising category Certified by Stitch
Here’s a sample of the raw Facebook Ads data that Stitch will replicate to your analytics warehouse:
This table is the core table of campaigns in a Facebook Ads account. Columns include campaign id, name, status (active/paused), objective.
Table name:
campaigns
This table records all of the ads in a Facebook Ads account. Columns include the ad information including the Ad Set and Ad Campaign it belongs to, the ad bidding, ad targeting and reference to specific creative (image/text) that the ad uses.
Table name:
ads
This table records all of the creatives that are used in Ads. These includes creative name, description and relevant image urls where appropriate.
Table name:
ads_insights
This table records is the core table of Ad Sets in a Facebook Ads account. Columns include the Ad Campaign id/name the Ad Set belongs to, the budgeting, bid type, scheduling and audience targeting information.
Table name:
facebook_adsets
Detailed documentation on how to start syncing Facebook Ads data.
How to extract data from Facebook Ads and load it to Microsoft Azure Synapse Analytics manually.
Facebook Ads to Microsoft Azure Synapse Analytics ManuallyOnce you replicate your Facebook Ads data with Stitch, you can use it in many ways. For example, you can use the data modeling and transformation tool dbt to prepare data for reporting, analytics, or machine learning applications.
Dbt has prebuilt packages for many Stitch data sources, including Facebook Ads. Here’s a look at code for modeling Facebook Ads data. This particular block of code prepares your Facebook Ads order data for analysis.
View the source on GitHub →
{% macro stitch_fb_ad_creatives() %}
{{ adapter_macro('facebook_ads.stitch_fb_ad_creatives') }}
{% endmacro %}
{% macro default__stitch_fb_ad_creatives() %}
with base as (
select * from {{ var('ad_creatives_table') }}
),
child_links as (
select * from {{ ref('fb_ad_creatives__child_links') }}
),
links_joined as (
select
id as creative_id,
lower(coalesce(
nullif(child_link, ''),
nullif({{ facebook_ads.nested_field('base.object_story_spec', ['link_data', 'call_to_action', 'value', 'link']) }}, ''),
nullif({{ facebook_ads.nested_field('base.object_story_spec', ['video_data', 'call_to_action', 'value', 'link']) }}, ''),
nullif({{ facebook_ads.nested_field('base.object_story_spec', ['link_data', 'link']) }}, '')
)) as url,
lower(coalesce(
nullif(url_tags, {{ dbt_utils.split_part('url', "'?'", 2) }}), '')
) as url_tags
from base
left join child_links
on base.id = child_links.creative_id
),
parsed as (
select
links_joined.*,
{{ dbt_utils.split_part('url', "'?'", 1) }} as base_url,
{{ dbt_utils.get_url_host('url') }} as url_host,
{{ dbt_utils.concat(["'/'", dbt_utils.get_url_path('url')]) }} as url_path,
{{ facebook_ads.get_url_parameter() }}
from links_joined
)
select * from parsed
{% endmacro %}
We've developed a Looker Block for Facebook Ads data provisioned by Stitch. This block includes prebuilt code to create dashboards and models that can help uncover insights from your Facebook Ads data.
Here’s a look at one of the LookML files for Facebook Ads data. This Looker Block includes three dashboards that provide granular analysis on ad performance metrics. This LookML file produces an overview dashboard and highlights marketing performance metrics such as ad spend, clicks, and impressions over time.
View the source on GitHub →
- dashboard: overview
title: Overview
layout: grid
rows:
- elements: [total_impressions, total_actions, total_spend]
height: 150
- elements: [spend_actions_impressions]
height: 400
- elements: [campaign_performance]
height: 400
- elements: [campaign_value]
height: 400
- elements: [campaign_delivery]
height: 400
- elements: [actions_by_country]
height: 400
- elements: [campaign_performance_and_clicks]
height: 400
- elements: [actions_by_type, avg_frequency_by_objective]
height: 400
- elements: [campaign_engagement]
height: 400
filters:
- name: campaign_name
type: string_filter
- name: date_start
type: date_filter
elements:
- name: total_impressions
title: Total impressions
type: single_value
model: facebook
explore: ad_insights
measures: [ad_insights.total_impressions]
sorts: [ad_insights.total_impressions desc]
limit: 5000
show_single_value_title: true
show_comparison: false
listen:
campaign_name: ad_insights.campaign_name
date_start: ad_insights.date_start_date
- name: total_actions
title: Total actions
type: single_value
model: facebook
explore: ad_insights
measures: [ad_insights.total_actions]
sorts: [ad_insights.total_actions desc]
limit: 5000
show_single_value_title: true
show_comparison: false
listen:
campaign_name: ad_insights.campaign_name
date_start: ad_insights.date_start_date
- name: total_spend
title: Total spend
type: single_value
model: facebook
explore: ad_insights
measures: [ad_insights.total_spend]
sorts: [ad_insights.total_spend desc]
limit: 5000
show_single_value_title: true
show_comparison: false
listen:
campaign_name: ad_insights.campaign_name
date_start: ad_insights.date_start_date
- name: spend_actions_impressions
title: Spend, actions, and impressions over time
type: looker_line
model: facebook
explore: ad_insights
dimensions: [ad_insights.date_start_month]
measures: [ad_insights.total_spend, ad_insights.total_actions,
ad_insights.total_impressions]
sorts: [ad_insights.date_start_month desc]
limit: 5000
stacking: ''
colors: ['#FFCC00', '#1E2023', '#3399CC', '#CC3399', '#66CC66', '#999999', '#FF4E00', '#A2ECBA', '#9932CC', '#0000CD']
show_value_labels: false
label_density: 25
legend_position: center
x_axis_gridlines: false
show_view_names: true
limit_displayed_rows: false
y_axis_combined: false
show_y_axis_labels: true
show_y_axis_ticks: false
y_axis_tick_density: default
show_x_axis_label: true
show_x_axis_ticks: true
x_axis_scale: auto
y_axis_scale_mode: linear
show_null_points: true
point_style: none
interpolation: linear
listen:
campaign_name: ad_insights.campaign_name
date_start: ad_insights.date_start_date
- name: campaign_performance
title: Campaign performance
type: table
model: facebook
explore: ad_insights
dimensions: [campaigns.name, adsets.end_date, adsets.effective_status,
campaigns.objective]
measures: [ad_insights.total_actions, ad_insights.total_clicks,
ad_insights.total_reach, ad_insights.total_spend]
dynamic_fields:
- table_calculation: cost_per_action
label: cost_per_action
expression: ${ad_insights.total_spend} / ${ad_insights.total_actions}
sorts: [campaigns.name]
limit: 5000
show_view_names: false
show_row_numbers: true
truncate_column_names: false
table_theme: editable
limit_displayed_rows: false
listen:
campaign_name: ad_insights.campaign_name
date_start: ad_insights.date_start_date
- name: campaign_value
title: Cost per action v. total actions by campaign
type: looker_scatter
model: facebook
explore: ad_insights
dimensions: [campaigns.name]
measures: [ad_insights.total_actions, ad_insights.total_spend]
dynamic_fields:
- table_calculation: cost_per_action
label: Cost per action
expression: ${ad_insights.total_spend} / ${ad_insights.total_actions}
hidden_fields: [ad_insights.total_spend, campaigns.name]
sorts: [cost_per_action desc]
description: 'Evaluate campaign performance by comparing the actions generated to the total spent on the campaign.'
limit: 5000
column_limit: 50
stacking: ''
colors: ['#FFCC00', '#1E2023', '#3399CC', '#CC3399', '#66CC66', '#999999', '#FF4E00', '#A2ECBA', '#9932CC', '#0000CD']
show_value_labels: false
label_density: 25
legend_position: center
x_axis_gridlines: false
y_axis_gridlines: true
show_view_names: false
limit_displayed_rows: false
y_axis_combined: true
show_y_axis_labels: true
show_y_axis_ticks: true
y_axis_tick_density: default
show_x_axis_label: true
show_x_axis_ticks: true
x_axis_scale: auto
y_axis_scale_mode: linear
show_null_points: true
point_style: circle
listen:
campaign_name: ad_insights.campaign_name
date_start: ad_insights.date_start_date
- name: campaign_delivery
title: Campaign delivery
type: table
model: facebook
explore: ad_insights
dimensions: [campaigns.name, adsets.end_date, adsets.effective_status,
campaigns.objective]
measures: [ad_insights.total_reach, ad_insights.avg_frequency,
ad_insights.avg_cpp, ad_insights.avg_cpm, ad_insights.total_impressions]
sorts: [campaigns.name]
limit: 5000
show_view_names: false
show_row_numbers: true
truncate_column_names: false
table_theme: editable
limit_displayed_rows: false
listen:
campaign_name: ad_insights.campaign_name
date_start: ad_insights.date_start_date
- name: actions_by_country
title: Actions by country
type: looker_geo_choropleth
model: facebook
explore: ad_insights_by_country
dimensions: [ad_insights_by_country.country_iso]
measures: [ad_insights_by_country.total_actions]
sorts: [ad_insights_by_country.total_actions desc]
limit: 5000
map: auto
colors: ['#FFCC00']
show_view_names: true
quantize_colors: false
listen:
campaign_name: ad_insights_by_country.campaign_name
date_start: ad_insights_by_country.date_start_date
- name: campaign_performance_and_clicks
title: Campaign performance and clicks
type: table
model: facebook
explore: ad_insights
dimensions: [campaigns.name, adsets.effective_status, adsets.end_date,
campaigns.objective]
measures: [ad_insights.total_actions, ad_insights.total_reach,
ad_insights.avg_frequency, ad_insights.total_clicks, ad_insights.avg_ctr,
ad_insights.avg_cpc, ad_insights.total_impressions, ad_insights.avg_cpm,
ad_insights.total_inline_link_clicks, ad_insights.avg_inline_link_click_ctr,
ad_insights.avg_cost_per_inline_link_click, ad_insights.total_spend]
sorts: [ad_insights.total_actions desc]
limit: 5000
show_view_names: false
show_row_numbers: true
truncate_column_names: false
table_theme: editable
limit_displayed_rows: false
listen:
campaign_name: ad_insights.campaign_name
date_start: ad_insights.date_start_date
- name: actions_by_type
title: Actions by type
type: looker_pie
model: facebook
explore: ad_action_insights
dimensions: [ad_action_insights.action_type]
measures: [ad_action_insights.total_actions]
sorts: [ad_action_insights.total_actions desc]
limit: 5000
colors: ['#FFCC00', '#1E2023', '#3399CC', '#CC3399', '#66CC66', '#999999', '#FF4E00', '#A2ECBA', '#9932CC', '#0000CD']
value_labels: legend
show_view_names: true
listen:
campaign_name: ad_action_insights.campaign_name
date_start: ad_action_insights.date_start_date
- name: avg_frequency_by_objective
title: Average frequency by objective
type: looker_column
model: facebook
explore: ad_insights
dimensions: [campaigns.objective]
measures: [ad_insights.avg_frequency]
sorts: [ad_insights.avg_frequency desc]
limit: 5000
stacking: ''
colors: ['#FFCC00', '#1E2023', '#3399CC', '#CC3399', '#66CC66', '#999999', '#FF4E00', '#A2ECBA', '#9932CC', '#0000CD']
show_value_labels: false
label_density: 25
legend_position: center
x_axis_gridlines: false
y_axis_gridlines: true
show_view_names: true
limit_displayed_rows: false
y_axis_combined: true
show_y_axis_labels: true
show_y_axis_ticks: true
y_axis_tick_density: default
show_x_axis_label: true
show_x_axis_ticks: true
x_axis_scale: auto
y_axis_scale_mode: linear
show_null_labels: false
listen:
campaign_name: ad_insights.campaign_name
date_start: ad_insights.date_start_date
- name: campaign_engagement
title: Campaign engagement
type: table
model: facebook
explore: ad_action_insights
dimensions: [campaigns.name, adsets.effective_status, adsets.end_date,
campaigns.objective]
measures: [ad_action_insights.post_likes, ad_action_insights.post_comments,
ad_action_insights.link_clicks, ad_action_insights.page_likes,
ad_action_insights.post_shares]
sorts: [campaigns.name]
limit: 5000
show_view_names: false
show_row_numbers: true
truncate_column_names: false
table_theme: editable
limit_displayed_rows: false
listen:
campaign_name: ad_action_insights.campaign_name
date_start: ad_action_insights.date_start_date
Select your integrations, choose your warehouse, and enjoy Stitch free for 14 days.
Set up in minutes Unlimited data volume during trial
When it comes to replicating your data to Microsoft Azure Synapse Analytics, conventional ETL is no longer the only game in town.
Writing ETL code requires big investments of time, money, and expertise that might otherwise be used for innovation. Most importantly, newer approaches to data ingestion deliver faster implementation than traditional ETL, so you can produce data analytics and business intelligence more quickly.
This is where Stitch can help.
Give your analysts, data scientists, and other team members the freedom to use the analytics tools of their choice.
Stitch allowed us to set up a data pipeline within a day. It helped us avoid the hassle of building a data infrastructure team. The quick turnaround time allowed us to gather insights almost near real time.
Founder and CEO, ReportGarden
Stitch is a simple, powerful ETL service built for developers. Stitch connects to your first-party data sources – from databases like MongoDB and MySQL, to SaaS tools like Salesforce and Zendesk – and replicates that data to your warehouse. With Stitch, developers can provision data for their internal users in minutes, not weeks.
Explore all of Stitch's featuresSelect your integrations, choose your warehouse, and enjoy Stitch free for 14 days.
Set up in minutes Unlimited data volume during trial
Stitch integrates with leading databases and SaaS products. No API maintenance, ever, while you maintain full control over replication behavior.
AfterShip
Amazon Aurora MySQL
Amazon Aurora PostgreSQL
Amazon RDS for MariaDB
Amazon RDS for MySQL
Amazon RDS for Oracle Database
Amazon RDS for PostgreSQL
Amazon RDS for SQL Server
Amazon S3 CSV
Amplitude
AppsFlyer
Asana
Autopilot
Autopilot Activities
BigCommerce
Braintree
Branch
Campaign Manager
Campaign Monitor
Chargebee
Close
Club Speed
Codat
Contentful
Customer.io
Delighted
Deputy
Desk.com
Drip
DynamoDB
Eloqua
Facebook Ads
FormKeep
Freshdesk
Front
FullStory
GitHub
GitLab
Google Ads
Google Analytics
Google Analytics
Google Analytics 360
Google Cloud SQL MySQL
Google Cloud SQL PostgreSQL
Google Ecommerce
Google Search Console
Google Sheets
Harvest
Harvest Forecast
Heap
Help Scout
Heroku
HubSpot
IBM Db2
Impact
Import API
Intacct
Intercom
Invoiced
Iterable
Jira
Klaviyo
Lever
LinkedIn Ads
Listrak
LivePerson
LookML
Magento
Mailchimp
Mailjet
Mailshake
Mambu
MariaDB
Marketo
Microsoft Advertising (Bing Ads)
Microsoft Azure SQL Server Database
Microsoft SQL Server
Microsoft Teams
Mixpanel
MongoDB
MySQL
Netsuite
Netsuite Suite Analytics
Onfleet
Oracle
Oracle Netsuite Bronto Marketing Platform
Outbrain
Outreach
Pardot
Particle
Pendo
Pepperjam
Pinterest Ads
Pipedrive
Platform Purple
PostgreSQL
Quick Base
QuickBooks
Quickbooks Online
ReCharge
Recurly
Referral SaaSquatch
Responsys
Revinate
RingCentral
SFTP
Salesforce
Salesforce Marketing Cloud
Segment
Selligent
SendGrid
SendGrid Core
Sendwithus
ShipHero
Shippo
Shopify
SparkPost
Square
Stripe
SurveyMonkey
Taboola
Toggl
Typeform
Urban Airship
UserVoice
Vero
Webhooks
Workday RaaS
Xero
Yotpo
Zapier
Zendesk Chat
Zendesk Support
Zoom
Zuora