Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
> NOTE: CLAUDE.md is a symlink to AGENTS.md; update AGENTS.md (not the symlink) when changing these instructions.

# Contributing to source-facebook-marketing

For general guidance on contributing to Airbyte connectors, see the [Connector Development documentation](https://docs.airbyte.com/connector-development/).

## Incremental Stream Considerations

The Facebook Marketing API supports date-based filtering via `time_range` and `filtering` parameters. The connector is a Python CDK connector with classes like `FBMarketingIncrementalStream` and `FBMarketingReversedIncrementalStream` providing incremental patterns.

**Connector type:** Python CDK

**Analysis status:** Pure Python CDK connector with sophisticated incremental patterns already in place. Full stream-by-stream analysis requires Python code review.

### Future incremental stream candidates

- **All streams deferred for Python code review:** This connector defines its streams in Python code rather than declarative manifest YAML. A full stream-by-stream incremental analysis table (per the standard CONTRIBUTING.md schema) should be added by a future agent after reviewing the Python stream definitions, their `cursor_field` properties, and the API endpoints they call.
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,50 @@ acceptance_tests:
bypass_reason: "Data cannot be seeded in the test account, integration tests added for the stream instead"
- name: "videos"
bypass_reason: "Data cannot be seeded in the test account, integration tests added for the stream instead"
timeout_seconds: 4800
expect_records:
path: "integration_tests/expected_records.jsonl"
- name: "ads_insights"
bypass_reason: "The test ad accounts have never delivered an ad (lifetime spend 0), so Meta returns no insights rows in any window; needs a running campaign in the test account"
- name: "ads_insights_action_type"
bypass_reason: "The test ad accounts have never delivered an ad (lifetime spend 0), so Meta returns no insights rows in any window; needs a running campaign in the test account"
- name: "ads_insights_age_and_gender"
bypass_reason: "The test ad accounts have never delivered an ad (lifetime spend 0), so Meta returns no insights rows in any window; needs a running campaign in the test account"
- name: "ads_insights_comscore_market"
bypass_reason: "The test ad accounts have never delivered an ad (lifetime spend 0), so Meta returns no insights rows in any window; needs a running campaign in the test account"
- name: "ads_insights_country"
bypass_reason: "The test ad accounts have never delivered an ad (lifetime spend 0), so Meta returns no insights rows in any window; needs a running campaign in the test account"
- name: "ads_insights_platform_and_device"
bypass_reason: "The test ad accounts have never delivered an ad (lifetime spend 0), so Meta returns no insights rows in any window; needs a running campaign in the test account"
- name: "ads_insights_region"
bypass_reason: "The test ad accounts have never delivered an ad (lifetime spend 0), so Meta returns no insights rows in any window; needs a running campaign in the test account"
- name: "ads_insights_action_carousel_card"
bypass_reason: "The test ad accounts have never delivered an ad (lifetime spend 0), so Meta returns no insights rows in any window; needs a running campaign in the test account"
- name: "ads_insights_action_conversion_device"
bypass_reason: "The test ad accounts have never delivered an ad (lifetime spend 0), so Meta returns no insights rows in any window; needs a running campaign in the test account"
- name: "ads_insights_action_reaction"
bypass_reason: "The test ad accounts have never delivered an ad (lifetime spend 0), so Meta returns no insights rows in any window; needs a running campaign in the test account"
- name: "ads_insights_action_video_sound"
bypass_reason: "The test ad accounts have never delivered an ad (lifetime spend 0), so Meta returns no insights rows in any window; needs a running campaign in the test account"
- name: "ads_insights_action_video_type"
bypass_reason: "The test ad accounts have never delivered an ad (lifetime spend 0), so Meta returns no insights rows in any window; needs a running campaign in the test account"
- name: "ads_insights_delivery_device"
bypass_reason: "The test ad accounts have never delivered an ad (lifetime spend 0), so Meta returns no insights rows in any window; needs a running campaign in the test account"
- name: "ads_insights_delivery_platform"
bypass_reason: "The test ad accounts have never delivered an ad (lifetime spend 0), so Meta returns no insights rows in any window; needs a running campaign in the test account"
- name: "ads_insights_delivery_platform_and_device_platform"
bypass_reason: "The test ad accounts have never delivered an ad (lifetime spend 0), so Meta returns no insights rows in any window; needs a running campaign in the test account"
- name: "ads_insights_demographics_age"
bypass_reason: "The test ad accounts have never delivered an ad (lifetime spend 0), so Meta returns no insights rows in any window; needs a running campaign in the test account"
- name: "ads_insights_demographics_comscore_market_region"
bypass_reason: "The test ad accounts have never delivered an ad (lifetime spend 0), so Meta returns no insights rows in any window; needs a running campaign in the test account"
- name: "ads_insights_demographics_country"
bypass_reason: "The test ad accounts have never delivered an ad (lifetime spend 0), so Meta returns no insights rows in any window; needs a running campaign in the test account"
- name: "ads_insights_demographics_gender"
bypass_reason: "The test ad accounts have never delivered an ad (lifetime spend 0), so Meta returns no insights rows in any window; needs a running campaign in the test account"
- name: "customcustom_insight_stream"
bypass_reason: "The test ad accounts have never delivered an ad (lifetime spend 0), so Meta returns no insights rows in any window; needs a running campaign in the test account"
incremental:
tests:
- config_path: "secrets/config.json"
timeout_seconds: 6000
future_state:
future_state_path: "integration_tests/future_state.json"
# ads_insights is currently failing because there is a lookback window and the minimum value is one day
skip_comprehensive_incremental_tests: true
full_refresh:
tests:
- config_path: "secrets/config.json"
timeout_seconds: 4800
ignored_fields:
activities:
- name: extra_data
bypass_reason: "image_url in extra_data is changing frequently"
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
},
{
"stream": {
"name": "ads_insights_demographics_dma_region",
"name": "ads_insights_demographics_comscore_market_region",
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"]
},
Expand All @@ -137,7 +137,7 @@
},
{
"stream": {
"name": "ads_insights_dma",
"name": "ads_insights_comscore_market",
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@
"sync_mode": "full_refresh",
"destination_sync_mode": "append"
},
{
"stream": {
"name": "ad_creatives_from_ads",
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"]
},
"sync_mode": "incremental",
"destination_sync_mode": "append"
},
{
"stream": {
"name": "ads_insights",
Expand Down Expand Up @@ -74,7 +83,7 @@
},
{
"stream": {
"name": "ads_insights_dma",
"name": "ads_insights_comscore_market",
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,18 @@
}
}
},
{
"type": "STREAM",
"stream": {
"stream_state": {
"updated_time": "2121-07-25",
"filter_statuses": ["ARCHIVED"]
},
"stream_descriptor": {
"name": "ad_creatives_from_ads"
}
}
},
{
"type": "STREAM",
"stream": {
Expand Down Expand Up @@ -131,7 +143,7 @@
"filter_statuses": []
},
"stream_descriptor": {
"name": "ads_insights_dma"
"name": "ads_insights_comscore_market"
}
}
},
Expand Down Expand Up @@ -323,7 +335,7 @@
"filter_statuses": []
},
"stream_descriptor": {
"name": "ads_insights_demographics_dma_region"
"name": "ads_insights_demographics_comscore_market_region"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
},
"access_token": {
"title": "Access Token",
"description": "The value of the generated access token. From your App’s Dashboard, click on \"Marketing API\" then \"Tools\". Select permissions <b>ads_management, ads_read, read_insights, business_management</b>. Then click on \"Get token\". See the <a href=\"https://docs.airbyte.com/integrations/sources/facebook-marketing\">docs</a> for more information.",
"description": "The value of the generated access token. We recommend a Meta system user access token: in Meta Business Settings, go to <b>Users</b> > <b>System users</b>, assign your ad account(s) to the system user, then click <b>Generate new token</b> for your app and select the <b>ads_read</b>, <b>ads_management</b>, and <b>business_management</b> permissions. See the <a href=\"https://docs.airbyte.com/integrations/sources/facebook-marketing\">docs</a> for more information.",
"order": 1,
"airbyte_secret": true,
"airbyte_hidden": true,
"type": "string"
},
"credentials": {
Expand Down Expand Up @@ -56,7 +57,7 @@
},
"access_token": {
"title": "Access Token",
"description": "The value of the generated access token. From your App’s Dashboard, click on \"Marketing API\" then \"Tools\". Select permissions <b>ads_management, ads_read, read_insights, business_management</b>. Then click on \"Get token\". See the <a href=\"https://docs.airbyte.com/integrations/sources/facebook-marketing\">docs</a> for more information.",
"description": "The value of the generated access token. We recommend a Meta system user access token: in Meta Business Settings, go to <b>Users</b> > <b>System users</b>, assign your ad account(s) to the system user, then click <b>Generate new token</b> for your app and select the <b>ads_read</b>, <b>ads_management</b>, and <b>business_management</b> permissions. See the <a href=\"https://docs.airbyte.com/integrations/sources/facebook-marketing\">docs</a> for more information.",
"airbyte_secret": true,
"type": "string"
}
Expand All @@ -76,7 +77,7 @@
},
"access_token": {
"title": "Access Token",
"description": "The value of the generated access token. From your App’s Dashboard, click on \"Marketing API\" then \"Tools\". Select permissions <b>ads_management, ads_read, read_insights, business_management</b>. Then click on \"Get token\". See the <a href=\"https://docs.airbyte.com/integrations/sources/facebook-marketing\">docs</a> for more information.",
"description": "The value of the generated access token. We recommend a Meta system user access token: in Meta Business Settings, go to <b>Users</b> > <b>System users</b>, assign your ad account(s) to the system user, then click <b>Generate new token</b> for your app and select the <b>ads_read</b>, <b>ads_management</b>, and <b>business_management</b> permissions. See the <a href=\"https://docs.airbyte.com/integrations/sources/facebook-marketing\">docs</a> for more information.",
"airbyte_secret": true,
"type": "string"
}
Expand All @@ -87,7 +88,7 @@
},
"start_date": {
"title": "Start Date",
"description": "The date from which you'd like to replicate data for all incremental streams, in the format YYYY-MM-DDT00:00:00Z. If not set then all data will be replicated for usual streams and only last 2 years for insight streams.",
"description": "The date from which you'd like to replicate data for all incremental streams, in the format YYYY-MM-DDT00:00:00Z. If not set then all data will be replicated for usual streams and only last 37 months for insight streams.",
"order": 2,
"pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}Z$",
"examples": ["2017-01-25T00:00:00Z"],
Expand Down Expand Up @@ -457,7 +458,6 @@
"creative_relaxation_asset_type",
"description_asset",
"device_platform",
"dma",
"fidelity_type",
"flexible_format_asset_type",
"frequency_value",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,26 @@ data:
hosts:
- graph.facebook.com
connectorBuildOptions:
baseImage: docker.io/airbyte/python-connector-base:4.0.2@sha256:9fdb1888c4264cf6fee473649ecb593f56f58e5d0096a87ee0b231777e2e3e73
baseImage: docker.io/airbyte/python-connector-base:4.1.1@sha256:a268b44c733ae699a60f5fbc06a324945dba98945c6e2ab7f8609f2f895b0d28
connectorSubtype: api
connectorType: source
definitionId: e7778cfc-e97c-4458-9ecb-b4f2bba8946c
dockerImageTag: 5.3.1
dockerImageTag: 6.2.0
dockerRepository: airbyte/source-facebook-marketing
documentationUrl: https://docs.airbyte.com/integrations/sources/facebook-marketing
externalDocumentationUrls:
- title: Changelog
url: https://developers.facebook.com/docs/marketing-api/marketing-api-changelog
type: api_release_history
- title: 2025 Out-Of-Cycle Changes
url: https://developers.facebook.com/docs/marketing-api/out-of-cycle-changes/occ-2025
- title: 2026 Out-Of-Cycle Changes
url: https://developers.facebook.com/documentation/ads-commerce/marketing-api/out-of-cycle-changes/occ-2026
type: api_deprecations
- title: Marketing API Versioning
url: https://developers.facebook.com/docs/marketing-api/versions
type: api_deprecations
- title: Marketing API Authorization
url: https://developers.facebook.com/docs/marketing-api/access
type: authentication_guide
- title: API Upgrade Tool
url: https://developers.facebook.com/tools/api_versioning/600551260845577/
type: api_reference
Expand All @@ -43,7 +50,12 @@ data:
releaseStage: generally_available
releases:
rolloutConfiguration:
enableProgressiveRollout: false
enableProgressiveRollout: true
defaultRolloutMode: autopilot
autopilotConfig:
autoStart: true
autoPromoteStages: true
strategy: slow
breakingChanges:
2.0.0:
message: "All Ads-Insights-* streams now have updated schemas. Users will need to retest source configuration, refresh the source schema and reset affected streams after upgrading. Please pay attention that data older than 37 months will become unavailable due to FaceBook limitations. For more information [visit](https://docs.airbyte.com/integrations/sources/facebook-marketing-migrations)"
Expand Down Expand Up @@ -72,6 +84,10 @@ data:
- scopeType: stream
impactedScopes:
- "ad_creatives"
6.0.0:
message: "Meta deprecated the `dma` (Nielsen DMA) breakdown effective June 22, 2026, replacing it with `comscore_market`. The built-in `ads_insights_dma` and `ads_insights_demographics_dma_region` streams have been replaced with `ads_insights_comscore_market` and `ads_insights_demographics_comscore_market_region`. Users syncing the old DMA streams must switch to the new Comscore Market streams. The `dma` breakdown has also been removed from Custom Insights configuration. For more information, see the [migration guide](https://docs.airbyte.com/integrations/sources/facebook-marketing-migrations)."
upgradeDeadline: "2026-06-24"
deadlineAction: "auto_upgrade"
5.0.0:
message: "This update includes multiple breaking schema changes: (1) Custom Insights streams now use level-based primary keys — when `level` is set to `adset`, `campaign`, or `account`, the primary key will use `adset_id`, `campaign_id`, or just `account_id` respectively, instead of always using `ad_id`. (2) The deprecated `7d_view` and `28d_view` attribution window columns have been removed from all Ads Insights streams, as Meta stopped returning data for these windows on January 12, 2026. (3) The `wish_bid` field has been removed from Ads Insights streams. All users should refresh their source schema and reset affected streams after upgrading. For more information, see the [migration guide](https://docs.airbyte.com/integrations/sources/facebook-marketing-migrations)."
upgradeDeadline: "2026-04-10"
Expand All @@ -89,7 +105,7 @@ data:
- ads_insights_country
- ads_insights_platform_and_device
- ads_insights_region
- ads_insights_dma
- ads_insights_comscore_market
- activities
supportLevel: certified
tags:
Expand Down
Loading
Loading