Campaign with custom Facebook page + Ad account
In certain use cases, you may want to create a Facebook campaign that directly uses a specific Ad Account and Facebook Page—without relying on the default values configured for your brand. To support this, we offer a custom option that allows you to provide these values directly when creating the campaign.
This approach builds upon the main campaign creation flow previously described, with only a small modification: you can now include two additional fields in your request:
- facebook_ad_account
(string)
- facebook_page
(string)
Both fields only accept the ID
These fields are optional. However, if you choose to use this custom flow, both fields must be provided.
Important:
If eitherfacebook_ad_account
orfacebook_page
is not specified, the system will automatically fall back to the default values defined in your brand settings.
Example
Below, you will find an example of how a campaign payload would look with the explained fields included.
{
"provider": "facebook",
"campaign_type": "link_clicks",
"campaign_name": "campaign Link clicks from API",
"metadata": {
"budget": {
"value": 12,
"currency": "USD"
},
"start_date": "2024-08-20T05:00:00.000Z",
"end_date": "2024-08-21T05:00:00.000Z",
"call_to_action": "LEARN_MORE",
"instagram_post_id": "17921761666746619",
"link_to_boost": "https://www.goodreads.com/book/show/5907.The_Hobbit?ref=rae_2",
"caption": "test caption",
"targeting_countries": [
{
"name": "Recommended Markets",
"budget": 1,
"locations": [
{
"value": "US",
"label": "United States of America",
"type": "country",
"region_id": null,
"country_code": null
}
]
}
],
"targeting_audiences": [
{
"fbId": "6003317001363",
"name": "Zendaya"
}
],
"targeting_demographic": {
"age": {
"min": 18,
"max": 35
},
"gender": "All",
"languages": [
{
"key": 6,
"name": "English (US)",
"selected": true
},
{
"key": 24,
"name": "English (UK)",
"selected": true
}
]
},
"facebook_ad_account": "act_676XXXXXXXXXXXX",
"facebook_page": "10813XXXXXXXXXX"
}
}
Considerations
Note:
This custom campaign creation flow only applies to campaigns served by Facebook. It does not support campaigns intended for other platforms.
When using this custom campaign creation flow with a directly supplied Ad Account and Facebook Page, there are a few important things to keep in mind. These considerations help ensure the campaign can be created and run successfully.
- The
access_token
configured in your brand settings is still used for all Facebook API calls.❗This means the provided Facebook Page and Ad Account must be accessible using that same token. Make sure they are properly linked to the same Business Manager.
If not met: The API will return the following possible errors depending on whether it is for the fb page or the ad account:
The parent token does not have permissions on this page. Please check the page permissions with the parent token and try again.
The parent token does not have permissions on this ad account. Please check the ad account permissions with the parent token and try again.
- The Ad Account must have accepted the Facebook Custom Audiences Terms of Service to allow campaign creation using custom audiences.
❗If not met: The API will return the next error message:
Your ads can't run because your Meta Ads Payment Method isn't setup. Please update your payment method below to continue.
- The Ad Account must have the following
user_tasks
enabled:DRAFT
ANALYZE
ADVERTISE
MANAGE
❗If not met: The API will return the next error message:
Facebook ad account has not the required permissions, we need the following permissions: DRAFT, ANALYZE, ADVERTISE, MANAGE.
- The Facebook Page must have the following
tasks
enabled:ADVERTISE
CREATE_CONTENT
ANALYZE
❗If not met: The API will return the next error message:
Facebook page has not the required permissions, we need the following permissions: ADVERTISE, CREATE_CONTENT, ANALYZE.
- The Ad Account must have a valid payment method configured in order to run campaigns.
❗If not met: The API will return the next error message:
Your ads can't run because your Meta Ads Payment Method isn't setup. Please update your payment method below to continue.
We recommend verifying all permissions and account configurations before initiating campaign creation with this custom flow.
Updated about 1 month ago