旅游广告

自动在 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 家酒店的广泛商品系列。
  • 使用更强烈的意向信号(如 PurchaseInitiateCheckout)针对 OFFSITE_CONVERSIONS进行优化。

另请参阅进阶赋能型目录广告 > 宽泛受众定位

创建广告组示例

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 v2.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 编码的酒店编号口令。每个口令都采用 catalog:{catalog_id}:{base64urlencode(retailer_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 调用。注意:请记住向 breakdown 参数中添加 product_id

对于酒店和目的地,将针对每个 hotel_iddestination_id 显示 product id 细分数据。对于航班,product id 细分数据将显示 origin_airport:destination_airport

获取评论和赞

如需检索进阶赋能型目录广告的评论或“赞”,请使用动态帖子 API