旅遊廣告

自動在 Facebook 上推廣您的旅遊庫存商品。Facebook 的旅遊廣告採用跨裝置的購買意願訊號,可自動透過 Facebook 上的不重複廣告創意,來推廣庫存中的相關旅遊選項。

旅遊廣告支援飯店廣告航班廣告,以及目的地廣告

本指南假設:

  • 您已經備妥目錄和商品組合。
  • 您已經在您的網站或行動應用程式中設定所需的旅遊事件。
  • (必要)您已經建立 Facebook 粉絲專頁廣告帳號

目標設定策略

旅遊廣告支援不同的目標設定策略。您可以將適當的廣告受眾與適當的商品組合相互結合,以推動不同的業務目標:

  • 再行銷:向曾在您網站或應用程式搜尋飯店、目的地或航班的用戶,顯示相關的飯店、目的地或航班。

  • 交叉銷售和追加銷售:鎖定已購買機票和相關飯店的用戶,或追加銷售優先登機或選位權的用戶。

  • 開發潛在顧客:鎖定潛在廣告受眾,以擴大廣告觸及人數並開發新顧客。

設定旅遊廣告

建立旅遊廣告時,應遵循的程序與使用 API 設定任何其他類型的 Facebook 廣告相同:

步驟 1:建立行銷活動

旅遊廣告使用 PRODUCT_CATALOG_SALES 目標。在行銷活動層級的 promoted_object 中,指定旅遊目錄:

use FacebookAds\Object\Campaign;
use FacebookAds\Object\Fields\CampaignFields;
use FacebookAds\Object\Values\CampaignObjectiveValues;

$campaign = new Campaign(null, 'act_<AD_ACCOUNT_ID>');
$campaign->setData(array(
  CampaignFields::NAME => 'Product Catalog Sales Campaign',
  CampaignFields::OBJECTIVE => CampaignObjectiveValues::PRODUCT_CATALOG_SALES,
  CampaignFields::PROMOTED_OBJECT => array(
    'product_catalog_id' => <PRODUCT_CATALOG_ID>,
  ),
));

$campaign->create(array(
  Campaign::STATUS_PARAM_NAME => Campaign::STATUS_PAUSED,
));
from facebookads.adobjects.campaign import Campaign

campaign = Campaign(parent_id='act_<AD_ACCOUNT_ID>')
campaign[Campaign.Field.name] = 'Product Catalog Sales Campaign'
objective = Campaign.Objective.product_catalog_sales
campaign[Campaign.Field.objective] = objective
campaign[Campaign.Field.promoted_object] = {
    'product_catalog_id': <PRODUCT_CATALOG_ID>,
}

campaign.remote_create(params={
    'status': Campaign.Status.paused,
})
Campaign campaign = new AdAccount(act_<AD_ACCOUNT_ID>, context).createCampaign()
  .setName("Product Catalog Sales Campaign Group")
  .setObjective(Campaign.EnumObjective.VALUE_PRODUCT_CATALOG_SALES)
  .setPromotedObject("{\"product_catalog_id\":\"" + <PRODUCT_CATALOG_ID> + "\"}")
  .setStatus(Campaign.EnumStatus.VALUE_PAUSED)
  .execute();
String campaign_id = campaign.getId();
curl \
  -F 'name=Product Catalog Sales Campaign' \
  -F 'objective=PRODUCT_CATALOG_SALES' \
  -F 'promoted_object={"product_catalog_id":"<PRODUCT_CATALOG_ID>"}' \
  -F 'status=PAUSED' \
  -F 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v2.11/act_<AD_ACCOUNT_ID>/campaigns

步驟 2:建立廣告組合

有了行銷活動和 campaign_id 之後,即可建立廣告組合。廣告組合定義廣告的出價和目標設定選項。

再行銷

若要再次鎖定網站或應用程式的訪客,所使用的動態廣告受眾類型應與所推廣的商品組合類型相同,例如將飯店組合推廣給飯店廣告受眾、將航班組合推廣給航班廣告受眾,以及將目的地組合推廣給目的地廣告受眾。

交叉銷售和追加銷售

若要針對曾在您網站和/或應用程式上購買的用戶進行交叉銷售和追加銷售,所使用的動態廣告受眾應包含已購買過的用戶,然後再向這些用戶推廣其他目錄的旅遊選項,例如鎖定購買機票的廣告受眾投放飯店組合或強調選位權的其他航班組合。

開發潛在顧客

  • 使用基本人口統計資料目標設定建立廣告受眾,例如超過 18 歲的美國女性。
  • 包括由現有再次鎖定行銷活動所鎖定的顧客,但考慮排除在過去 10 天內曾購買的用戶。
  • 使用含有超過 100 家飯店的廣泛商品組合。
  • 利用更強的購買意願訊號最佳化 OFFSITE_CONVERSIONS,例如 PurchaseInitiateCheckout

另請參閱高效速成+ 目錄廣告:廣泛的廣告受眾目標設定

建立廣告組合範例

use FacebookAds\Object\AdSet;
use FacebookAds\Object\Fields\AdSetFields;
use FacebookAds\Object\Fields\TargetingFields;
use FacebookAds\Object\Values\AdSetBillingEventValues;
use FacebookAds\Object\Values\AdSetOptimizationGoalValues;

$adset = new AdSet(null, 'act_<AD_ACCOUNT_ID>');

$adset->setData(array(
  AdSetFields::NAME => 'Product Catalog Sales Adset',
  AdSetFields::BID_AMOUNT => 3000,
  AdSetFields::BILLING_EVENT => AdSetBillingEventValues::IMPRESSIONS,
  AdSetFields::OPTIMIZATION_GOAL =>
    AdSetOptimizationGoalValues::OFFSITE_CONVERSIONS,
  AdSetFields::DAILY_BUDGET => 15000,
  AdSetFields::CAMPAIGN_ID => <CAMPAIGN_ID>,
  AdSetFields::TARGETING => array(
    TargetingFields::GEO_LOCATIONS => array(
      'countries' => array('US'),
    ),
    TargetingFields::DYNAMIC_AUDIENCE_IDS => array(<DYNAMIC_AUDIENCE_ID>),
  ),
  AdSetFields::PROMOTED_OBJECT => array(
    'product_set_id' => <PRODUCT_SET_ID>,
  ),
));

$adset->create(array(
  AdSet::STATUS_PARAM_NAME => AdSet::STATUS_PAUSED,
));
from facebookads.adobjects.adset import AdSet
from facebookads.adobjects.targeting import Targeting

adset = AdSet(parent_id=ad_account_id)
adset[AdSet.Field.name] = 'Product Catalog Sales Adset'
adset[AdSet.Field.bid_amount] = 3000
adset[AdSet.Field.billing_event] = AdSet.BillingEvent.impressions
adset[AdSet.Field.optimization_goal] = \
    AdSet.OptimizationGoal.offsite_conversions
adset[AdSet.Field.daily_budget] = 15000
adset[AdSet.Field.campaign_id] = campaign_id
adset[AdSet.Field.targeting] = {
    Targeting.Field.geo_locations: {
        Targeting.Field.countries: ['US'],
    },
    Targeting.Field.dynamic_audience_ids: [
        dynamic_audience_id,
    ],
}
adset[AdSet.Field.promoted_object] = {
    'product_set_id': product_set_id,
}

adset.remote_create()
AdSet adSet = new AdAccount(act_<AD_ACCOUNT_ID>, context).createAdSet()
  .setName("Product Catalog Sales Adset")
  .setBidAmount(3000L)
  .setBillingEvent(AdSet.EnumBillingEvent.VALUE_IMPRESSIONS)
  .setOptimizationGoal(AdSet.EnumOptimizationGoal.VALUE_OFFSITE_CONVERSIONS)
  .setDailyBudget(15000L)
  .setCampaignId(<CAMPAIGN_ID>)
  .setTargeting(
    new Targeting()
      .setFieldDynamicAudienceIds(Arrays.asList(<DYNAMIC_AUDIENCE_ID>))
      .setFieldGeoLocations(
        new TargetingGeoLocation()
          .setFieldCountries(Arrays.asList("US"))
      )
  )
  .setPromotedObject("{\"product_set_id\":\"" + <PRODUCT_SET_ID> + "\"}")
  .setStatus(AdSet.EnumStatus.VALUE_PAUSED)
  .execute();
String ad_set_id = adSet.getId();
curl \
  -F 'name=Product Catalog Sales Adset' \
  -F 'bid_amount=3000' \
  -F 'billing_event=IMPRESSIONS' \
  -F 'optimization_goal=OFFSITE_CONVERSIONS' \
  -F 'daily_budget=15000' \
  -F 'campaign_id=<CAMPAIGN_ID>' \
  -F 'targeting={ 
    "geo_locations": {"countries":["US"]}, 
    "dynamic_audience_ids": ["<DYNAMIC_AUDIENCE_ID>"] 
  }' \
  -F 'promoted_object={"product_set_id":"<PRODUCT_SET_ID>"}' \
  -F 'status=PAUSED' \
  -F 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v2.11/act_<AD_ACCOUNT_ID>/adsets

旅遊廣告不支援廣告組合中的內嵌動態廣告受眾目標設定規格。您必須先另外建立廣告受眾

步驟 3:建立廣告創意

您可以在旅遊廣告的廣告創意中使用範本標籤。Facebook 顯示您的廣告時,會以用戶的實際旅遊選擇,取代範本標籤。您可以在廣告本身以及用戶點擊廣告後所看到的網址中使用範本標籤。

使用 template_url_spec 欄位指定用戶點擊廣告後所顯示的網址。如果沒有提供網址,或者我們在呈現廣告時無法衍生網址,則會顯示目錄中的網址。針對航班廣告,如果您沒有在目錄中提供網址,就必須填寫此欄位

您可以顯示單一商品或包含多個商品的輪播廣告。若在輪播廣告中選擇顯示單一商品廣告,同一商品可以顯示多張圖像(假設目錄內的各種商品都有多張圖像)。您還可顯示靜態圖卡來搭配動態圖卡。如需廣告創意選項的詳細資訊,請參閱高效速成+ 目錄廣告:建立廣告創意範本

下列範例說明如何建立飯店廣告的輪播廣告創意。目的地廣告航班廣告的設定方法相似。

use FacebookAds\Object\AdCreative;
use FacebookAds\Object\Fields\AdCreativeFields;
use FacebookAds\Object\Fields\AdCreativeLinkDataFields;
use FacebookAds\Object\Fields\AdCreativeObjectStorySpecFields;
use FacebookAds\Object\Values\AdCreativeCallToActionTypeValues;
use FacebookAds\Object\AdCreativeObjectStorySpec;
use FacebookAds\Object\AdCreativeLinkData;

$object_story_spec = new AdCreativeObjectStorySpec();
$object_story_spec->setData(array(
  AdCreativeObjectStorySpecFields::PAGE_ID => <PAGE_ID>,
  AdCreativeObjectStorySpecFields::TEMPLATE_DATA =>
    (new AdCreativeLinkData())->setData(array(
      AdCreativeLinkDataFields::MESSAGE =>
        'Book your upcoming stay in {{hotel.city}}',
      AdCreativeLinkDataFields::NAME => '{{hotel.name | titleize}}',
      AdCreativeLinkDataFields::LINK => '<LINK>',
      AdCreativeLinkDataFields::DESCRIPTION =>
        '{{hotel.description}}',
      AdCreativeLinkDataFields::ADDITIONAL_IMAGE_INDEX => 0,
      AdCreativeLinkDataFields::CALL_TO_ACTION => array(
        'type' => AdCreativeCallToActionTypeValues::BOOK_TRAVEL,
      ),
    )),
));

$creative = new AdCreative(null, 'act_<AD_ACCOUNT_ID>');
$creative->setData(array(
  AdCreativeFields::NAME => 'Dynamic Ad Template Creative Sample',
  AdCreativeFields::OBJECT_STORY_SPEC => $object_story_spec,
  AdCreativeFields::TEMPLATE_URL_SPEC =>
    array(
      'config' => array(
        'app_id' => '123456789012345',
      ),
      'ios' => array(
        'url' => 'example://home/hotel'.
          '?id={{hotel.hotel_id | urlencode}}'.
          '&startDate={{trip.checkin_date date_format:Y-m-d | urlencode}}'.
          '&endDate={{trip.checkout_date date_format:Y-m-d | urlencode}}',
      ),
      'web' => array(
        'url' => 'http://www.example.com/hotel'.
          '?id={{hotel.hotel_id | urlencode}}'.
          '&startDate={{trip.checkin_date date_format:Y-m-d | urlencode}}'.
          '&endDate={{trip.checkout_date date_format:Y-m-d | urlencode}}',
      )
    ),
  AdCreativeFields::PRODUCT_SET_ID => <PRODUCT_SET_ID>,
));

$creative->create();
from facebookads.adobjects.adcreative import AdCreative
from facebookads.adobjects.adcreativeobjectstoryspec \
    import AdCreativeObjectStorySpec

story = AdCreativeObjectStorySpec()
story[story.Field.page_id] = <PAGE_ID>
story[story.Field.template_data] = {
    'message': 'Book your upcoming stay in {{hotel.city}}',
    'name': '{{hotel.name | titleize}}',
    'link': '<LINK>',
    'description': '{{hotel.description}}',
    'additional_image_index': 0,
    'call_to_action': {
        'type': 'BOOK_TRAVEL',
    },
}

creative = AdCreative(parent_id='act_<AD_ACCOUNT_ID>')
creative[AdCreative.Field.name] = 'Dynamic Ad Template Creative Sample'
creative[AdCreative.Field.object_story_spec] = story
template_url = ('http://www.example.com/hotel.aspx?id={{hotel.hotel_id}}'
                '&startDate={{trip.checkin_date date_format:Y-m-d}}'
                '&endDate={{trip.checkout_date date_format:Y-m-d}}')
creative[AdCreative.Field.template_url] = template_url
creative[AdCreative.Field.product_set_id] = <PRODUCT_SET_ID>
creative.remote_create()
curl \
  -F 'name=Dynamic Ad Template Creative Sample' \
  -F 'object_story_spec={ 
    "page_id": "<PAGE_ID>", 
    "template_data": { 
      "additional_image_index": 0, 
      "call_to_action": {"type":"BOOK_TRAVEL"}, 
      "description": "{{hotel.description}}", 
      "link": "<LINK>", 
      "message": "Book your upcoming stay in {{hotel.city}}", 
      "name": "{{hotel.name | titleize}}" 
    } 
  }' \
  -F 'template_url_spec={ 
    "config": {"app_id":"123456789012345"}, 
    "ios": { 
      "url": "example:\/\/home\/hotel?id={{hotel.hotel_id | urlencode}}&startDate={{trip.checkin_date date_format:Y-m-d | urlencode}}&endDate={{trip.checkout_date date_format:Y-m-d | urlencode}}" 
    }, 
    "web": { 
      "url": "http:\/\/www.example.com\/hotel?id={{hotel.hotel_id | urlencode}}&startDate={{trip.checkin_date date_format:Y-m-d | urlencode}}&endDate={{trip.checkout_date date_format:Y-m-d | urlencode}}" 
    } 
  }' \
  -F 'product_set_id=<PRODUCT_SET_ID>' \
  -F 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v2.11/act_<AD_ACCOUNT_ID>/adcreatives

航班追加銷售(只適用於 API 2.10 以上版本)

向已購買航班的廣告受眾追加銷售選項,例如選位或優先登機:

  1. 提供廣告受眾,只包含 PURCHASE 事件。
  2. (建議)在廣告創意的 recommender_settings 中指定 PURCHASE 事件,用於推薦廣告。
curl \
  -F 'name=Advantage+ Catalog Ad Template Creative Up-sell Sample' \
  -F 'object_story_spec={ 
    "page_id": "<PAGE_ID>", 
    "template_data": { 
      "additional_image_index": 0, 
      "call_to_action": {"type":"LEARN_MORE"}, 
      "description": "{{flight.description}}", 
      "link": "<LINK>", 
      "message": "Book extra leg room on your flight from {{flight.origin_city}} to {{flight.destination_city}}", 
    } 
  }' \
  -F 'template_url_spec={ 
    "config": {"app_id":"<APP_ID>"}, 
    "ios": { 
      "url": "example:\/\/home\/flight?id={{flight.origin_airport}}&startDate={{trip.departing_departure_date date_format:Y-m-d | urlencode}}&endDate={{trip.returning_departure_date date_format:Y-m-d | urlencode}}" 
    }, 
    "web": { 
      "url": "http:\/\/www.example.com\/flight?id={{flight.origin_airport}}&startDate={{trip.checkin_date date_format:Y-m-d | urlencode}}&endDate={{trip.returning_departure_date date_format:Y-m-d | urlencode}}" 
    } 
  }' \
  -F 'product_set_id=<FLIGHT_SET_ID>' \
  -F 'recommender_settings'={"preferred_events":["Purchase"]}\ 
  -F 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/VERSION/act_<AD_ACCOUNT_ID>/adcreatives

疊壓文字設計

疊壓文字可讓廣告商為高效速成+ 目錄廣告中的每項商品加上定價資訊(以直接價格或折扣形式)。

依目錄類型的疊壓文字選項

您可以依據用於廣告組合的目錄類型使用下列疊壓文字類型:

  • 飯店:pricestrikethrough% off
  • 目的地:price
  • 航班:price

備註:上述疊壓文字選項支援每個目錄類型中所有與價格相關的範本標籤。若要查看每個目錄類型的範本標籤,請參閱飯店目的地以及航班

疊壓文字設計選項

定價資訊是隨著摘要中的價格和銷售價格欄位而動態擷取。廣告商可從下列自訂項目中選擇高效速成+ 目錄廣告疊壓文字:

  • 形狀:膠囊狀、圓形和三角形。
  • 位置:固定 4 角:TOP_LEFTTOP_RIGHTBOTTOM_LEFTBOTTOM_RIGHT。三角形僅支援 TOP_LEFTTOP_RIGHT
  • 字型:預設字型清單,例如 Droid Serif、Open Sans 等等。
  • 支援的疊壓文字類型:pricestrikethrough% off備註strikethrough% off 只適用於飯店。

深入瞭解如何加入疊壓文字

範例:飯店廣告的價格疊壓文字加上刪除線

curl \
  -F 'name=Test Templates in Overlay' \
  -F 'object_story_spec={
    "page_id": "<PAGE_ID>",
    "template_data": {
      "description": "Description",
      "link": "<LINK>", 
      "name": "Name: {{hotel.name}}",
      "message" : "Come visit {{hotel.city}}!",
      "image_overlay_spec": {
        "overlay_template":"pill_with_text",
        "text_font":"droid_serif_regular",
        "text_type":"strikethrough_price",
        "position":"top_left",
        "theme_color":"background_e50900_text_ffffff",
        "float_with_margin":"true",
        "text_template_tags": ["{{hotel.price round}}", "{{hotel.sale_price round}}"],
      }
    }
  }' \
  -F 'product_set_id=<PRODUCT_SET_ID>' \
  -F 'template_url=http://www.example.com' \
  -F 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v2.10/act_897427477067185/adcreatives

若要建立廣告,請使用 ad_set_idcreative_id

curl -X POST \ -F 'name="My Ad"' \ -F 'adset_id="<AD_SET_ID>"' \ -F 'creative={ "creative_id": "<CREATIVE_ID>" }' \ -F 'status="PAUSED"' \ -F 'access_token=<ACCESS_TOKEN>' \ https://graph.facebook.com/v21.0/act_<AD_ACCOUNT_ID>/ads
'use strict'; const bizSdk = require('facebook-nodejs-business-sdk'); const AdAccount = bizSdk.AdAccount; const Ad = bizSdk.Ad; 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 Ad', 'adset_id' : '<adSetID>', 'creative' : {'creative_id':'<adCreativeID>'}, 'status' : 'PAUSED', }; const ads = (new AdAccount(id)).createAd( fields, params ); logApiCallResult('ads api call complete.', ads);
require __DIR__ . '/vendor/autoload.php'; use FacebookAds\Object\AdAccount; use FacebookAds\Object\Ad; 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 Ad', 'adset_id' => '<adSetID>', 'creative' => array('creative_id' => '<adCreativeID>'), 'status' => 'PAUSED', ); echo json_encode((new AdAccount($id))->createAd( $fields, $params )->exportAllData(), JSON_PRETTY_PRINT);
from facebook_business.adobjects.adaccount import AdAccount from facebook_business.adobjects.ad import Ad 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 Ad', 'adset_id': '<adSetID>', 'creative': {'creative_id':'<adCreativeID>'}, 'status': 'PAUSED', } print AdAccount(id).create_ad( 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).createAd() .setName(\"My Ad\") .setAdsetId(<adSetID>L) .setCreative( new AdCreative() .setFieldId(\"<adCreativeID>\") ) .setStatus(Ad.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) ads = ad_account.ads.create({ name: 'My Ad', adset_id: '<adSetID>', creative: {'creative_id':'<adCreativeID>'}, status: 'PAUSED', })

後續步驟

預覽廣告

您可以使用廣告預覽 API 產生高效速成+ 廣告創意的預覽內容。包含 product_item_ids 參數可指定要在預覽中顯示的目錄項目。

使用廣告預覽 API 產生廣告的預覽內容。包含 product_item_ids 可指定要在預覽中顯示的目錄項目,start_dateend_date 可指定特定日期。

curl -X GET \ -d 'ad_format="DESKTOP_FEED_STANDARD"' \ -d 'product_item_ids=[ "<PRODUCT_ITEM_ID>" ]' \ -d 'access_token=<ACCESS_TOKEN>' \ https://graph.facebook.com/v21.0/<CREATIVE_ID>/previews
'use strict'; const bizSdk = require('facebook-nodejs-business-sdk'); const AdCreative = bizSdk.AdCreative; const AdPreview = bizSdk.AdPreview; const access_token = '<ACCESS_TOKEN>'; const app_secret = '<APP_SECRET>'; const app_id = '<APP_ID>'; const id = '<AD_CREATIVE_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 = { 'ad_format' : 'DESKTOP_FEED_STANDARD', 'product_item_ids' : ['<productItemID>'], }; const previewss = (new AdCreative(id)).getPreviews( fields, params ); logApiCallResult('previewss api call complete.', previewss);
require __DIR__ . '/vendor/autoload.php'; use FacebookAds\Object\AdCreative; use FacebookAds\Object\AdPreview; use FacebookAds\Api; use FacebookAds\Logger\CurlLogger; $access_token = '<ACCESS_TOKEN>'; $app_secret = '<APP_SECRET>'; $app_id = '<APP_ID>'; $id = '<AD_CREATIVE_ID>'; $api = Api::init($app_id, $app_secret, $access_token); $api->setLogger(new CurlLogger()); $fields = array( ); $params = array( 'ad_format' => 'DESKTOP_FEED_STANDARD', 'product_item_ids' => array('<productItemID>'), ); echo json_encode((new AdCreative($id))->getPreviews( $fields, $params )->getResponse()->getContent(), JSON_PRETTY_PRINT);
from facebook_business.adobjects.adcreative import AdCreative from facebook_business.adobjects.adpreview import AdPreview from facebook_business.api import FacebookAdsApi access_token = '<ACCESS_TOKEN>' app_secret = '<APP_SECRET>' app_id = '<APP_ID>' id = '<AD_CREATIVE_ID>' FacebookAdsApi.init(access_token=access_token) fields = [ ] params = { 'ad_format': 'DESKTOP_FEED_STANDARD', 'product_item_ids': ['<productItemID>'], } print AdCreative(id).get_previews( 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_CREATIVE_ID>\"; APIContext context = new APIContext(access_token).enableDebug(true); new AdCreative(id, context).getPreviews() .setAdFormat(AdPreview.EnumAdFormat.VALUE_DESKTOP_FEED_STANDARD) .setProductItemIds(\"[\\"<productItemID>\\"]\") .execute(); } }
require 'facebook_ads' access_token = '<ACCESS_TOKEN>' app_secret = '<APP_SECRET>' app_id = '<APP_ID>' id = '<AD_CREATIVE_ID>' FacebookAds.configure do |config| config.access_token = access_token config.app_secret = app_secret end ad_creative = FacebookAds::AdCreative.get(id) previewss = ad_creative.previews({ fields: { }, ad_format: 'DESKTOP_FEED_STANDARD', product_item_ids: ['<productItemID>'], })

參數

欄位名稱和類型 說明

product_item_ids

類型:array[string]

  • 飯店:飯店 FBID 或 Base64url 編碼的飯店編號權杖清單。每個權杖均採用 hotel_catalog:{catalog_id}:{base64urlencode(hotel_id)} 形式
  • 目的地:目的地 FBID 或 Base64url 編碼的目的地編號權杖清單。每個權杖均採用 destination_catalog:{catalog_id}:{base64urlencode(destination_id)} 形式
  • 航班:航班 FBID 或 Base64url 編碼的航班編號權杖。每個權杖均採用 flight_catalog:{catalog_id}:{base64urlencode(destination_id)} 形式

start_date

類型:string

以用戶的購買意願訊號產生預覽,例如 2016-12-24。

  • 飯店的這一項會是 trip.checkin_date 的值
  • 目的地的這一項會是 trip.travel_start 的值
  • 航班的這一項會是 trip.departing_departure_date 的值

end_date

類型:string

以用戶的購買意願訊號產生預覽,例如 2017-01-01。

  • 飯店的這一項會是 trip.checkout_date 的值
  • 目的地的這一項會是 trip.travel_end 的值
  • 航班的這一項會是 trip.returning_departure_date 的值

擷取旅遊廣告洞察報告與統計資料

若要擷取旅遊物件(例如飯店)的廣告洞察報告,請對 /insights 發出 GET 呼叫。備註:請記得將 product_id 新增至 breakdown 參數。

飯店和目的地會顯示每個 hotel_iddestination_idproduct id 資料解析。航班的 product id 資料解析會顯示 origin_airport:destination_airport

擷取留言和讚

若要擷取高效速成+ 目錄廣告的留言或「讚」,請使用動態貼文 API