此指南假设您已具有目录和商品系列,并且已在您的网站或移动应用中设置好所需的汽车事件。如果没有,请参阅目录设置和事件设置。
如要创建汽车广告,您需要一个 Facebook 公共主页和一个广告账户。
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
创建广告系列并获得 campaign_id
后,您可以创建广告组。广告组可定义广告的竞价和定位选项。
如果您未指定广告组级别的 destination_type
,您广告的默认目标位置即为您目录中指定的网站网址。
要创建广告组,以促使汽车库存广告将用户带往 Facebook 站内流量目标位置,请在广告组数据中指定 destination_type FACEBOOK
。参阅使用 Facebook 站内目标位置的进阶赋能型目录广告。
向浏览过您所定义的商品系列中车辆的网站访客再营销。
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
汽车广告不支持广告组中的内联动态受众定位参数。您必须先单独创建受众。
您可在汽车广告的广告创意中,使用模板标签。当 Facebook 展示您的广告时,我们会以用户的真实汽车选择替代模板标签。您可以在广告和网址中使用模板标签。当有人点击广告时,系统会显示模板标签。
类型 | 名称 |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
vehicle.city
、vehicle.dealer_name
、vehicle.description
、vehicle.make
、vehicle.mileage
、vehicle.model
、vehicle.price
、vehicle.region
、vehicle.sale_price
、vehicle.title
、vehicle.url
、vehicle.year
等。{{....}}
。{{dealer_name}}
结账,获享超值优惠。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 => 'Check out these vehicles from {{dealer_name}}', AdCreativeLinkDataFields::NAME => '{{vehicle.year}} {{vehicle.make}} {{vehicle.model}}', AdCreativeLinkDataFields::LINK => '{{vehicle.url}}', AdCreativeLinkDataFields::DESCRIPTION => '{{vehicle.description}}', AdCreativeLinkDataFields::ADDITIONAL_IMAGE_INDEX => 0, AdCreativeLinkDataFields::CALL_TO_ACTION => array( 'type' => AdCreativeCallToActionTypeValues::LEARN_MORE, ), )), )); $creative = new AdCreative(null, 'act_<AD_ACCOUNT_ID>'); $creative->setData(array( AdCreativeFields::NAME => 'Advantage+ Catalog Ad Template Creative Sample', AdCreativeFields::OBJECT_STORY_SPEC => $object_story_spec, AdCreativeFields::TEMPLATE_URL_SPEC => array( 'web' => array( 'url' => 'http://www.example.com/vehicle'. '?id={{vehicle_id | urlencode}}', ) ), AdCreativeFields::PRODUCT_SET_ID => <PRODUCT_SET_ID>, )); $creative->create();
使用 ad_set_id
和 creative_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
您可使用广告预览 API 生成进阶赋能型目录素材的预览。添加 product_item_ids
参数,以指定预览时显示的目录商品。
您可使用广告预览 API 生成广告预览。添加 product_item_ids
参数以指定预览时显示的目录商品,然后添加 start_date
和 end_date
以指定具体日期。
use FacebookAds\Object\AdCreative; use FacebookAds\Object\Fields\AdPreviewFields; use FacebookAds\Object\Values\AdPreviewAdFormatValues; $creative = new AdCreative(<CREATIVE_ID>); $preview = $creative->getPreviews(array(), array( AdPreviewFields::AD_FORMAT => AdPreviewAdFormatValues::DESKTOP_FEED_STANDARD, AdPreviewFields::PRODUCT_ITEM_IDS => array( '<VEHICLE_FBID>', ), ));