Presupuestos

Configura un presupuesto diario o un presupuesto total en el nivel del conjunto de anuncios. El importe que configuras para la puja y el presupuesto se encuentra en el nivel de denominación mínimo de la divisa de la cuenta publicitaria, por ejemplo, centavos, en el caso de USD. Todos los anuncios entregados en ese conjunto no excederán un límite de gasto:

  • presupuesto por día (daily_budget): el importe promedio que estás dispuesto a gastar por día en un conjunto de anuncios o una campaña. Con el administrador de anuncios, obtendrás el resultado que definiste como criterio de optimización según el valor del presupuesto diario. No obstante, quizá haya días en los que se presenten mejores oportunidades. En esos días, podría invertirse un 25% adicional al presupuesto diario. Por ejemplo, si tienes un presupuesto diario de 10 USD, se pueden gastar hasta 12,50 USD.
  • presupuesto total (lifetime_budget): el importe total que estás dispuesto a gastar a lo largo del período durante el que se mostrará un conjunto de anuncios o una campaña. No se te cobrará más de tu presupuesto total por los resultados de tu conjunto de anuncios a menos que cambies la configuración de la entrega. Si tu conjunto de anuncios está en circulación durante cinco días y tiene un presupuesto total de 250 USD, se pueden gastar 50 USD cada uno de los dos primeros días. El tercer día, si hay muchas probabilidades de conseguir resultados, se pueden gastar 75 USD. Posteriormente, si hay muchas oportunidades disponibles, se pueden gastar 25 USD en el cuarto día y 50 en el quinto.

Para configurar un presupuesto por día de 20 dólares:

curl -X POST \ -F 'name="My First Adset"' \ -F 'daily_budget=2000' \ -F 'start_time="2024-10-31T15:57:00-0700"' \ -F 'end_time="2024-11-07T15:57:00-0800"' \ -F 'campaign_id="<AD_CAMPAIGN_ID>"' \ -F 'bid_amount=100' \ -F 'billing_event="LINK_CLICKS"' \ -F 'optimization_goal="LINK_CLICKS"' \ -F 'targeting={ "facebook_positions": [ "feed" ], "geo_locations": { "countries": [ "US" ] } }' \ -F 'status="PAUSED"' \ -F 'access_token=<ACCESS_TOKEN>' \ https://graph.facebook.com/v21.0/act_<AD_ACCOUNT_ID>/adsets
'use strict'; const bizSdk = require('facebook-nodejs-business-sdk'); const AdAccount = bizSdk.AdAccount; const AdSet = bizSdk.AdSet; const access_token = '<ACCESS_TOKEN>'; const app_secret = '<APP_SECRET>'; const app_id = '<APP_ID>'; const id = '<AD_ACCOUNT_ID>'; const api = bizSdk.FacebookAdsApi.init(access_token); const showDebugingInfo = true; // Setting this to true shows more debugging info. if (showDebugingInfo) { api.setDebug(true); } const logApiCallResult = (apiCallName, data) => { console.log(apiCallName); if (showDebugingInfo) { console.log('Data:' + JSON.stringify(data)); } }; let fields, params; fields = [ ]; params = { 'name' : 'My First Adset', 'daily_budget' : '2000', 'start_time' : '2024-07-29T17:54:47-0700', 'end_time' : '2024-08-05T17:54:47-0700', 'campaign_id' : '<adCampaignLinkClicksID>', 'bid_amount' : '100', 'billing_event' : 'LINK_CLICKS', 'optimization_goal' : 'LINK_CLICKS', 'targeting' : {'facebook_positions':['feed'],'geo_locations':{'countries':['US']}}, 'status' : 'PAUSED', }; const adsets = (new AdAccount(id)).createAdSet( fields, params ); logApiCallResult('adsets api call complete.', adsets);
require __DIR__ . '/vendor/autoload.php'; use FacebookAds\Object\AdAccount; use FacebookAds\Object\AdSet; use FacebookAds\Api; use FacebookAds\Logger\CurlLogger; $access_token = '<ACCESS_TOKEN>'; $app_secret = '<APP_SECRET>'; $app_id = '<APP_ID>'; $id = '<AD_ACCOUNT_ID>'; $api = Api::init($app_id, $app_secret, $access_token); $api->setLogger(new CurlLogger()); $fields = array( ); $params = array( 'name' => 'My First Adset', 'daily_budget' => '2000', 'start_time' => '2024-07-29T17:54:47-0700', 'end_time' => '2024-08-05T17:54:47-0700', 'campaign_id' => '<adCampaignLinkClicksID>', 'bid_amount' => '100', 'billing_event' => 'LINK_CLICKS', 'optimization_goal' => 'LINK_CLICKS', 'targeting' => array('facebook_positions' => array('feed'),'geo_locations' => array('countries' => array('US'))), 'status' => 'PAUSED', ); echo json_encode((new AdAccount($id))->createAdSet( $fields, $params )->exportAllData(), JSON_PRETTY_PRINT);
from facebook_business.adobjects.adaccount import AdAccount from facebook_business.adobjects.adset import AdSet from facebook_business.api import FacebookAdsApi access_token = '<ACCESS_TOKEN>' app_secret = '<APP_SECRET>' app_id = '<APP_ID>' id = '<AD_ACCOUNT_ID>' FacebookAdsApi.init(access_token=access_token) fields = [ ] params = { 'name': 'My First Adset', 'daily_budget': '2000', 'start_time': '2024-07-29T17:54:47-0700', 'end_time': '2024-08-05T17:54:47-0700', 'campaign_id': '<adCampaignLinkClicksID>', 'bid_amount': '100', 'billing_event': 'LINK_CLICKS', 'optimization_goal': 'LINK_CLICKS', 'targeting': {'facebook_positions':['feed'],'geo_locations':{'countries':['US']}}, 'status': 'PAUSED', } print AdAccount(id).create_ad_set( fields=fields, params=params, )
import com.facebook.ads.sdk.*; import java.io.File; import java.util.Arrays; public class SAMPLE_CODE_EXAMPLE { public static void main (String args[]) throws APIException { String access_token = \"<ACCESS_TOKEN>\"; String app_secret = \"<APP_SECRET>\"; String app_id = \"<APP_ID>\"; String id = \"<AD_ACCOUNT_ID>\"; APIContext context = new APIContext(access_token).enableDebug(true); new AdAccount(id, context).createAdSet() .setName(\"My First Adset\") .setDailyBudget(2000L) .setStartTime(\"2024-07-29T17:54:47-0700\") .setEndTime(\"2024-08-05T17:54:47-0700\") .setCampaignId(\"<adCampaignLinkClicksID>\") .setBidAmount(100L) .setBillingEvent(AdSet.EnumBillingEvent.VALUE_LINK_CLICKS) .setOptimizationGoal(AdSet.EnumOptimizationGoal.VALUE_LINK_CLICKS) .setTargeting( new Targeting() .setFieldFacebookPositions(Arrays.asList(\"feed\")) .setFieldGeoLocations( new TargetingGeoLocation() .setFieldCountries(Arrays.asList(\"US\")) ) ) .setStatus(AdSet.EnumStatus.VALUE_PAUSED) .execute(); } }
require 'facebook_ads' access_token = '<ACCESS_TOKEN>' app_secret = '<APP_SECRET>' app_id = '<APP_ID>' id = '<AD_ACCOUNT_ID>' FacebookAds.configure do |config| config.access_token = access_token config.app_secret = app_secret end ad_account = FacebookAds::AdAccount.get(id) adsets = ad_account.adsets.create({ name: 'My First Adset', daily_budget: '2000', start_time: '2024-07-29T17:54:47-0700', end_time: '2024-08-05T17:54:47-0700', campaign_id: '<adCampaignLinkClicksID>', bid_amount: '100', billing_event: 'LINK_CLICKS', optimization_goal: 'LINK_CLICKS', targeting: {'facebook_positions':['feed'],'geo_locations':{'countries':['US']}}, status: 'PAUSED', })

Para configurar un presupuesto total de 200 dólares para que una campaña se ejecute durante 10 días:

curl -X POST \ -F 'name="My First Adset"' \ -F 'lifetime_budget=20000' \ -F 'start_time="2024-10-31T15:57:00-0700"' \ -F 'end_time="2024-11-10T15:57:00-0800"' \ -F 'campaign_id="<AD_CAMPAIGN_ID>"' \ -F 'bid_amount=100' \ -F 'billing_event="LINK_CLICKS"' \ -F 'optimization_goal="LINK_CLICKS"' \ -F 'targeting={ "facebook_positions": [ "feed" ], "geo_locations": { "countries": [ "US" ] }, "publisher_platforms": [ "facebook", "audience_network" ] }' \ -F 'status="PAUSED"' \ -F 'access_token=<ACCESS_TOKEN>' \ https://graph.facebook.com/v21.0/act_<AD_ACCOUNT_ID>/adsets
'use strict'; const bizSdk = require('facebook-nodejs-business-sdk'); const AdAccount = bizSdk.AdAccount; const AdSet = bizSdk.AdSet; const access_token = '<ACCESS_TOKEN>'; const app_secret = '<APP_SECRET>'; const app_id = '<APP_ID>'; const id = '<AD_ACCOUNT_ID>'; const api = bizSdk.FacebookAdsApi.init(access_token); const showDebugingInfo = true; // Setting this to true shows more debugging info. if (showDebugingInfo) { api.setDebug(true); } const logApiCallResult = (apiCallName, data) => { console.log(apiCallName); if (showDebugingInfo) { console.log('Data:' + JSON.stringify(data)); } }; let fields, params; fields = [ ]; params = { 'name' : 'My First Adset', 'lifetime_budget' : '20000', 'start_time' : '2024-07-29T17:54:57-0700', 'end_time' : '2024-08-08T17:54:57-0700', 'campaign_id' : '<adCampaignLinkClicksID>', 'bid_amount' : '100', 'billing_event' : 'LINK_CLICKS', 'optimization_goal' : 'LINK_CLICKS', 'targeting' : {'facebook_positions':['feed'],'geo_locations':{'countries':['US']},'publisher_platforms':['facebook','audience_network']}, 'status' : 'PAUSED', }; const adsets = (new AdAccount(id)).createAdSet( fields, params ); logApiCallResult('adsets api call complete.', adsets);
require __DIR__ . '/vendor/autoload.php'; use FacebookAds\Object\AdAccount; use FacebookAds\Object\AdSet; use FacebookAds\Api; use FacebookAds\Logger\CurlLogger; $access_token = '<ACCESS_TOKEN>'; $app_secret = '<APP_SECRET>'; $app_id = '<APP_ID>'; $id = '<AD_ACCOUNT_ID>'; $api = Api::init($app_id, $app_secret, $access_token); $api->setLogger(new CurlLogger()); $fields = array( ); $params = array( 'name' => 'My First Adset', 'lifetime_budget' => '20000', 'start_time' => '2024-07-29T17:54:57-0700', 'end_time' => '2024-08-08T17:54:57-0700', 'campaign_id' => '<adCampaignLinkClicksID>', 'bid_amount' => '100', 'billing_event' => 'LINK_CLICKS', 'optimization_goal' => 'LINK_CLICKS', 'targeting' => array('facebook_positions' => array('feed'),'geo_locations' => array('countries' => array('US')),'publisher_platforms' => array('facebook','audience_network')), 'status' => 'PAUSED', ); echo json_encode((new AdAccount($id))->createAdSet( $fields, $params )->exportAllData(), JSON_PRETTY_PRINT);
from facebook_business.adobjects.adaccount import AdAccount from facebook_business.adobjects.adset import AdSet from facebook_business.api import FacebookAdsApi access_token = '<ACCESS_TOKEN>' app_secret = '<APP_SECRET>' app_id = '<APP_ID>' id = '<AD_ACCOUNT_ID>' FacebookAdsApi.init(access_token=access_token) fields = [ ] params = { 'name': 'My First Adset', 'lifetime_budget': '20000', 'start_time': '2024-07-29T17:54:57-0700', 'end_time': '2024-08-08T17:54:57-0700', 'campaign_id': '<adCampaignLinkClicksID>', 'bid_amount': '100', 'billing_event': 'LINK_CLICKS', 'optimization_goal': 'LINK_CLICKS', 'targeting': {'facebook_positions':['feed'],'geo_locations':{'countries':['US']},'publisher_platforms':['facebook','audience_network']}, 'status': 'PAUSED', } print AdAccount(id).create_ad_set( fields=fields, params=params, )
import com.facebook.ads.sdk.*; import java.io.File; import java.util.Arrays; public class SAMPLE_CODE_EXAMPLE { public static void main (String args[]) throws APIException { String access_token = \"<ACCESS_TOKEN>\"; String app_secret = \"<APP_SECRET>\"; String app_id = \"<APP_ID>\"; String id = \"<AD_ACCOUNT_ID>\"; APIContext context = new APIContext(access_token).enableDebug(true); new AdAccount(id, context).createAdSet() .setName(\"My First Adset\") .setLifetimeBudget(20000L) .setStartTime(\"2024-07-29T17:54:57-0700\") .setEndTime(\"2024-08-08T17:54:57-0700\") .setCampaignId(\"<adCampaignLinkClicksID>\") .setBidAmount(100L) .setBillingEvent(AdSet.EnumBillingEvent.VALUE_LINK_CLICKS) .setOptimizationGoal(AdSet.EnumOptimizationGoal.VALUE_LINK_CLICKS) .setTargeting( new Targeting() .setFieldFacebookPositions(Arrays.asList(\"feed\")) .setFieldGeoLocations( new TargetingGeoLocation() .setFieldCountries(Arrays.asList(\"US\")) ) .setFieldPublisherPlatforms(Arrays.asList(\"facebook\", \"audience_network\")) ) .setStatus(AdSet.EnumStatus.VALUE_PAUSED) .execute(); } }
require 'facebook_ads' access_token = '<ACCESS_TOKEN>' app_secret = '<APP_SECRET>' app_id = '<APP_ID>' id = '<AD_ACCOUNT_ID>' FacebookAds.configure do |config| config.access_token = access_token config.app_secret = app_secret end ad_account = FacebookAds::AdAccount.get(id) adsets = ad_account.adsets.create({ name: 'My First Adset', lifetime_budget: '20000', start_time: '2024-07-29T17:54:57-0700', end_time: '2024-08-08T17:54:57-0700', campaign_id: '<adCampaignLinkClicksID>', bid_amount: '100', billing_event: 'LINK_CLICKS', optimization_goal: 'LINK_CLICKS', targeting: {'facebook_positions':['feed'],'geo_locations':{'countries':['US']},'publisher_platforms':['facebook','audience_network']}, status: 'PAUSED', })

Si elijes un presupuesto por día, nosotros programamos tu gasto diario; en un presupuesto total, el gasto se programa a lo largo de la totalidad del conjunto de anuncios.