-
Notifications
You must be signed in to change notification settings - Fork 68
Description
dlt version
dlt 1.12.0
Source name
facebook_ads
Describe the problem
When using the provided facebook_insights source and sample code, by default dlt passes through an array of pre-defined action_breakdowns through to the API call via the ALL_ACTION_BREAKDOWNS
variable which is set here:
ALL_ACTION_BREAKDOWNS = ("action_type", "action_target_id", "action_destination") |
And used as a default here:
action_breakdowns: Sequence[str] = ALL_ACTION_BREAKDOWNS, |
This is problematic because Facebook will return completely different / incorrect action values back that don't align with what you would actually see if looking at Facebook's dashboard.
When passing through an empty array for action_breakdowns
or omitting it entirely, it behaves as expected.
This was very non-intuitive and ate up a lot of time as I was trying to figure out what could be causing those discrepancies. I think the defaults should work esp given the examples provided vs returning incorrect data. More advanced users can add action_breakdowns
if they know what they are doing.
Slack Discussion: https://dlthub-community.slack.com/archives/C04DQA7JJN6/p1754597588552409
Expected behavior
The number of actions I see in the dashboard when looking at an ad should match the 7_day_click
values returned by the API and the DLT pipeline.
Actual:
The numbers vary significantly
Steps to reproduce
Steps to Reproduce:
- Setup a new DLT project and init the facebook_ads source
- Find an ad account with some actions data and set it up to work with DLT / add the credentials and values in secrets and config.
- Run the insights pipeline
How you are using the source?
I run this source in production.
Operating system
Linux
Runtime environment
Other
Python version
3.12
dlt destination
motherduck
Additional information
Proposed Solutions:
- Make the default for action_breakdowns [] or omit entirely unless added as a parameter
- Add a warning if enabled so the user knows it could impact the number of action counts received.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status