Meta Ads source: add video_thruplay_watched_actions to AdStats schema
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 39.9k
- Forks
- 3.4k
- Avg merge
- 6h 51m
- Merged PRs (30d)
- 232
Description
Problem
The Meta Ads data warehouse connector's AdStats schema (posthog/temporal/data_imports/sources/meta_ads/schemas.py) does not request video_thruplay_watched_actions from the Meta Marketing API /insights endpoint.
This field is the standard metric for ThruPlays (15 seconds of viewing or video completion, whichever is shorter) — the primary optimization objective for video campaigns. Without it, users can only access actions.video_view which represents 3-second video views, a ~3–9× different metric.
The schema already includes the related percentile fields (video_p25_watched_actions through video_p100_watched_actions) and video_30_sec_watched_actions, so this appears to be an oversight rather than an intentional exclusion.
Proposed fix
Add "video_thruplay_watched_actions" to the field_names list for MetaAdsResource.AdStats (and ideally AdsetStats and CampaignStats as well):
"field_names": [
# ... existing fields ...
"video_30_sec_watched_actions",
"video_thruplay_watched_actions", # <-- add this
"video_p25_watched_actions",
# ...
]
Context
- This is the same field that the Airbyte Facebook Marketing connector re-added in v4.2.0 after a similar omission.
- The Meta Python Business SDK lists
video_thruplay_watched_actionsas a standard field on AdsInsights. - Meta's API documentation confirms ThruPlay is a first-class metric available on all insight endpoints.
Impact
Any PostHog user running video ad campaigns on Meta optimizing for ThruPlays cannot get their primary KPI from the data warehouse. The only workaround is to pull the data separately via Meta's API and load it as a custom source.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in posthog/temporal/data_imports/sources/meta_ads/schemas.py and inspect the field_names list for MetaAdsResource.AdStats, then compare the related AdsetStats and CampaignStats schemas. Add video_thruplay_watched_actions where appropriate and verify that the Meta Ads insights request includes the field for the intended resources.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, data-engineering
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 58/100