出價乘數因數

此 API 僅限列入許可名單的合作夥伴和廣告客戶使用。如欲使用此 API,請聯絡您的 Meta 代表。

有了出價乘數,廣告客戶便可使用一個目標廣告受眾,為單一廣告組合維持有細微差別的出價策略,從而減少所需的受眾劃分數量。例如,廣告客戶可以建立單一廣告組合,然後使用出價乘數,為每個近因組別採用不同的出價。

廣告客戶通常會建立廣告組合,以便為不同的廣告受眾族群採用不同的出價。例如,廣告客戶可以為三個不同年齡組別建立三個相應的廣告組合:18 至 25 歲、26 至 35 歲、36 至 65 歲。

刊登住屋、就業和信貸廣告的廣告客戶如果位於美國或是向美國用戶刊登廣告,須受不同限制約束,且可使用部分廣告受眾類別來調整出價。住屋、就業和信貸宣傳活動無法對以下廣告受眾類別調整出價:agegenderlocalehome_locationuser_bucket,以及類似 custom_audience(衍生自特定類似廣告受眾的自訂廣告受眾)。詳情請查看特殊廣告類別

由 2023 年 1 月 30 日起,系統便不會再向選擇不接收通知的用戶刊登使用出價乘數因數且含有第三方資料類別(booking_windowcustom_audience(包括類似自訂廣告受眾)、lengthofstaytravelstartdatetravelstartdayofweekuser_recencyuser_bucket)的廣告。

出價乘數最佳操作實例

  • 出價乘數可讓您使用複雜的自訂出價策略,而無需建立過多廣告受眾族群或廣告組合。這有助您獲取更佳的廣告刊登成效,同時避免將宣傳活動過分細分為大量受眾規模相對較小的廣告組合。
  • 出價乘數並不會局限於單一目標。它們兼容以下優化項目:APP_INSTALLSCLICKSLANDING_PAGE_VIEWSLEAD_GENERATIONOFFSITE_CLICKSOFFSITE_CONVERSIONS
  • 您以往可以為三個不同年齡組別建立三個相應的廣告組合。之後,您可以為每個廣告組合各自出價。現在,您可以建立單一廣告組合,並運用出價乘數,為每個年齡組別採用不同的出價;出價乘數的範圍為 0.09 至 1.0。
  • 您需要在單一 user_groups 鍵值下指定出價乘數。

注意:所有出價策略都支援使用出價乘數因數,特別是:出價上限、成本上限和最低成本。

設定廣告受眾類別

您可以使用出價乘數因數來定義廣告受眾類別,並為各個廣告受眾類別分配出價乘數因數。廣告受眾類別以用戶人口統計資料、用戶裝置,以及廣告客戶自訂數據來定義。住屋、就業或信貸宣傳活動無法對以下廣告受眾類別分配出價:agegenderlocalehome_locationuser_bucket,以及類似 custom_audience(衍生自特定類似廣告受眾的自訂廣告受眾)。

優先次序說明

age

根據年齡或年齡範圍採用不同的出價。(不適用於住屋、就業和信貸宣傳活動。)

booking_window

根據距離旅程出發日期的天數採用不同的出價。

custom_audience

根據用戶所屬的 custom_audience 出價。此選項支援類似廣告受眾,但不適用於住屋、就業和信貸宣傳活動。

device_platform

根據用戶的裝置平台(如流動裝置或桌面電腦)採用不同的出價。

gender

根據性別採用不同的出價。(不適用於住屋、就業和信貸宣傳活動。)

home_location

根據用戶的 home_location 出價。這代表他們的當前住址。home_location 乘數因數可細分為城市、地區和國家。(不適用於住屋、就業和信貸宣傳活動。)

lengthofstay

根據旅程出發及回程日期之間的天數出價。

locale

根據本地語言(如英文或西班牙文)採用不同的出價。(不適用於住屋、就業和信貸宣傳活動。)

position_type

根據廣告的刊登位置(如 facebook_feedfacebook_marketplaceinstagram_story)出價。

publisher_platform

根據 publisher_platform(如 facebookinstagramaudience_networkmessenger)出價。

travelstartdate

根據旅程的出發日期採用不同的出價,如 20181231 代表 2018 年 12 月 31 日。

travelstartdayofweek

根據旅程出發日期的當週日子(0 是星期一;6 是星期日)採用不同的出價。

user_bucket

根據廣告客戶的觸發像素事件或應用程式事件所定義的 user_bucket 值出價。user_bucket 欄位為選用參數,必須是 0 至 100 之間的整數。(不適用於住屋、就業和信貸宣傳活動。)

user_device

根據 user_device(如 iPhone)出價。請參閱 user_device

user_os

根據 user_os(如 iOS 或 Android)出價。

user_recency

根據用戶上次瀏覽網站或應用程式的時間出價。

age

按年齡範圍為用戶分組,例如 18-2526-35。舉例來說,若是出價上限為 5 美元的廣告組合,則您可以為年齡介乎 18 至 25 歲的用戶出價 2.5 美元、為年齡介乎 26 至 40 歲的用戶出價 3.5 美元,並為所有其他用戶出價 5 美元。請注意:預設值為選用項目。您可以將乘數設定為 1.0

範例

{
    "user_groups": {
      "age": {
        "18-25": 0.5,
        "26-40": 0.7,
        "default": 1.0
      }
    }
}

booking_window

可能的資料細節值包括任何大於或等於 1 的整數範圍,如 1-34-9 等。

範例

curl -X POST \ 
  -F 'bid_adjustments=
     {"user_groups":{"booking_window":{"event_sources":["123456789"],"1-2":0.1,"3-5":0.2,"default":0.5}}}' \ 
  -F 'access_token='$access_token \ 
  https://graph.facebook.com/<API_VERSION>/<ad_set_id>

另請參閱旅程乘數因數範例

custom_audience

由 2023 年 1 月 30 日起,系統便不會再向選擇不接收通知的用戶刊登使用出價乘數因數且含有第三方資料類別(booking_windowcustom_audience(包括類似自訂廣告受眾)、lengthofstaytravelstartdatetravelstartdayofweekuser_recencyuser_bucket)的廣告。

您可以根據自訂廣告受眾調整出價。

範例

curl -X POST \ 
  -F 'bid_adjustments=
     {"user_groups":{"custom_audience":{"<CUSTOM_AUDIENCE_ID>":0.8, "<CUSTOM_AUDIENCE_ID>":1.0, "default":0.5}}}' \ 
  -F 'access_token='$access_token \ 
  https://graph.facebook.com/<API_VERSION>/<ad_set_id>

device_platform

可能的資料細節值如下:

  • mobile
  • desktop

範例

{
  "user_groups": {
    "device_platform": {
      "mobile": 0.7,
      "desktop": 0.9
    }
  }
}

gender

按性別為用戶分組。

範例

{
  "user_groups": {
    "gender": {
      "male": 0.5,
      "female": 0.7,
      "default": 1.0
    }
  }
}

home_location

可能的資料細節值如下:

  • city id
  • region id
  • 2 位數的國碼/區碼

您可在搜尋 API 中找到 city idregion id。您可以從 Graph API 測試工具或終端機查詢相關資料。

備註:只能在 home_location 中設定 default,不能透過 citiesregionscountries 設定。

範例

{
  "user_groups": {
    "home_location": {
      "cities": {
         "2420605": 0.2
      },
      "regions": {
         "3847": 0.5
      },
      "countries": {
         "US": 0.2
      },
      "default": 0.8
     }
  }
}

length_of_stay

可能的資料細節值包括任何大於或等於 1 的整數範圍,如 “1-3”“4-9” 等。

範例

curl -X POST \ 
  -F 'bid_adjustments=
  {"user_groups":{"length_of_stay":{"event_sources":["123456789"],"1-2":0.1,"3-     5":0.2,"default":0.5}}}' \ 
  -F 'access_token='$access_token \ 
  https://graph.facebook.com/<API_VERSION>/<ad_set_id>

另請參閱旅程乘數因數範例

locale

您可使用地區或地區群組編號,例如 6 代表英文(美國)、5 代表德文。

您可透過目標指定搜尋:地區,使用 type=adlocale 尋找地區編號。例如:

{
  "user_groups": {
    "locale": {
      6: 0.8,
      5: 0.3
    }
  }
}

position_type

此類別與目標指定 API 的版位選項十分相似。可能的資料細節值如下:

廣告版位

Facebook 動態消息

facebook_feed

Facebook Marketplace

facebook_marketplace

Facebook 影片動態消息

facebook_suggested_video

Facebook 右欄

facebook_right_hand_column

Facebook 商家探索

facebook_biz_disco_feed

Instagram 動態消息

instagram_stream

Instagram 個人檔案動態消息

instagram_profile_feed

Instagram 探索

instagram_explore

Instagram 探索主頁

instagram_explore_home

Messenger 收件匣

messenger_messenger_home

Instagram 限時動態

instagram_story

Facebook 限時動態

facebook_story

Messenger 限時動態

messenger_story

Instagram Reels

instagram_reels

Facebook Reels

facebook_facebook_reels

Facebook 插播影片

facebook_instream_video

Facebook Reels 廣告

facebook_facebook_reels_overlay

Facebook 搜尋結果

facebook_search

Instagram 搜尋結果

instagram_ig_search

Messenger 贊助訊息

不支援

Audience Network 原生、橫額及插頁版位

audience_network_classic

Audience Network 獎勵式影片

audience_network_rewarded_video

Audience Network 插播影片

不支援

範例

{
  "user_groups": {
    "position_type":{
        "facebook_feed":0.9,
        "messenger_messenger_home":0.7,
        "instagram_stream":0.8,
        "audience_network_classic":0.5,
        "default":0.4
    }
  }
}

publisher_platform

可能的資料細節值如下:

  • facebook
  • instagram
  • audience_network
  • messenger

範例

{
  "user_groups": {
    "publisher_platform": {
      "facebook": 0.7,
      "instagram": 0.9,
      "default": 1.0 // We'll apply bid multiplier 1.0 if no default is specified anyway
    }
  }
}

travel_start_date

可能的資料細節值包括任何格式為 _yyyymmdd_-_yyyymmdd_ 的日期範圍。

範例

curl -X POST \ 
  -F 'bid_adjustments=
     {"user_groups":{"travel_start_date":{"event_sources":["123456789"],"20180901-20181001":0.2,"default":0.9}}}' \ 
  -F 'access_token='$access_token \ 
  https://graph.facebook.com/<API_VERSION>/<ad_set_id>

另請參閱旅程乘數因數範例

travel_start_day_of_week

可能的資料細節值包括任何介乎 0 至 6 之間的整數(包含 0 和 6 在內),0 表示星期一;6 表示星期日。

範例

curl -X POST \ 
  -F 'bid_adjustments=
  {"user_groups":{"travel_start_day_of_week":{"event_sources":        ["123456789"],"0":0.1,"2":0.2,"6":0.3,"default":0.9}}}' \ 
  -F 'access_token='$access_token \ 
  https://graph.facebook.com/<API_VERSION>/<ad_set_id>

另請參閱旅程乘數因數範例

user_bucket

您可以向我們傳送自己的用戶分類結果。然後,您可透過觸發像素事件或應用程式事件,向我們傳送額外的 user_bucket 參數。用戶組別為介乎 0 至 100 之間的整數。

請以下列格式指定用戶組別群組的定義:

  • event_sources — 要追蹤的觸發像素事件或應用程式事件。
  • event_retention — 選用項目。略過原有 user_bucket 值的時限(以秒為單位)。
  • events_dedup_mode — 選用項目。此為一個標示,用來表明當單一事件來源為同一個用戶傳送不同 user_bucket 值時,系統應使用哪個 user_bucket。預設值為 latest
  • event_source_preference—選用項目。此為一個旗幟,用來表明當多個事件來源為同一個用戶傳送不同 user_bucket 值時,系統應使用哪個 user_bucket。預設值為 latest

範例

{
  "user_groups": {
   "user_bucket": {
      "event_sources": [<pixel_id>,<app_id>,...],
      "event_retention": 604800, // optional, exclude old events
      
      //optional, useful when multiple event sources have user_bucket
      "events_dedup_mode": "max"|"min"|"latest",
      
      //optional, dedup user_bucket values sent from one single event source
      "event_source_preference": "max"|"min"|"latest",
      
      "1":0.7, // these are the bid multipliers
      "2":1.0,
     }
  }
}

user_device

可能的資料細節值如下:

  • iPad
  • iPhone

查看目標指定搜尋 API,以了解 type=adTargetingCategoryclass=user_device 的其他可能值。

範例

{
  "user_groups": {
    "user_device": {
      "iPad": 0.7,
      "iPhone": 0.9,
      "default": 1.0
    }
  }
}

範例

curl
  -F 'name=Test BM Adset '$(date +%s) \
  -F 'bid_amount=3000' \
  -F 'billing_event=IMPRESSIONS' \
  -F 'optimization_goal=OFFSITE_CONVERSIONS' \
  -F 'daily_budget=15000' \
  -F 'campaign_id=23843038336220329' \
  -F 'promoted_object={"product_set_id":"267888283975766"}' \
  -F 'targeting={
     "geo_locations": {"countries":["AQ"]},
     "dynamic_audience_ids": ["23842885952670329"],
     "publisher_platforms": ["facebook"]
    }' \
  -F 'bid_adjustments={"user_groups":{"user_device": {"iPad": 0.7, "iPhone": 0.9, "default": 1.0}}}' \
  -F 'status=PAUSED' \
  -F 'access_token='$access_token \
  https://graph.facebook.com/<API_VERSION>/act_1653439931385336/adsets

範例

curl
  -F 'name=Test BM Adset '$(date +%s) \
  -F 'bid_amount=3000' \
  -F 'billing_event=IMPRESSIONS' \
  -F 'optimization_goal=OFFSITE_CONVERSIONS' \
  -F 'daily_budget=15000' \
  -F 'campaign_id=23843038336220329' \
  -F 'promoted_object={"product_set_id":"267888283975766"}' \
  -F 'targeting={
     "geo_locations": {"countries":["AQ"]},
     "dynamic_audience_ids": ["23842885952670329"],
     "publisher_platforms": ["facebook"]
     }' \
  -F 'bid_adjustments={"user_groups":{"user_device": {"iPad": 0.7, "iPhone": 0.9, "default": 1.0}}}' \
  -F 'status=PAUSED' \
  -F 'access_token='$access_token \
   https://graph.facebook.com/<API_VERSION>/act_1653439931385336/adsets
   {"id":"23843038339320329"}

範例

curl
  -F 'access_token='$access_token \
  https://graph.facebook.com/VERSION/ID?fields=bid_adjustments
  {"bid_adjustments":{"user_groups":"{\"user_device\":    {\"default\":1,\"iPad\":0.7,\"iPhone\":0.9}}"},"id":"ID"}

另請參閱進階範例

user_group_weight_spec

可能的資料細節值如下:

  • age
  • gender
  • device_platform
  • publisher_platform
  • user_device
  • user_os

另請參閱進階範例

範例user_group_weight_spec 為如下所示的 JSON 結構:

{
  <BREAKDOWN_NAME>: {
    <BREAKDOWN_VALUE_1>: <WEIGHT_VALUE> OR <NESTED_USER_GROUP_WEIGHT_SPEC>,
    <BREAKDOWN_VALUE_2>: <WEIGHT_VALUE> OR <NESTED_USER_GROUP_WEIGHT_SPEC>,
    <BREAKDOWN_VALUE_3>: <WEIGHT_VALUE> OR <NESTED_USER_GROUP_WEIGHT_SPEC>,
    ...
    "default": <WEIGHT_VALUE> OR <NESTED_USER_GROUP_WEIGHT_SPEC>, // optional, if not specified, we'll use 1.0
  }
}
{
  "age": {
    "18-25": 0.7,
    "26-35": {
      "gender": {
        "male": 0.9,
        "female": 1.0
      }
    },
    "default": 0.85
  }
}

* For users between the ages of 18 and 25, we apply bid multiplier 0.7.
* For male users between the ages of 26 and 35, we apply bid multiplier 0.9.
* For female users between the ages of 26 and 35, we apply bid multiplier 1.0.
* For all other users, we apply bid multiplier 0.85.

資料細節值為整數年齡範圍,如 18 至 25 歲,其中年齡下限為 18 歲,而且年齡範圍不得重疊。

範例

{
  "user_groups": {
    "age": {
      "18-25": 0.7,
      "30-40": 1.0,
      "default": 0.3
    }
  }
}

進階範例

> curl 
    -F 'bid_adjustments={"user_groups":{"user_device":{"iPad":0.3,"iPhone":{"user_os":{"Android":0.3,"iOS":{"age":{"18-35":0.3,"35-45":0.4}}}}}}}' -F access_token=$token https://graph.intern.facebook.com/v2.12/6089875504114
{"success":true}%
> curl -G 
   -d access_token=$token https://graph.intern.facebook.com/v2.12/6089875504114\?  fields\=bid_adjustments
{"bid_adjustments":{"user_groups":"{\"user_device\":{\"iPad\":0.3,\"iPhone\":{\"user_os\":{\"Android\":0.3,\"iOS\":{\"age\":{\"18-35\":0.3,\"35-45\":0.4}}}}}}"},"id":"6089875504114"}%

旅行乘數範例

curl -X POST \
  -F 'bid_adjustments={"user_groups":{"travel_start_day_of_week":{"event_sources":["1862565504034757"],"1":0.1,"3":0.1,"default":0.9}}}' \
  -F 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/<API_VERSION>/<ADSET_ID>

  Length of Stay 'bid_adjustments={"user_groups":{"length_of_stay":{"event_sources":["1862565504034757"],"1-2":0.1,"3-7":0.2,"default":0.5}}}'
  Booking window 'bid_adjustments={"user_groups":{"booking_window":{"event_sources":["1862565504034757"],"1-2":0.1,"3-7":0.2,"default":0.5}}}'
  Travel start date: 'bid_adjustments={"user_groups":{"travel_start_date":{"event_sources":["1862565504034757"],"20180918-20190101":0.1,"default":0.5}}}'
  Day of week: 'bid_adjustments={"user_groups":{"travel_start_day_of_week":{"event_sources":["1862565504034757"],"1":0.1,"2":0.1,"0":0.2,"default":0.5}}}'

user_os

可能的資料細節值如下:

  • iOS
  • Windows

查看目標指定搜尋 API,以了解 type=adTargetingCategoryclass=user_os 的其他可能值。

目前支援的值如下:

  • Android
  • Windows
  • Windows Phone
  • iOS

範例

{
  "user_groups": {
    "user_os": {
      "Android": 0.7,
      "iOS": 0.9,
      "default": 1.0
    }
  }
}

iOS14 影響

iOS 14 政策變動是否會影響網站轉換宣傳活動的出價乘數?

是,我們預計 iOS 14 的政策變動會導致訊號損失和歸因更難識別,從而導致每個廣告組合的訊號減少。您可出價的大多數類別應能繼續照常運作,但如果要將 iOS 14.5 用戶設定為目標廣告受眾,時間順序、自訂廣告受眾和 user_bucket 的乘數會受影響,因為這些乘數因素根據 Facebook 像素或轉換 API 評估的事件而定。所有其他乘數均來自站內資料,不依賴於 Facebook 像素或轉換 API。

user_recency

由於用戶擁有觸發像素事件或應用程式事件而按時間為用戶分組。請務必指定要追蹤的事件來源和時段。

範例

此範例展示了如何為在 86400 秒內獲得觸發像素事件或應用程式事件的用戶套用 1.0 的出價乘數,如此類推。

{
  "user_groups": {
    "user_recency": {
      "event_sources": [<pixel_id>,<app_id>,...],
      "0-86400": 1.0,
      "86401-172800": 0.7,
      "default": 0.5
    }
  }
}

串聯多個資料細節

您亦可以進一步指定資料細節,以棄用浮動的出價乘數,從而定義含有多個資料細節的用戶群組。例如,如果廣告組合的出價上限為 5 美元或以下,其配置將如下所示:

  • 為男性用戶出價 4.5 美元
  • 為年齡介乎 18 至 25 歲的女性用戶出價 3.5 美元
  • 為年齡介乎 26 至 35 歲的女性用戶出價 4.0 美元
  • 為所有其他用戶出價 5.0 美元
{
  "user_groups": {
    "gender": {
      "male": 0.9,
      "female": {
        "age": {
          "18-25": 0.7,
          "26-35": 0.8
        }
      }
    }
  }
}

使用要求

  • 出價乘數的值可介乎 0.091.0

API 呼叫

獲取

curl -G \
  -d 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/<API_VERSION>/<ADSET_ID>?fields=bid_adjustments

更新

curl \
  -F 'bid_adjustments={"user_groups":<USER_GROUP_WEIGHT_SPEC>}' \
  -F 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/<API_VERSION>/<PRODUCT_CATALOG_ID>/<ADSET_ID>

建立或更新廣告組合的出價乘數

下方是用於更新現有廣告組合的 API 呼叫範例。(您需要替換廣告組合編號、存取憑證、事件來源,以及您想要的出價乘數。)

curl -X POST \ -F 'bid_adjustments={ "user_groups": { "user_bucket": { "event_sources": [ "<PIXEL_ID>", "<APP_ID>" ], "1": 0.1, "2": 0.2, "3": 0.3, "default": { "gender": { "male": 0.99, "female": 0.12 } } } } }' \ -F 'access_token=<ACCESS_TOKEN>' \ https://graph.facebook.com/v19.0/<AD_SET_ID>/
'use strict'; const bizSdk = require('facebook-nodejs-business-sdk'); const AdSet = bizSdk.AdSet; const access_token = '<ACCESS_TOKEN>'; const app_secret = '<APP_SECRET>'; const app_id = '<APP_ID>'; const id = '<AD_SET_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 = { 'bid_adjustments' : {'user_groups':{'user_bucket':{'event_sources':['<pixelID>','<appID>'],'1':0.1,'2':0.2,'3':0.3,'default':{'gender':{'male':0.99,'female':0.12}}}}}, }; const sample_code = (new AdSet(id)).update( fields, params ); logApiCallResult('sample_code api call complete.', sample_code);
require __DIR__ . '/vendor/autoload.php'; 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_SET_ID>'; $api = Api::init($app_id, $app_secret, $access_token); $api->setLogger(new CurlLogger()); $fields = array( ); $params = array( 'bid_adjustments' => array('user_groups' => array('user_bucket' => array('event_sources' => array('<pixelID>','<appID>'),'1' => 0.1,'2' => 0.2,'3' => 0.3,'default' => array('gender' => array('male' => 0.99,'female' => 0.12))))), ); echo json_encode((new AdSet($id))->updateSelf( $fields, $params )->exportAllData(), JSON_PRETTY_PRINT);
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_SET_ID>' FacebookAdsApi.init(access_token=access_token) fields = [ ] params = { 'bid_adjustments': {'user_groups':{'user_bucket':{'event_sources':['<pixelID>','<appID>'],'1':0.1,'2':0.2,'3':0.3,'default':{'gender':{'male':0.99,'female':0.12}}}}}, } print AdSet(id).update( 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_SET_ID>\"; APIContext context = new APIContext(access_token).enableDebug(true); new AdSet(id, context).update() .setBidAdjustments(\"{\\"user_groups\\":{\\"user_bucket\\":{\\"event_sources\\":[\\"<pixelID>\\",\\"<appID>\\"],\\"1\\":0.1,\\"2\\":0.2,\\"3\\":0.3,\\"default\\":{\\"gender\\":{\\"male\\":0.99,\\"female\\":0.12}}}}}\") .execute(); } }
require 'facebook_ads' access_token = '<ACCESS_TOKEN>' app_secret = '<APP_SECRET>' app_id = '<APP_ID>' id = '<AD_SET_ID>' FacebookAds.configure do |config| config.access_token = access_token config.app_secret = app_secret end ad_set = FacebookAds::AdSet.get(id) ad_set.bid_adjustments = {'user_groups':{'user_bucket':{'event_sources':['<pixelID>','<appID>'],'1':0.1,'2':0.2,'3':0.3,'default':{'gender':{'male':0.99,'female':0.12}}}}} ad_set.save

設定測試宣傳活動

與 Meta 帳戶團隊及成效衡量主管合作,透過轉換提升或分組測試建立測試宣傳活動。如要評估成效,我們建議根據以下 3 個組別進行分組測試:

  • 組別 1(控制組 A)、宣傳活動 1 — 為所有指定目標用戶採用擁有 1 個出價的單一廣告組合
  • 組別 2(控制組 B)、宣傳活動 2 — 採用多個廣告組合,而且為每個用戶群組建立各自的廣告組合(您可以根據像素/應用程式參數,使用網站/流動自訂廣告受眾規則細分受眾)。
  • 組別 3(測試)、宣傳活動 3—採用單一廣告組合,其中不同用戶群組使用不同的出價乘數。請確保此處每個用戶群組所使用的已調整出價與組別 2 對應廣告組合的廣告組合級別出價相同

設定分組測試

在這個階段,您應該設定分組測試組與對照組,從而使用出價乘數驗證成效。我們會運行測試 1 至 2 週,而且您無需提供最低預算。按照以下形式設定分組測試:

  • 組別 1(控制組 A)應該包括擁有一個出價金額的單一廣告組合,並應根據所有 user_bucket 設定目標受眾。
  • 組別 2(控制組 B)應該包含多個廣告組合,其中每個 user_bucket 設有一個廣告組合。每個廣告組合均應將目標指定為獨立的 user_bucket 及相應的出價。您可以使用網站或流動自訂廣告受眾規則,根據其他 Meta 像素與應用程式事件參數,以進一步細分廣告受眾。請參閱網站自訂廣告受眾流動應用程式自訂廣告受眾
  • 組別 3(測試)包含一個擁有 bid_adjustment 屬性的廣告組合,以決定每個 user_bucket 的不同出價。您的乘數應與組別 2、控制組 B 的獨立廣告組合出價相符。

詳情請參閱分組測試

設定測試宣傳活動

按照設定一般宣傳活動的方式,設定一個宣傳活動。請聯絡 Meta 代表,以獲取有關設定出價調整的協助。

為每組設定 user_groups 和不同的出價乘數。您的群組均基於人口統計資料屬性(如年齡、性別)或特定屬性(如用戶得分或忠誠計劃)而定。例如:

{
   "user_bucket":{
      "business_id":253286871795863,
      "1":0.7,
      "2":1.0,
      "3":{
         "gender":{
            "male":1.0,
            "female":0.8
         }
      },
      "default": 0.9
   }
}

在這個範例中:

  • 用戶的 loyalty_program 值若是 1,則應套用 0.7 的出價乘數
  • 用戶的 loyalty_program 值若是 2,則應套用 1.0 的出價乘數
  • 男性用戶的 loyalty_program 值若是 3,則應套用 1.0 的出價乘數
  • 女性用戶的 loyalty_program 值若是 3,則應套用 0.8 的出價乘數
  • 用戶的 loyalty_program 值若非 1、2 或 3,則應套用 0.9 的出價乘數
  • 若是所有其他用戶,則應套用 1.0 的出價乘數

現在,您便可以建立宣傳活動了:

curl -X POST \ -F 'name="My Adset with bid multiplier"' \ -F 'campaign_id="<AD_CAMPAIGN_ID>"' \ -F 'daily_budget=3000' \ -F 'billing_event="IMPRESSIONS"' \ -F 'optimization_goal="OFFSITE_CONVERSIONS"' \ -F 'bid_amount=500' \ -F 'bid_adjustments={ "user_groups": { "gender": { "male": 0.8, "female": 1 } } }' \ -F 'promoted_object={ "product_set_id": "<PRODUCT_SET_ID>", "custom_event_type": "ADD_TO_CART" }' \ -F 'targeting={ "facebook_positions": [ "feed" ], "geo_locations": { "countries": [ "US" ] } }' \ -F 'status="PAUSED"' \ -F 'access_token=<ACCESS_TOKEN>' \ https://graph.facebook.com/v19.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 Adset with bid multiplier', 'campaign_id' : '<adCampaignLinkClicksID>', 'daily_budget' : '3000', 'billing_event' : 'IMPRESSIONS', 'optimization_goal' : 'OFFSITE_CONVERSIONS', 'bid_amount' : '500', 'bid_adjustments' : {'user_groups':{'gender':{'male':0.8,'female':1}}}, 'promoted_object' : {'product_set_id':'<productSetID>','custom_event_type':'ADD_TO_CART'}, '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 Adset with bid multiplier', 'campaign_id' => '<adCampaignLinkClicksID>', 'daily_budget' => '3000', 'billing_event' => 'IMPRESSIONS', 'optimization_goal' => 'OFFSITE_CONVERSIONS', 'bid_amount' => '500', 'bid_adjustments' => array('user_groups' => array('gender' => array('male' => 0.8,'female' => 1))), 'promoted_object' => array('product_set_id' => '<productSetID>','custom_event_type' => 'ADD_TO_CART'), '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 Adset with bid multiplier', 'campaign_id': '<adCampaignLinkClicksID>', 'daily_budget': '3000', 'billing_event': 'IMPRESSIONS', 'optimization_goal': 'OFFSITE_CONVERSIONS', 'bid_amount': '500', 'bid_adjustments': {'user_groups':{'gender':{'male':0.8,'female':1}}}, 'promoted_object': {'product_set_id':'<productSetID>','custom_event_type':'ADD_TO_CART'}, '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 Adset with bid multiplier\") .setCampaignId(\"<adCampaignLinkClicksID>\") .setDailyBudget(3000L) .setBillingEvent(AdSet.EnumBillingEvent.VALUE_IMPRESSIONS) .setOptimizationGoal(AdSet.EnumOptimizationGoal.VALUE_OFFSITE_CONVERSIONS) .setBidAmount(500L) .setBidAdjustments(\"{\\"user_groups\\":{\\"gender\\":{\\"male\\":0.8,\\"female\\":1}}}\") .setPromotedObject(\"{\\"product_set_id\\":\\"<productSetID>\\",\\"custom_event_type\\":\\"ADD_TO_CART\\"}\") .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 Adset with bid multiplier', campaign_id: '<adCampaignLinkClicksID>', daily_budget: '3000', billing_event: 'IMPRESSIONS', optimization_goal: 'OFFSITE_CONVERSIONS', bid_amount: '500', bid_adjustments: {'user_groups':{'gender':{'male':0.8,'female':1}}}, promoted_object: {'product_set_id':'<productSetID>','custom_event_type':'ADD_TO_CART'}, targeting: {'facebook_positions':['feed'],'geo_locations':{'countries':['US']}}, status: 'PAUSED', })

建立廣告組合後,透過 API 設定廣告組合的 bid_adjustments。參數應如下所示:

{
  "user_groups": {
    "user_bucket": {
      "event_sources": [<pixel_id>,<app_id>,...],
      "event_source_preference": "max"|"min"|"latest", //optional, useful when multiple event sources have user_bucket
      "events_dedup_mode": "max"|"min"|"latest", //optional, dedup user_bucket values sent from one single event source
      "event_retention": 604800, // optional, exclude old events
      "1":0.7, // these are the bid multipliers
      "2":1.0,
      "default": { // used in the case that we don't have user_bucket for that user
         gender:{ // this is a nested example, but you could just do "default": 1.0,
            "male": {
              home_location: {
                  cities: { // city id, can be found in search API, eg: search?type=adgeolocation&q=Menlo Park&limit=10
                    "2420605": 0.2,
                  },
                  regions: {
                    "3847": 0.5
                  },
                  countries: {
                    "US": 0.2
                  }
                }
              }
            },
            "female": {
              "user_recency": {
                "event_sources": [<pixel_id>,<app_id>,...],
                "0-86400": 0.5,
                "86400-172800": 0.7,
                "default": 0.2
              }
            }
         },
      },
   },
}

我們目前不會驗證此參數。請向您的 Meta 代表傳送廣告組合編號,以便我們進行手動檢查。

系統會就每個事件來源使用該用戶最近收到的 user_bucket。然而,如果指定了多個事件來源(例如:像素與應用程式),而且其中 2 個或以上的來源都有記錄各自的 user_bucket,我們便會選取其中的最大者。

下方是用於更新現有廣告組合的呼叫範例。請提供您的廣告組合編號、存取憑證、事件來源與出價乘數:

curl -X POST 
  -F access_token=<access_token> \
  -F 'bid_adjustments={"user_groups": {"user_bucket": {"event_sources": [<pixel_id>,  <app_id>,...], "1": 0.1, "2": 0.2, "3": 0.3, "default": {"gender": {"male": 0.99, "female": 0.1}} }} }' \ 
  https://graph.facebook.com/<VERSION>/<ad-set-id>