Meta Ads Setup
Connect Meta (Facebook + Instagram) ad accounts in agency or BYO mode.
The Meta Ads Manager layer (template ID
9b38d03f-9f35-43bc-a823-2ffe603601dd) drives Facebook and Instagram
campaigns.
Agency mode
- Install the layer from the catalog.
- The setup wizard shows Layers' Business ID:
business_id_xxx. Copy it. - In your Meta Business Manager → Settings → Partners → Add partner → paste Layers' Business ID.
- Pick assets to share:
- Ad account (Full access).
- Page (Read).
- Pixel (Manage).
- Instagram account (Full access — required for Instagram ads).
- Send the partnership request.
- Back in Layers, click Accept and bind. Pick which of your shared ad accounts this layer manages.
- Wallet check: top up the Org wallet before enabling agency-mode campaigns (see Wallet & billing).
- Save.
BYO mode
- Install the layer in BYO mode.
- Click Connect via OAuth. Meta dialog opens.
- Sign in with the user that admins the ad account.
- Grant scopes:
ads_management,ads_read,business_management,pages_show_list,pages_read_engagement. - Pick the ad account.
- Provide:
- Pixel ID — the Meta Pixel that receives conversions.
- CAPI access token — generate from Meta Events Manager → your Pixel → Settings → Conversions API → Generate access token.
- Layers stores the token in the
Layers credential vault and shows you the
vault_idreference. - Verify by sending a test event.
Layer config
Once set up, the layer config has:
{
"mode": "agency" | "byo",
"metaBusinessId": "...",
"adAccountId": "act_...",
"pageId": "...",
"instagramAccountId": "...",
"capi": {
"enabled": true,
"pixel_id": "1234567890",
"access_token_vault_id": "vault_abc"
},
"objectives": ["app_installs", "purchases"],
"geos": ["US", "CA", "UK"],
"monthlyCostCap": 50000
}CAPI requirements summary
is_active = trueis_deleted = falsecapi.enabled = truepixel_idsetaccess_token_vault_idresolvable
If any of these is false, CAPI relay silently no-ops. Layers surfaces this on the layer's overview tab.
Multi-pixel setups
For brands with separate Pixels per app or geo:
- Install one Meta Ads layer per Pixel.
- Each layer has its own CAPI config and ad account.
- Dashboards roll up across all installed layers.
Verification checklist
- Layers can list your campaigns.
- CAPI test event appears in Events Manager → Test Events.
- Pixel ID matches the one on your website / app.
- Wallet (agency) or billing method (BYO) is funded.
- Optimizer is enabled.
Troubleshooting
- "Partnership pending" (agency) — Meta hasn't notified Layers yet; refresh in 5 min.
- "Token decryption failed" (BYO) — vault_id rotated; regenerate CAPI token and re-paste.
- Events not arriving in Test Events — make sure the SDK is
configured to forward to
in.layers.com, not direct to Meta.