預算

在廣告組合層級設定單日預算或總經費。您為出價和預算設定的金額為廣告帳號幣別最低面額層級,例如 USD(美元)的美分。在該組合中投放的所有廣告都不會超過花費上限:

  • daily_budget:您每天願意為廣告組合或行銷活動支付的平均金額。透過廣告管理員,您可以實現大致與您單日預算相符的成果。但是,有時可能會有更佳的機會。在這些日期中,系統最多可能花費超出單日預算的 25%。例如,假設您的單日預算為 $10 美元,系統可能會支出多達 $12.50 美元。
  • 總經費:您願意在整個廣告組合或行銷活動刊登期間支付的金額。除非您變更投遞設定,否則支付的費用不會超過廣告組合成果的總經費。假設您的廣告組合刊登五天,總經費為 $250 美元,我們可能會在頭兩天各花費 $50 美元。接著在第三天,若能獲得更多成果,便可能會花費 $75 美元。然後,若沒有那麼多機會,第四天可能會花費 $25 美元,第五天可能會花費 $50 美元。

若要設定 20 美元的單日預算:

curl -X POST \ -F 'name="My First Adset"' \ -F 'daily_budget=2000' \ -F 'start_time="2024-10-31T18:14:01-0700"' \ -F 'end_time="2024-11-07T18:14:01-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', })

若要為設定投放 10 天的行銷活動設定 200 美元的總經費:

curl -X POST \ -F 'name="My First Adset"' \ -F 'lifetime_budget=20000' \ -F 'start_time="2024-10-31T18:14:01-0700"' \ -F 'end_time="2024-11-10T18:14:01-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', })

如果您選擇單日預算,我們會調整您的每日花費,如果選擇總經費,則會調整廣告組合整個生命週期的花費。