The Facebook Ads extractor pulls raw data from the Facebook Marketing API and extracts the following resources from a Facebook Ads account:
For more information you can check the documentation for tap-facebook.
In order to access your Facebook Ads data, you will need the following:
Your Facebook Ads Account ID.
To get your Account ID:
?act=and ahead of any additional parameters starting with
Get it now!
You can also use the Meltano OAuth Service to acquire this token.
First, you will need to create a Facebook App through the Developer Portal.
Now that your app has been created and the Marketing API product has been enabled, we can generate an access token.
manage_pagesunder "Select Token Permissions".
This is the Access Token you will provide to Meltano.
Tokens generated using this method are only valid for 60 days by default. When the token expires, Meltano will no longer be able to automatically update your Facebook Ads data, and you will need to generate a new token and update the extractor configuration.
To find out exactly when this token will expire, you can use the Access Token Debugger:
To prevent any interruption of your data pipeline, we recommend that you generate and configure a new token before the currently configured one expires:
This property allows you to configure where you want your extracted data set to start from.
This property allows you to configure where you want your extracted data set to end. Otherwise, if left blank, it will try to fetch all the Ads data from the Start Date until the date you run the Extractor.
Open your Meltano instance and click "Pipelines" in the top navigation bar. You should now see the Extractors page, which contains various options for connecting your data sources.
Let's install the Facebook Ads Extractor by clicking on the
Install button inside its card.
On the configuration modal we want to enter the Account ID and Access Token that Facebook Ads extractor will use to connect to the Facebook Marketing API, the Start Date we want the extracted data set to start from and the End Date.
meltano add extractor tap-facebook
If you are successful, you should see
Added and installed extractors 'tap-facebook' in your terminal.
.envfile in a text editor
export TAP_FACEBOOK_ACCOUNT_ID="123456789012345" export TAP_FACEBOOK_ACCESS_TOKEN="YOUR ACCESS TOKEN" export TAP_FACEBOOK_START_DATE="2019-12-01T00:00:00Z"
export TAP_FACEBOOK_END_DATE="2019-12-31T00:00:00Z" export TAP_FACEBOOK_INSIGHTS_BUFFER_DAYS=0
TAP_FACEBOOK_INSIGHTS_BUFFER_DAYS sets how many days to start extracting Ads Insights before the start_date (default: 0)
Check the README for more details.