您的出價是為廣告組合定義。這些欄位必須遵守下列限制:
名稱 | 說明 |
---|---|
| 定義您付款的動作。設定為 |
| 定義您優化的動作。設定為與 |
| 您為目標設定的值,以美分為單位,最少為 1 美分。舉例來說, |
| 針對關係網(例如 |
自 第 9 v9 起,應用程式廣告的每次動作成本帳單已經停用,您無法將計費事件和優化目標同時設為 APP_INSTALLS
。我們建議您改用 impression
計費事件。您還是可以在 billing_event
或 optimization_goal
下方指定 APP_INSTALLS
,但不得兩者同時指定。
請查閱廣告組合文件,以了解允許對廣告組合作出的更新。
下列範例建立每次動作成本出價廣告組合。請注意,您必須為每次動作成本廣告組合設定 promoted_object
。
curl -X POST \
-F 'name="A CPA Ad Set"' \
-F 'campaign_id="<AD_CAMPAIGN_ID>"' \
-F 'daily_budget=5000' \
-F 'start_time="2024-11-28T10:19:41-0800"' \
-F 'end_time="2024-12-05T10:19:41-0800"' \
-F 'billing_event="IMPRESSIONS"' \
-F 'optimization_goal="REACH"' \
-F 'bid_amount=1000' \
-F 'promoted_object={
"page_id": "<PAGE_ID>"
}' \
-F 'targeting={
"facebook_positions": [
"feed"
],
"geo_locations": {
"countries": [
"US"
]
}
}' \
-F 'user_os="iOS"' \
-F 'publisher_platforms="facebook"' \
-F 'device_platforms="mobile"' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v21.0/act_<AD_ACCOUNT_ID>/adsets
設定後,您可建立廣告,並按照此處的建立流程將相關廣告放入此廣告組合。
將出價變更為每次動作成本廣告組合:
curl -X POST \
-F 'billing_event="IMPRESSIONS"' \
-F 'optimization_goal="LINK_CLICKS"' \
-F 'bid_amount=200' \
-F 'targeting={
"geo_locations": {
"countries": [
"US"
]
},
"facebook_positions": [
"feed"
]
}' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v21.0/<AD_SET_ID>/
如要建立出價每次影片觀看成本(即影片觀看次數的每次動作成本)的廣告,請先以 objective=VIDEO_VIEWS
建立廣告宣傳活動。
curl -X POST \
-F 'name="Video Views campaign"' \
-F 'objective="OUTCOME_ENGAGEMENT"' \
-F 'status="PAUSED"' \
-F 'special_ad_categories=[]' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v21.0/act_<AD_ACCOUNT_ID>/campaigns
然後,在廣告組合設定影片觀看次數的每次動作成本 bid_info
:
use FacebookAds\Object\AdSet;
use FacebookAds\Object\Fields\AdSetFields;
use FacebookAds\Object\Fields\TargetingFields;
use FacebookAds\Object\Targeting;
use FacebookAds\Object\Values\AdSetBillingEventValues;
use FacebookAds\Object\Values\AdSetOptimizationGoalValues;
$adset = new AdSet(null, 'act_<AD_ACCOUNT_ID>');
$adset->setData(array(
AdSetFields::NAME => 'A CPV Ad Set',
AdSetFields::CAMPAIGN_ID => <CAMPAIGN_ID>,
AdSetFields::DAILY_BUDGET => 500,
AdSetFields::START_TIME =>
(new \DateTime("+1 week"))->format(\DateTime::ISO8601),
AdSetFields::END_TIME =>
(new \DateTime("+2 week"))->format(\DateTime::ISO8601),
AdSetFields::BILLING_EVENT => AdSetBillingEventValues::VIDEO_VIEWS,
AdSetFields::OPTIMIZATION_GOAL => AdSetOptimizationGoalValues::VIDEO_VIEWS,
AdSetFields::BID_AMOUNT => 100,
AdSetFields::TARGETING => (new Targeting())->setData(array(
TargetingFields::GEO_LOCATIONS => array(
'countries' => array(
'US',
),
),
TargetingFields::PUBLISHER_PLATFORMS => array('facebook'),
TargetingFields::DEVICE_PLATFORMS => array('mobile'),
)),
));
$adset->create(array(
AdSet::STATUS_PARAM_NAME => AdSet::STATUS_PAUSED,
));
import time
from facebookads.adobjects.adset import AdSet
adset = AdSet(parent_id='act_<AD_ACCOUNT_ID>')
adset.update({
AdSet.Field.name: 'A CPV Ad Set',
AdSet.Field.campaign_id: <CAMPAIGN_ID>,
AdSet.Field.daily_budget: 500,
AdSet.Field.start_time: int(time.time()),
AdSet.Field.end_time: int(time.time() + 100000),
AdSet.Field.optimization_goal: AdSet.OptimizationGoal.video_views,
AdSet.Field.billing_event: AdSet.BillingEvent.video_views,
AdSet.Field.bid_amount: 100,
AdSet.Field.targeting: {
'geo_locations': {
'countries': ['US'],
},
Targeting.Field.publisher_platforms: ['facebook'],
Targeting.Field.device_platforms: ['mobile'],
},
})
adset.remote_create(params={
'status': AdSet.Status.paused,
})
AdSet adSet = new AdAccount(act_<AD_ACCOUNT_ID>, context).createAdSet()
.setName("A CPV Ad Set")
.setCampaignId(<CAMPAIGN_ID>)
.setDailyBudget(500L)
.setStartTime(start_time)
.setEndTime(end_time)
.setBillingEvent(AdSet.EnumBillingEvent.VALUE_VIDEO_VIEWS)
.setOptimizationGoal(AdSet.EnumOptimizationGoal.VALUE_VIDEO_VIEWS)
.setBidAmount(100L)
.setTargeting(
new Targeting()
.setFieldDevicePlatforms(Arrays.asList(Targeting.EnumDevicePlatforms.VALUE_MOBILE))
.setFieldGeoLocations(
new TargetingGeoLocation()
.setFieldCountries(Arrays.asList("US"))
)
.setFieldPublisherPlatforms(Arrays.asList("facebook"))
)
.setStatus(AdSet.EnumStatus.VALUE_PAUSED)
.execute();
String ad_set_id = adSet.getId();
curl \
-F 'name=A CPV Ad Set' \
-F 'campaign_id=<CAMPAIGN_ID>' \
-F 'daily_budget=500' \
-F 'start_time=2018-02-06T04:45:29+0000' \
-F 'end_time=2018-02-13T04:45:29+0000' \
-F 'billing_event=VIDEO_VIEWS' \
-F 'optimization_goal=VIDEO_VIEWS' \
-F 'bid_amount=100' \
-F 'targeting={
"device_platforms": ["mobile"],
"geo_locations": {"countries":["US"]},
"publisher_platforms": ["facebook"]
}' \
-F 'status=PAUSED' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v2.11/act_<AD_ACCOUNT_ID>/adsets