Ad Sets
Ad sets are groups of ads, and are used to configure the budget and period the ads should run for. All ads contained within an ad set should have the same targeting, budget, billing, optimization goal, and duration.
Value for parameter of 'publisher_platforms'
Required
Description
facebook, instagram, messenger, audience_network
Optional
The publishing channel for your ad. You can set the publishing channel position by setting them within facebook_positions, instagram_positions, audience_network_positions, or messenger_positions.
POST
https://us-central1-appgregator.cloudfunctions.net/facebook/adaccounts/adsets/
Query Parameters
Name
Type
Description
name*
String
ft-4
connection_name*
String
fbads-01
adaccount_id*
String
act_1514519918873559
Headers
Name
Type
Description
x-api-key*
String
U2Fsd...
{
"id": "23852148656900549"
}
{
"error": {
"message": "Invalid parameter",
"type": "OAuthException",
"code": 100,
"error_subcode": 1815430,
"is_transient": false,
"error_user_title": "Tidak ditemukan objek promosi",
"error_user_msg": "Harap tentukan objek yang dipromosikan untuk set iklan tersebut.",
"fbtrace_id": "AbyZ-PwJA_CeH-3qrZbstU6"
}
}
Body JSON
{
"name" : "Campaign5 AdSet",
"lifetime_budget" : 105000,
"start_time" : "2022-09-26T09:37:09-0700",
"end_time" : "2022-10-03T09:37:09-0700",
"campaign_id" : "23852148573750549",
"bid_amount" : 500,
"daily_budget" : "1000",
"billing_event" : "IMPRESSIONS",
"optimization_goal" : "POST_ENGAGEMENT",
"promoted_object": {
"page_id" : "1842784136033747"
},
"targeting" : {
"age_min": 20,
"age_max": 24,
"behaviors": [
{
"id": 6002714895372,
"name": "All travelers"
}
],
"genders": [
1
],
"geo_locations": {
"countries": [
"US"
],
"regions": [
{
"key": "4081"
}
],
"cities": [
{
"key": "777934",
"radius": 10,
"distance_unit": "mile"
}
]
},
"interests": [
{
"id": "6003108220790",
"name": "National Basketball Association"
}
],
"life_events": [
{
"id": 6003053860372,
"name": "Jauh dari Kota Asal"
}
],
"facebook_positions": [
"feed"
],
"publisher_platforms": [
"facebook",
"audience_network"
]
},
"status" : "PAUSED"
}
curl --location --request POST 'https://us-central1-appgregator.cloudfunctions.net/facebook/adaccounts/adsets?name=ft-4&connection_name=fbads-01&adaccount_id=act_1514519918873559' \
--header 'x-api-key: U2Fsd...' \
--header 'Content-Type: application/json' \
--data-raw '{
"name" : "Campaign5 AdSet",
"lifetime_budget" : 105000,
"start_time" : "2022-09-26T09:37:09-0700",
"end_time" : "2022-10-03T09:37:09-0700",
"campaign_id" : "23852148573750549",
"bid_amount" : 500,
"daily_budget" : "1000",
"billing_event" : "IMPRESSIONS",
"optimization_goal" : "POST_ENGAGEMENT",
"promoted_object": {
"page_id" : "1842784136033747"
},
"targeting" : {
"age_min": 20,
"age_max": 24,
"behaviors": [
{
"id": 6002714895372,
"name": "All travelers"
}
],
"genders": [
1
],
"geo_locations": {
"countries": [
"US"
],
"regions": [
{
"key": "4081"
}
],
"cities": [
{
"key": "777934",
"radius": 10,
"distance_unit": "mile"
}
]
},
"interests": [
{
"id": "6003108220790",
"name": "National Basketball Association"
}
],
"life_events": [
{
"id": 6003053860372,
"name": "Jauh dari Kota Asal"
}
],
"facebook_positions": [
"feed"
],
"publisher_platforms": [
"facebook",
"audience_network"
]
},
"status" : "PAUSED"
}'
var axios = require('axios');
var data = JSON.stringify({
"name": "Campaign5 AdSet",
"lifetime_budget": 105000,
"start_time": "2022-09-26T09:37:09-0700",
"end_time": "2022-10-03T09:37:09-0700",
"campaign_id": "23852148573750549",
"bid_amount": 500,
"daily_budget": "1000",
"billing_event": "IMPRESSIONS",
"optimization_goal": "POST_ENGAGEMENT",
"promoted_object": {
"page_id": "1842784136033747"
},
"targeting": {
"age_min": 20,
"age_max": 24,
"behaviors": [
{
"id": 6002714895372,
"name": "All travelers"
}
],
"genders": [
1
],
"geo_locations": {
"countries": [
"US"
],
"regions": [
{
"key": "4081"
}
],
"cities": [
{
"key": "777934",
"radius": 10,
"distance_unit": "mile"
}
]
},
"interests": [
{
"id": "6003108220790",
"name": "National Basketball Association"
}
],
"life_events": [
{
"id": 6003053860372,
"name": "Jauh dari Kota Asal"
}
],
"facebook_positions": [
"feed"
],
"publisher_platforms": [
"facebook",
"audience_network"
]
},
"status": "PAUSED"
});
var config = {
method: 'post',
url: 'https://us-central1-appgregator.cloudfunctions.net/facebook/adaccounts/adsets?name=ft-4&connection_name=fbads-01&adaccount_id=act_1514519918873559',
headers: {
'x-api-key': 'U2Fsd...',
'Content-Type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://us-central1-appgregator.cloudfunctions.net/facebook/adaccounts/adsets?name=ft-4&connection_name=fbads-01&adaccount_id=act_1514519918873559',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"name" : "Campaign5 AdSet",
"lifetime_budget" : 105000,
"start_time" : "2022-09-26T09:37:09-0700",
"end_time" : "2022-10-03T09:37:09-0700",
"campaign_id" : "23852148573750549",
"bid_amount" : 500,
"daily_budget" : "1000",
"billing_event" : "IMPRESSIONS",
"optimization_goal" : "POST_ENGAGEMENT",
"promoted_object": {
"page_id" : "1842784136033747"
},
"targeting" : {
"age_min": 20,
"age_max": 24,
"behaviors": [
{
"id": 6002714895372,
"name": "All travelers"
}
],
"genders": [
1
],
"geo_locations": {
"countries": [
"US"
],
"regions": [
{
"key": "4081"
}
],
"cities": [
{
"key": "777934",
"radius": 10,
"distance_unit": "mile"
}
]
},
"interests": [
{
"id": "6003108220790",
"name": "National Basketball Association"
}
],
"life_events": [
{
"id": 6003053860372,
"name": "Jauh dari Kota Asal"
}
],
"facebook_positions": [
"feed"
],
"publisher_platforms": [
"facebook",
"audience_network"
]
},
"status" : "PAUSED"
}',
CURLOPT_HTTPHEADER => array(
'x-api-key: U2Fsd...',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Last updated