Remove default breakdowns and action_breakdowns from Facebook Ads insights source #644
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
This connector has some defaults / assumptions that are baked in which cause some unexpected and confusing behavior. Some background: https://dlthub-community.slack.com/archives/C04DQA7JJN6/p1754597588552409
Essentially, if you hit the insights API and include action breakdowns / breakdowns, you might get back very different numbers of purchases, add to carts, etc then what you would observe in the dashboard. It's not apparent that there have been breakdowns applied in the API responses either, so it causes the user to have to debug the API calls, tweak some things, run the pipeline, and repeat until they figure this out just based on trial and error.
Removing the defaults I think would make sense for the vast majority of folks trying to load simple ads and insights data. The more advanced users can specify these options in their more complex use cases and are probably already more familiar with the API and why they would need these breakdowns for their specific case.
Summary
breakdowns
andaction_breakdowns
parameters in Facebook Ads insights requestsChanges Made
Core Changes:
facebook_insights_source()
to default breakdowns andaction_breakdowns
toNone
instead ofads_insights
andALL_ACTION_BREAKDOWNS
Code Cleanup:
ALL_ACTION_BREAKDOWNS
import from__init__.py
ALL_ACTION_BREAKDOWNS
constant fromsettings.py
Documentation & Examples:
load_insights_with_breakdowns()
example function infacebook_ads_pipeline.py
Impact
####Before:
Users would see action counts inconsistent from what's reported by default in Facebook Ads Manager
After:
Users must explicitly specify breakdowns and action_breakdowns parameters if they want them included in their requests.
Example Usage
Basic insights (no breakdowns)
With age/gender breakdowns
With custom action breakdowns
This change gives users full control over their Facebook Ads insights requests and reduces unnecessary API complexity for users who don't need breakdown data.