Connector guide — Meta Ads (Facebook/Instagram) (meta_ads)
Fixed sections (Phase D1 format; tests/governance/test_onboarding_connector_guides.py pins them). Facts marked [Validated] are measured in code or tests; [Observed] facts carry a date; [Gap] names an open item. No credential, token, account identifier or tenant value appears in this file. No connector is unconditional; consent is the one universal requirement.
What it is
The customer's Meta ad account, read through the Marketing API with a system-user access token for insights and audience sync, plus (optionally) the CAPI pixel/dataset id for the Conversions API value rail. Catalog category paid-media, wave 1.
Status (measured)
[Validated] available: true in CONNECTOR_CATALOG (services/service-marketing-connectors/connector_credentials.py, measured 2026-10-12). Required fields access_token, ad_account_id; optional pixel_id. Test connection calls /me and then the ad-account node on the Marketing API version the insights pull uses (provider_versions.meta_marketing_version). [Validated] the direct pull resolves credentials per (tenant, provider) from the vault and from nowhere else; a tenant with no vault entry is refused merchant_credentials_not_configured before any provider call (direct_connectors.py, D11). The CAPI value rail stays dry-run and flag-off (META_CAPI); collecting pixel_id arms nothing. Required only where the tenant declared the Meta rail in pilot.measurement_rails.
Who owns the account
The customer. The ad account, the business portfolio, the system user and the app the token is generated for stay in the customer's Business Settings; MIZ OKI is a person or partner they can remove (law 3). Credentials resolve per tenant from the vault only — never from the process environment, never from an operator's account (D2/D11).
Prerequisites
- The customer is an admin of the business portfolio that owns the ad account (business.facebook.com → Settings).
- The business has an app a system user can generate a token for. [Gap] OB-GAP-2: many small businesses do not; see Known gaps.
- The token is generated for a system user with the
ads_readscope (plusads_managementonly where ruled in — playbook §4.1), and the ad account is assigned to that system user. - The numeric ad account id is known (Business Settings → Accounts → Ad accounts). It is not the pixel id.
- For the CAPI rail only: the pixel / dataset id (Events Manager → Data sources).
Visibility invite (click path)
business.facebook.com → Settings → People → Invite people → assign the Ad account, Facebook Page, Instagram account and Datasets/Pixels. Role: Employee access; ad account "View performance" (or "Manage campaigns" only if we will run ads). Vendor UIs drift — if a label differs, follow Meta's current Business Help Center article (playbook §5). This invite is for discovery; it is not the API connection.
Connecting in the onboarding UI
- Open
/onboarding→ Connectors → the Meta Ads card (shown as required only when the tenant declared the Meta rail; otherwise optional). - In the customer's Business Settings → Users → System users: create or select a system user, assign the ad account, and generate a token scoped
ads_read(andads_managementonly where ruled in). Paste it intoaccess_tokenon the card — nowhere else (law 2). - Enter
ad_account_idwith or without theact_prefix. - Optionally enter
pixel_id(CAPI pixel / dataset id). It is a different identifier from the ad account and readiness never gaps on it. - Click Test connection. Move on only when it passes.
Fields
| key | where the tenant finds it | format | secret? | required? |
|---|---|---|---|---|
access_token |
Business Settings → Users → System users → Generate token | catalog placeholder EAAG…; opaque, never echoed, masked hint only |
yes | yes |
ad_account_id |
Business Settings → Accounts → Ad accounts | digits, optional act_ prefix (catalog pattern ^(act_)?\d+$) |
no | yes |
pixel_id |
Events Manager → Data sources → the pixel / dataset | digits; catalog placeholder "1234567890123456 (optional)" | no | no |
Test connection
| Failure | Plain-English fix |
|---|---|
422 invalid_field_format on ad_account_id |
Use the numeric ad account id (with or without act_), not the pixel id, the business id or the page id. |
"token rejected: " (/me not 200) |
The system-user token is invalid, expired or revoked. Generate a new token for the system user and re-save the card. |
| "token valid but ad account inaccessible: " | The token works but the system user is not assigned to this ad account, or the id is wrong. Assign the ad account to the system user in Business Settings, or correct the id. |
api_version_refused in the response |
The configured Marketing API version is retired; an operator corrects the version setting. Nothing for the customer to re-enter. |
served_version_warning / api_version_conflict with ok: true |
Informational: Meta auto-upgraded the call or two version settings disagree. The connection works; the operator reconciles the version setting. |
| "provider did not answer within |
Transient; retry once. |
404 not_configured (stored-credential test) |
Nothing is saved for this tenant yet; connect first. |
429 test_rate_limited |
More than 20 tests for this provider in 60 s from this tenant; wait the retry_after_seconds it names. |
| 503 fail-closed (vault error) | The credential vault could not be read; an operator checks vault health. Nothing for the customer to re-enter. |
What it feeds
The Meta insights and audience-sync direct pull (direct_connectors.py, bound to the declared ad_account_id; an account_id in a sync request is a confirmation that must match the declared account — account_not_declared / account_not_bound_to_tenant otherwise), aggregates into canonical ingestion → mizoki_unified_data. pixel_id feeds the CAPI value rail in services/measurement-rails/ (POST /v1/rails/meta-value-feed:send), which stays dry-run and flag-off; writebacks stay dark under MEASUREMENT_WRITEBACK=false (law 8).
Consent posture
Insights are aggregate and de-personalised by construction. Audience sync and the CAPI rail carry person-level data: any such event passes the consent gate first (fail-closed, per-event basis required); without a per-subject basis the person-level fields stay dark and only the de-personalised remainder is kept. The tenant's consent declaration (P2-5) is required of every tenant and never substitutes for a per-subject basis. Consent is the one universal requirement; no connector is unconditional.
Revoke / offboard
Customer side: Business Settings → Users → System users → revoke the token or remove the ad-account assignment; Settings → People → remove the MIZ OKI seat. Platform side: the operator removes the tenant's meta_ads vault entry through the governed path, or offboards the whole tenant with POST /api/v1/tenant/offboard/credentials; readiness then reports connectors.meta_ads:not-configured where the rail is declared.
Known gaps
- OB-GAP-2 — a system-user token needs an app the business can use; customers without a Meta app need an operator-guided, merchant-owned app or the Meta OAuth door — approved in principle 2026-10-14 (
docs/reports/OWNER_RULINGS_2026-10-14_BOSS_MULTI_TENANT.md), built on the first declared Meta rail; Meta App Review and Business Verification start now. - OB-GAP-6 — one vault entry per provider per tenant; a second ad account is recorded as a named gap.
- OB-GAP-9 — card affordances still open (required/optional marks, inline hints).
- [Gap] The CAPI value rail is dry-run and flag-off; a live send still needs the owner-held arming steps (checklist §5.1). "Not yet available" is the honest answer for live CAPI delivery.
Last verified
Catalog and readiness code measured 2026-10-12 on main 47309238. Vendor documentation: Meta for Developers — "System Users" (developers.facebook.com/docs/marketing-api/system-users/) — fetched 2026-10-12; Meta Business Help Center — "Add System Users to Your Business Portfolio" (www.facebook.com/business/help/503306463479099) — fetched 2026-10-12 (only the page title rendered from this sandbox). Lane records: docs/tenants/TENANT_ONBOARDING_CHECKLIST.md P2-2 and §5.1.