Facebook Ads Insights API provides users a single consistent way to extract ads metrics from Facebook.
Use case
Users in their Data Pipeline can retrieve metrics for specified campaign, add set or ad id using Insights API.
User Stories
As a data pipeline user, I would like to be able to pull metrics for specified campaign, add set or add id, transform it and load it into my analytics data warehouse, so that I can use it for analytics
As a data pipeline user, I would like to be able to specify breakdowns, so I can group metrics by specified parameters
As a data pipeline user, I would like to be able to specify fields to pull, so I can selectively retrieve required metrics
As a data pipeline user, I would like to be able to specify filters, so I can selectively retrieve required metrics
As a data pipeline user, I would like to be able to specify date range[s], so I can pull metrics only for specified time span[s]
As a data pipeline user, I would like CDAP's Facebook Ads Insights plugins to handle API limits, by exposing required properties, so that I do not have to worry about them
Plugin Type
Batch Source
Batch Sink
Real-time Source
Real-time Sink
Action
Post-Run Action
Aggregate
Join
Spark Model
Spark Compute
Configurables
This section defines properties that are configurable for this plugin.
User Facing Name
Type
Description
Constraints
Access token
string
Access token
Object ID
string
Campaign, add set or ad or account id
Object Type
select
Campaign, add set, ad or account
Level
select
Level of request
Fields
multi-select
List of fields to pull
Breakdown
multi-select
List of breakdowns
Additional Breakdown
multi-select
List of additional breakdowns
Filtering
function-dropdown-with-alias
List of per-field filters
Time Ranges
string
List of time ranges
Sorting
select
Sorting parameters
For “Filter” and “Time Ranges” string formats see facebook doc, “filtering” and “time_ranges” parameters respectively.
Design / Implementation Tips
Plugin will be implemented using official facebook-java-business-sdk, authentication will be performed using app secret and access token. Output schema must be automatically generated from selected fields and breakdowns.
Output schema completely based on Fields items. Fields that holds action or list of actions is a nullable action record or nullable array of records respectively; other fields are nullable strings.