Facebook Ads is the advertising platform that allows businesses and individuals to create targeted ads on Facebook and its affiliated apps, such as Instagram and Messenger.
Ensure you have Ads Manager activated for your Facebook account.
Locate your account ID, which is a lengthy number. You can find it by clicking on the Account Overview dropdown in Ads Manager or by checking the link address. For example, adsmanager.facebook.com/adsmanager/manage/accounts?act={accountId}
.
Copy the account ID.
Business
as the category, and click Next.Basic
settings in the left-hand side menu.App ID
and App secret
.ads_read
and lead_retrieval
permissions, and generate a short-lived access token.The config
section in a YAML file includes the following properties:
Connectorname**: FacebookAds
Access_token**: FacebookAds access token
Client_id**: Client’s id
Client_secret**: Client’s secret
Account_id**: FacebookAds Account ID
The Facebook ads doesn’t support incremental mode and Facebook insights supports incremental mode.
properties:
type: insights
initial_load_past_days: 30
attribution_window_days_lag: 7
time_increment_days: 1
The incremental mode loads the new data instead of loading the entire dataset. In the given example, the initial load is set to 30 days. It loads the data for the past 30 days, which is incremented daily since the time increment day is set to one. The attribution is how far the system should go back to consider data attribution.
version: 1
encrypt_credentials: false
plugins:
extractors:
- name: fb_data
connectorname: FacebookAds
config:
access_token: <ACCESS TOKEN>
client_id: <CLIENT ID>
client_secret: <CLIENT SECRET>
account_id: <ACCOUNT ID>
select:
- ads
- ads1
version: 1
encrypt_credentials: false
plugins:
extractors:
- name: fb_data
connectorname: FacebookAds
config:
access_token: <ACCESS TOKEN>
client_id: <CLIENT ID>
client_secret: <CLIENT SECRET>
account_id: <ACCOUNT ID>
properties:
type: insights
initial_load_past_days: 30
attribution_window_days_lag: 7
time_increment_days: 1
Bold ETL
icon on the Navigation Pane.Add Project
and provide the name for the new project.Facebook Ads
template.select
property and save it to the BoldBI Data Store.The available resources are supported in Facebook Ads
- campaigns
- ads
- ad_creatives
- leads
- ad_sets
Warning:
1. The `Encrypt_Credentials` property should be set to false when updating the new access token on the template. If you have modified other properties, such as 'select' or 'account id', the `Encrypt_Credentials` property must be set to true.
2. The default lifetime of the access token is 1 hour. Therefore, you need to convert it to a long-lived access token in order to use the same token for 60 days. Existing tables should be maintained even if the token has expired or is being used as an invalid token.
Schedules
and select the created facebookETLDS
project.Run Now
.Schedule
option.Edit DataSource
Option to view the created tables, such as ‘Campaigns’ and ‘Adsets’ tables.