本文件說明各種廣告單位,旨在推動桌面版和行動應用程式的安裝和互動。
您應該使用此廣告單位將用戶吸引到您的桌面版或行動應用程式,以便透過相片、影片、輪播廣告或試玩廣告創意進行安裝或互動。
其允許下列廣告:
照片 | 影片 | 輪播廣告 | 試玩 | |
---|---|---|---|---|
行動版安裝廣告 | ✓ | ✓ | ✓ | ✓ |
行動版互動廣告 | ✓ | ✓ | ✓ | |
桌面版安裝廣告 | ✓ | ✓ | ✓ | |
桌面版互動廣告 | ✓ | ✓ | ✓ | |
虛擬商品的桌面版應用程式廣告 | ✓ | ✓ | ✓ |
虛擬商品的桌面版應用程式廣告是桌面版互動的一部分,您可以使用虛擬商品優惠來重新吸引玩家,讓他們重新回到您的應用程式中。例如,應用程式可以為動態消息中的某項商品或一組應用程式內部貨幣提供折扣,以重新吸引過去的付款人。如需設定應用程式以接受付款的操作說明,請參閱此處。
如需參考資訊,行動版安裝影像單元如下所示:
虛擬商品的桌面版應用程式廣告影像如下所示
建立廣告時,請注意下列必要條件:
device_platforms
必須是 desktop
。如果您不需要同時擁有 Facebook 桌面版動態消息和右側欄,也可選擇性指定 facebook_positions
。GET_OFFER
用於虛擬商品時,價格必須享折扣。如需詳細資訊,請參閱虛擬商品。下列額外的行動呼籲適用於貼文的 call_to_action
欄位中的應用程式廣告或廣告創意的 object_story_spec
。您也可在 app_link
欄位指定行動應用程式深層連結或在 product_link
欄位指定桌面版應用程式的虛擬商品物件。
索引鍵 | 值 | 必要項目 |
---|---|---|
類型 | 行動版的行動呼籲類型,無論為安裝或互動: | 是 |
值 | JSON 字典: | 是
|
value.link | 請參閱 App Store、Google Play 商店或 Facebook 全螢幕互動廣告應用程式網址,例如 https://itunes.apple.com/us/app/facebook/id284882215 | 是 |
value.app_link | 若只要為行動應用程式定義深層連結目的地,例如 | 是,僅適用於行動安裝或互動廣告 |
value.product_link | 定義指向產品的開放社交關係圖虛擬商品物件的網址。如需設定詳細資料,請參閱此處。 | 是,僅適用於桌面版虛擬商品 |
value.link_title | 允許您自訂連結的名稱,該名稱顯示在廣告圖像下方 | 否 |
若要使用相片建立桌面版或行動應用程式廣告,請先使用廣告創意的 object_story_spec: {'link_data': ...}
欄位,以相片建立連結粉絲專頁貼文。
範例:
curl -X POST \
-F 'name="Sample Creative"' \
-F 'object_story_spec={
"page_id": "<PAGE_ID>",
"link_data": {
"call_to_action": {
"type": "INSTALL_MOBILE_APP",
"value": {
"link": "<APP_STORE_URL>"
}
},
"image_hash": "<IMAGE_HASH>",
"link": "<APP_STORE_URL>",
"message": "Try it out"
}
}' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v21.0
/act_<AD_ACCOUNT_ID>/adcreatives
或者,可透過粉絲專頁的動態消息端點及使用廣告創意中的貼文編號建立粉絲專頁貼文。如需更多範例,請參閱下文的範例部分。
若要使用輪播廣告格式建立行動應用程式安裝或互動廣告,請按照輪播廣告文件中的說明進行(除了各 child_attachments
的 link
欄位以外),指定應用程式商店連結。
請注意,您應在每個 child_attachment
中指定相同的應用程式商店連結。不需要在 call_to_action:{'value':{'link':... }}}
中再次指定連結
curl -X POST \
-F 'name="Carousel app ad"' \
-F 'object_story_spec={
"page_id": "<PAGE_ID>",
"link_data": {
"message": "My message",
"link": "http://www.example.com/appstoreurl",
"caption": "WWW.ITUNES.COM",
"name": "The link name",
"description": "The link description",
"child_attachments": [
{
"link": "http://www.example.com/appstoreurl",
"image_hash": "<IMAGE_HASH>",
"call_to_action": {
"type": "USE_MOBILE_APP",
"value": {
"app_link": "<DEEP_LINK>"
}
}
},
{
"link": "http://www.example.com/appstoreurl",
"image_hash": "<IMAGE_HASH>",
"call_to_action": {
"type": "USE_MOBILE_APP",
"value": {
"app_link": "<DEEP_LINK>"
}
}
},
{
"link": "http://www.example.com/appstoreurl",
"image_hash": "<IMAGE_HASH>",
"call_to_action": {
"type": "USE_MOBILE_APP",
"value": {
"app_link": "<DEEP_LINK>"
}
}
},
{
"link": "http://www.example.com/appstoreurl",
"image_hash": "<IMAGE_HASH>",
"call_to_action": {
"type": "USE_MOBILE_APP",
"value": {
"app_link": "<DEEP_LINK>"
}
}
}
],
"multi_share_optimized": true
}
}' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v21.0
/act_<AD_ACCOUNT_ID>/adcreatives
若要建立包含影片的應用程式廣告,請先將影片上傳到廣告帳號的影片庫。然後使用廣告創意的 object_story_spec: {'video_data':...}
欄位中的影片編號。
範例:
use FacebookAds\Object\AdCreative;
use FacebookAds\Object\AdCreativeVideoData;
use FacebookAds\Object\Fields\AdCreativeVideoDataFields;
use FacebookAds\Object\AdCreativeObjectStorySpec;
use FacebookAds\Object\Fields\AdCreativeObjectStorySpecFields;
use FacebookAds\Object\Fields\AdCreativeFields;
$video_data = new AdCreativeVideoData();
$video_data->setData(array(
AdCreativeVideoDataFields::IMAGE_URL => '<THUMBNAIL_URL>',
AdCreativeVideoDataFields::VIDEO_ID => <VIDEO_ID>,
AdCreativeVideoDataFields::CALL_TO_ACTION => array(
'type' => 'INSTALL_MOBILE_APP',
'value' => array(
'link' => '<APP_STORE_URL>',
),
),
));
$object_story_spec = new AdCreativeObjectStorySpec();
$object_story_spec->setData(array(
AdCreativeObjectStorySpecFields::PAGE_ID => <PAGE_ID>,
AdCreativeObjectStorySpecFields::VIDEO_DATA => $video_data,
));
$creative = new AdCreative(null, 'act_<AD_ACCOUNT_ID>');
$creative->setData(array(
AdCreativeFields::NAME => 'Sample Creative',
AdCreativeFields::OBJECT_STORY_SPEC => $object_story_spec,
));
$creative->create();
from facebookads.adobjects.adcreative import AdCreative
from facebookads.adobjects.adcreativeobjectstoryspec \
import AdCreativeObjectStorySpec
from facebookads.adobjects.adcreativevideodata \
import AdCreativeVideoData
video_data = AdCreativeVideoData()
video_data[AdCreativeVideoData.Field.description] = 'try it out'
video_data[AdCreativeVideoData.Field.video_id] = <VIDEO_ID>
video_data[AdCreativeVideoData.Field.image_url] = '<THUMBNAIL_URL>'
video_data[AdCreativeVideoData.Field.call_to_action] = {
'type': 'INSTALL_MOBILE_APP',
'value': {
'link': '<APP_STORE_URL>',
'link_title': 'Facebook',
},
}
object_story_spec = AdCreativeObjectStorySpec()
object_story_spec[AdCreativeObjectStorySpec.Field.page_id] = <PAGE_ID>
object_story_spec[AdCreativeObjectStorySpec.Field.video_data] = video_data
creative = AdCreative(parent_id='act_<AD_ACCOUNT_ID>')
creative[AdCreative.Field.name] = 'Sample Creative'
creative[AdCreative.Field.object_story_spec] = object_story_spec
creative.remote_create()
AdCreative adCreative = new AdAccount(act_<AD_ACCOUNT_ID>, context).createAdCreative()
.setName("Sample Creative")
.setObjectStorySpec(
new AdCreativeObjectStorySpec()
.setFieldPageId(<PAGE_ID>)
.setFieldVideoData(
new AdCreativeVideoData()
.setFieldCallToAction(
new AdCreativeLinkDataCallToAction()
.setFieldType(AdCreativeLinkDataCallToAction.EnumType.VALUE_INSTALL_MOBILE_APP)
.setFieldValue(
new AdCreativeLinkDataCallToActionValue()
.setFieldLink(<APP_STORE_URL>)
)
)
.setFieldLinkDescription("try it out")
.setFieldImageUrl(<THUMBNAIL_URL>)
.setFieldVideoId(<VIDEO_ID>)
)
)
.execute();
String ad_creative_id = adCreative.getId();
curl \
-F 'name=Sample Creative' \
-F 'object_story_spec={
"page_id": "<PAGE_ID>",
"video_data": {
"call_to_action": {"type":"INSTALL_MOBILE_APP","value":{"link":"<APP_STORE_URL>"}},
"image_url": "<THUMBNAIL_URL>",
"video_id": "<VIDEO_ID>"
}
}' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v2.11/act_<AD_ACCOUNT_ID>/adcreatives
若要擷取有關粉絲專頁貼文的詳細資料,請參閱連結粉絲專頁貼文說明文件或影片粉絲專頁貼文說明文件。
您可從粉絲專頁的 /promotable_posts
關係連線列出所有粉絲專頁貼文。
curl https://graph.facebook.com/{API_VERSION}/{PAGE_ID}/promotable_posts
若要擷取廣告創意的詳細資料,請參閱廣告創意說明文件。
ADVERTISE
任務的用戶所要求的粉絲專頁存取權杖"call_to_action={'type':'LEARN_MORE', 'value':{'link':'https://itunes.apple.com/us/app/facebook/id284882215', 'app_link':'facebook://path/to/page'}}"
在指定應用程式連結前,您應呼叫以下命令,驗證系統是否已抓取該連結:
https://graph.facebook.com/{API_VERSION}/?type=og&scrape=true&id={APP_LINK}
Meta 將針對安裝您應用程式的用戶統計資料提供每日的彙總洞察報告。若要擷取洞察報告,您應使用應用程式存取權杖並查詢
https://graph.facebook.com/{API_VERSION}/{APP_ID}/insights/application_mobile_app_installs?&access_token={ACCESS_TOKEN}
您也可以透過指定其他網址參數 breakdown
(等於以下其中一個值)來解析統計資料。目前無法合併資料解析項目。
名稱 | 說明 |
---|---|
| 依廣告受眾的年齡和性別解析統計資料 |
| 依廣告受眾的國家/地區解析統計資料 |
| 依廣告受眾的地區設定解析統計資料 |
範例:
https://graph.facebook.com/{API_VERSION}/{APP_ID}/insights/application_mobile_app_installs?breakdown=gender_age&access_token={ACCESS_TOKEN} https://graph.facebook.com/{API_VERSION}/{APP_ID}/insights/application_mobile_app_installs?breakdown=country&access_token={ACCESS_TOKEN} https://graph.facebook.com/{API_VERSION}/{APP_ID}/insights/application_mobile_app_installs?breakdown=locale&access_token={ACCESS_TOKEN}
步驟 1:用影像建立粉絲專頁貼文。請注意,您應該使用 PAGE_ACCESS_TOKEN
和粉絲專頁 API 連線階段建立粉絲專頁貼文。
use FacebookAds\Api;
use FacebookAds\Http\RequestInterface;
$params = array(
'message' => 'Sign up today',
'picture' => '<IMAGE_URL>',
'link' => '<LINK>',
'published' => 1,
'call_to_action' => array(
'type' => 'SIGN_UP',
'value' => array(
'link' => '<LINK>',
),
),
);
$data = Api::instance()->call(
'/'.<PAGE_ID>.'/feed',
RequestInterface::METHOD_POST,
$params)->getContent();
from facebookads import FacebookAdsApi
params = {
'massage': 'Sign up today.',
'picture': '<IMAGE_URL>',
'link': '<LINK>',
'published': 1,
'call_to_action': {
'type': 'SIGN_UP',
'value': {
'link': '<LINK>',
},
},
}
data = FacebookAdsApi.get_default_api().\
call('POST', (<PAGE_ID>, 'feed'), params=params)
curl \
-F 'message=Sign up today' \
-F 'picture=<IMAGE_URL>' \
-F 'link=<LINK>' \
-F 'published=1' \
-F 'call_to_action={"type":"SIGN_UP","value":{"link":"<LINK>"}}' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v2.11/<PAGE_ID>/feed
步驟 2:建立廣告創意({STORY_ID}
的格式為 '{PAGE_ID}_{POST_ID}'
)
curl -X POST \
-F 'object_story_id="<PAGE_ID>_<POST_ID>"' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v21.0/act_<AD_ACCOUNT_ID>/adcreatives
步驟 3:在廣告中使用廣告創意
curl -X POST \
-F 'name="My AdGroup with Redownload"' \
-F 'adset_id="<AD_SET_ID>"' \
-F 'creative={
"creative_id": "<CREATIVE_ID>"
}' \
-F 'redownload=1' \
-F 'status="PAUSED"' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v21.0/act_<AD_ACCOUNT_ID>/ads
步驟 1:用影像建立粉絲專頁貼文。請注意,您應該使用 PAGE_ACCESS_TOKEN
和粉絲專頁 API 連線階段建立粉絲專頁貼文。
curl -X POST \
-F 'message="This is a test message"' \
-F 'call_to_action={
"type": "BUY_NOW",
"value": {
"link": "{app-store-url}",
"app_link": "{deep-link}"
}
}' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v21.0/{page-id}/feed
步驟 2:建立廣告創意
curl -X POST \
-F 'object_story_id="<PAGE_ID>_<POST_ID>"' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v21.0/act_<AD_ACCOUNT_ID>/adcreatives
步驟 3:設定廣告組合出價、點擊最佳化、依曝光次數付費。
use FacebookAds\Object\AdSet;
use FacebookAds\Object\Fields\AdSetFields;
use FacebookAds\Object\Values\AdSetBillingEventValues;
use FacebookAds\Object\Values\AdSetOptimizationGoalValues;
use FacebookAds\Object\Fields\TargetingFields;
use FacebookAds\Object\Targeting;
$adset = new AdSet(null, 'act_<AD_ACCOUNT_ID>');
$adset->setData(array(
AdSetFields::NAME => 'LifetimeBudgetSet',
AdsetFields::LIFETIME_BUDGET => 100000,
AdSetFields::BID_AMOUNT => 500,
AdSetFields::BILLING_EVENT => AdSetBillingEventValues::IMPRESSIONS,
AdSetFields::OPTIMIZATION_GOAL => AdSetOptimizationGoalValues::LINK_CLICKS,
AdSetFields::PROMOTED_OBJECT => array(
'application_id' => <APP_ID>,
'object_store_url' => '<APP_STORE_URL>',
),
AdSetFields::TARGETING => (new Targeting())->setData(array(
TargetingFields::GEO_LOCATIONS => array(
'countries' => array('US'),
),
TargetingFields::USER_OS => array(
'IOS',
),
TargetingFields::PUBLISHER_PLATFORMS => array(
'facebook',
'audience_network',
),
TargetingFields::FACEBOOK_POSITIONS => array('feed'),
)),
AdSetFields::CAMPAIGN_ID => <CAMPAIGN_ID>,
AdSetFields::END_TIME =>
(new \DateTime("+1 week"))->format(\DateTime::ISO8601),
));
$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: 'LifetimeBudgetSet',
AdSet.Field.campaign_id: <CAMPAIGN_ID>,
AdSet.Field.lifetime_budget: 10000,
AdSet.Field.start_time: int(time.time()),
AdSet.Field.end_time: int(time.time() + 100000),
AdSet.Field.optimization_goal: AdSet.OptimizationGoal.link_clicks,
AdSet.Field.billing_event: AdSet.BillingEvent.impressions,
AdSet.Field.bid_amount: 500,
AdSet.Field.promoted_object: {
'application_id': <APP_ID>,
'object_store_url': '<APP_STORE_URL>',
},
AdSet.Field.targeting: {
'geo_locations': {
'countries': ['US'],
},
'user_os': ['iOS'],
Targeting.Field.publisher_platforms: ['facebook', 'audience_network'],
Targeting.Field.facebook_positions: ['feed'],
},
})
adset.remote_create(params={
'status': AdSet.Status.paused,
})
curl \
-F 'name=LifetimeBudgetSet' \
-F 'lifetime_budget=100000' \
-F 'bid_amount=500' \
-F 'billing_event=IMPRESSIONS' \
-F 'optimization_goal=LINK_CLICKS' \
-F 'promoted_object={"application_id":"<APP_ID>","object_store_url":"<APP_STORE_URL>"}' \
-F 'targeting={
"facebook_positions": ["feed"],
"geo_locations": {"countries":["US"]},
"publisher_platforms": ["facebook","audience_network"],
"user_os": ["IOS"]
}' \
-F 'campaign_id=<CAMPAIGN_ID>' \
-F 'end_time=2018-02-06T04:45:30+0000' \
-F 'status=PAUSED' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v2.11/act_<AD_ACCOUNT_ID>/adsets
步驟 4:在廣告中使用廣告創意
use FacebookAds\Object\Ad;
use FacebookAds\Object\Fields\AdFields;
$data = array(
AdFields::NAME => 'My Ad',
AdFields::ADSET_ID => <AD_SET_ID>,
AdFields::CREATIVE => array(
'creative_id' => <CREATIVE_ID>,
),
);
$ad = new Ad(null, 'act_<AD_ACCOUNT_ID>');
$ad->setData($data);
$ad->create(array(
'redownload' => 1,
));
from facebookads.adobjects.ad import Ad
ad = Ad(parent_id='act_<AD_ACCOUNT_ID>')
ad[Ad.Field.name] = 'My Ad'
ad[Ad.Field.adset_id] = <AD_SET_ID>
ad[Ad.Field.creative] = {'creative_id': <CREATIVE_ID>}
ad[Ad.Field.redownload] = True
ad.remote_create(params={
'status': Ad.Status.paused,
})
Ad ad = new AdAccount(act_<AD_ACCOUNT_ID>, context).createAd()
.setName("My Ad")
.setAdsetId(<AD_SET_ID>)
.setCreative(
new AdCreative()
.setFieldId(<CREATIVE_ID>)
)
.setRedownload(true)
.execute();
String ad_id = ad.getId();
curl \
-F 'name=My Ad' \
-F 'adset_id=<AD_SET_ID>' \
-F 'creative={"creative_id":"<CREATIVE_ID>"}' \
-F 'redownload=1' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v2.11/act_<AD_ACCOUNT_ID>/ads
步驟 1:用影像建立粉絲專頁貼文。請注意,您應該使用 PAGE_ACCESS_TOKEN
和粉絲專頁 API 連線階段建立粉絲專頁貼文。
use FacebookAds\Api;
use FacebookAds\Http\RequestInterface;
$params = array(
'message' => 'Check out this App today. Available on iTunes.',
'published' => 1,
'link' => '<APP_STORE_URL>',
'picture' => '<IMAGE_URL>',
'call_to_action' => array(
'type' => 'LEARN_MORE',
'value' => array(
'link' => '<APP_STORE_URL>',
'app_link' => '<APP_DEEP_LINK>',
),
),
);
$data = Api::instance()->call(
'/'.<PAGE_ID>.'/feed',
RequestInterface::METHOD_POST,
$params)->getContent();
from facebookads import FacebookAdsApi
params = {
'massage': 'Check out this App today. Available on iTunes.',
'picture': '<IMAGE_URL>',
'link': '<APP_STORE_URL>',
'published': 1,
'call_to_action': {
'type': 'LEARN_MORE',
'value': {
'link': '<APP_STORE_URL>',
'app_link': '<APP_DEEP_LINK>',
},
},
}
path = "/{}/feed".format(<PAGE_ID>)
data = FacebookAdsApi.get_default_api().call('POST', (path,), params=params)
curl \
-F 'message=Check out this App today. Available on iTunes.' \
-F 'published=1' \
-F 'link=<APP_STORE_URL>' \
-F 'picture=<IMAGE_URL>' \
-F 'call_to_action={
"type": "LEARN_MORE",
"value": {"link":"<APP_STORE_URL>","app_link":"<APP_DEEP_LINK>"}
}' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v2.11/<PAGE_ID>/feed
步驟 2:建立廣告創意
curl -X POST \
-F 'object_story_id="<PAGE_ID>_<POST_ID>"' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v21.0/act_<AD_ACCOUNT_ID>/adcreatives
步驟 3:設定廣告組合出價、應用程式事件最佳化、依曝光次數付費。
請注意,您也必須設定廣告組合的 promoted_object
,以包含要最佳化的 custom_event_type
,請參閱廣告組合說明文件以取得詳細資料。
curl -X POST \
-F 'name="A CPA Ad Set optimized for App Events"' \
-F 'campaign_id="<AD_CAMPAIGN_ID>"' \
-F 'daily_budget=300' \
-F 'start_time="2024-11-28T11:26:20-0800"' \
-F 'end_time="2024-12-05T11:26:20-0800"' \
-F 'billing_event="IMPRESSIONS"' \
-F 'optimization_goal="OFFSITE_CONVERSIONS"' \
-F 'bid_amount=100' \
-F 'status="PAUSED"' \
-F 'promoted_object={
"application_id": "<APP_ID>",
"object_store_url": "<APP_STORE_URL>",
"custom_event_type": "PURCHASE"
}' \
-F 'targeting={
"facebook_positions": [
"feed"
],
"geo_locations": {
"countries": [
"US"
]
},
"user_os": [
"iOS"
]
}' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v21.0/act_<AD_ACCOUNT_ID>/adsets
步驟 4:在廣告中使用廣告創意
use FacebookAds\Object\Ad;
use FacebookAds\Object\Fields\AdFields;
$data = array(
AdFields::NAME => 'My Ad',
AdFields::ADSET_ID => <AD_SET_ID>,
AdFields::CREATIVE => array(
'creative_id' => <CREATIVE_ID>,
),
);
$ad = new Ad(null, 'act_<AD_ACCOUNT_ID>');
$ad->setData($data);
$ad->create(array(
'redownload' => 1,
));
from facebookads.adobjects.ad import Ad
ad = Ad(parent_id='act_<AD_ACCOUNT_ID>')
ad[Ad.Field.name] = 'My Ad'
ad[Ad.Field.adset_id] = <AD_SET_ID>
ad[Ad.Field.creative] = {'creative_id': <CREATIVE_ID>}
ad[Ad.Field.redownload] = True
ad.remote_create(params={
'status': Ad.Status.paused,
})
Ad ad = new AdAccount(act_<AD_ACCOUNT_ID>, context).createAd()
.setName("My Ad")
.setAdsetId(<AD_SET_ID>)
.setCreative(
new AdCreative()
.setFieldId(<CREATIVE_ID>)
)
.setRedownload(true)
.execute();
String ad_id = ad.getId();
curl \
-F 'name=My Ad' \
-F 'adset_id=<AD_SET_ID>' \
-F 'creative={"creative_id":"<CREATIVE_ID>"}' \
-F 'redownload=1' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v2.11/act_<AD_ACCOUNT_ID>/ads
請注意,您應該使用 PAGE_ACCESS_TOKEN
和粉絲專頁 API 連線階段建立粉絲專頁貼文。
curl \
-F 'name=My Video' \
-F 'message=Check out this app!' \
-F 'thumbnail=<APP_STORE_URL>' \
-F 'published=0' \
-F 'call_to_action={"type":"INSTALL_MOBILE_APP","value":{"link":"<APP_STORE_URL>"}}' \
-F 'source=@<VIDEO_PATH>' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v21.0
/<PAGE_ID>/videos
curl \
-F 'name=My Video' \
-F 'message=Check out this app!' \
-F 'thumbnail=<APP_STORE_URL>' \
-F 'published=0' \
-F 'call_to_action={
"type": "LEARN_MORE",
"value": {"link":"<APP_STORE_URL>","app_link":"<APP_DEEP_LINK>"}
}' \
-F 'source=@<VIDEO_PATH>' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v21.0
/<PAGE_ID>/videos
curl \
-F 'name=My Video' \
-F 'message=Check out this app!' \
-F 'thumbnail=<THUMBNAIL_PATH>' \
-F 'published=0' \
-F 'call_to_action={"type":"PLAY_GAME","value":{"link":"<THUMBNAIL_PATH>"}}' \
-F 'source=@<VIDEO_PATH>' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v21.0
/<PAGE_ID>/videos
curl \
-F 'message=Buy coins now!' \
-F 'picture=<IMAGE_URL>' \
-F 'link=<LINK>' \
-F 'published=1' \
-F 'call_to_action={"type":"BUY_NOW","value":{"link":"<LINK>","product_link":"<PRODUCT_LINK>"}}' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v21.0
/<PAGE_ID>/feed
curl \
-F 'name=My Video' \
-F 'message=Buy coins now!' \
-F 'thumbnail=<THUMBNAIL_PATH>' \
-F 'published=0' \
-F 'call_to_action={
"type": "BUY_NOW",
"value": {"link":"<THUMBNAIL_PATH>","product_link":"<THUMBNAIL_PATH>"}
}' \
-F 'source=@<VIDEO_PATH>' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v21.0
/<PAGE_ID>/videos
高效速成+ 目錄廣告可驅使用戶安裝您的行動應用程式。這可讓您根據使用者的行為,透過行動安裝廣告再次鎖定用戶。
步驟 1:為商品目錄建立行銷活動
curl -X POST \
-F 'name="App Installs Campaign with Dynamic Product Ads"' \
-F 'objective="OUTCOME_APP_PROMOTION"' \
-F 'status="PAUSED"' \
-F 'special_ad_categories=[]' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v21.0/act_<AD_ACCOUNT_ID>/campaigns
步驟 2:在上述商品目錄下為特定產品組合建立廣告組合
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 => 'Mobile App Installs Ad Set with Dynamic Product Ads',
AdSetFields::BID_AMOUNT => 3000,
AdSetFields::BILLING_EVENT => AdSetBillingEventValues::IMPRESSIONS,
AdSetFields::OPTIMIZATION_GOAL => AdSetOptimizationGoalValues::APP_INSTALLS,
AdSetFields::DAILY_BUDGET => 15000,
AdSetFields::CAMPAIGN_ID => <CAMPAIGN_ID>,
AdSetFields::TARGETING => array(
TargetingFields::GEO_LOCATIONS => array(
'countries' => array('US'),
),
TargetingFields::PUBLISHER_PLATFORMS => array(
'facebook',
'audience_network',
),
TargetingFields::DEVICE_PLATFORMS => array('mobile'),
TargetingFields::USER_OS => array(
'IOS',
),
TargetingFields::DYNAMIC_AUDIENCE_IDS => array(<PRODUCT_AUDIENCE_ID>),
),
AdSetFields::PROMOTED_OBJECT => array(
'product_set_id' => <PRODUCT_SET_ID>,
'application_id' => <APP_ID>,
'object_store_url' => '<APP_STORE_URL>',
),
));
$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='act_<AD_ACCOUNT_ID>')
adset.update({
AdSet.Field.name: 'Mobile App Installs Ad Set with Dynamic Product Ads',
AdSet.Field.promoted_object: {
'product_set_id': product_set_id,
'application_id': <APP_ID>,
'object_store_url': '<APP_STORE_URL>',
},
AdSet.Field.campaign_id: <CAMPAIGN_ID>,
AdSet.Field.daily_budget: 15000,
AdSet.Field.optimization_goal: AdSet.OptimizationGoal.app_installs,
AdSet.Field.billing_event: AdSet.BillingEvent.impressions,
AdSet.Field.bid_amount: 3000,
AdSet.Field.targeting: {
Targeting.Field.geo_locations: {
'countries': ['US'],
},
Targeting.Field.publisher_platforms: ['facebook', 'audience_network'],
Targeting.Field.device_platforms: ['mobile'],
Targeting.Field.user_os: [
'IOS',
],
Targeting.Field.dynamic_audience_ids: [
<PRODUCT_AUDIENCE_ID>,
],
},
})
adset.remote_create(params={
'status': AdSet.Status.paused,
})
curl \
-F 'name=Mobile App Installs Ad Set with Dynamic Product Ads' \
-F 'bid_amount=3000' \
-F 'billing_event=IMPRESSIONS' \
-F 'optimization_goal=APP_INSTALLS' \
-F 'daily_budget=15000' \
-F 'campaign_id=<CAMPAIGN_ID>' \
-F 'targeting={
"geo_locations": {"countries":["US"]},
"publisher_platforms": ["facebook","audience_network"],
"device_platforms": ["mobile"],
"user_os": ["IOS"],
"dynamic_audience_ids": ["<PRODUCT_AUDIENCE_ID>"]
}' \
-F 'promoted_object={
"product_set_id": "<PRODUCT_SET_ID>",
"application_id": "<APP_ID>",
"object_store_url": "<APP_STORE_URL>"
}' \
-F 'status=PAUSED' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v2.8/act_<AD_ACCOUNT_ID>/adsets
步驟 3:使用範本建立高效速成+ 目錄廣告創意
curl -X POST \
-F 'name="Advantage+ catalog ads template creative sample"' \
-F 'object_story_spec={
"page_id": "<PAGE_ID>",
"template_data": {
"call_to_action": {
"type": "INSTALL_MOBILE_APP",
"value": {
"link": "http://www.example.com/appstoreurl"
}
},
"message": "Test {{product.name | titleize}}",
"link": "http://www.example.com/appstoreurl",
"name": "Headline {{product.price}}",
"description": "Description {{product.description}}"
}
}' \
-F 'product_set_id="<PRODUCT_SET_ID>"' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v21.0
/act_<AD_ACCOUNT_ID>/adcreatives
步驟 4:將上面的廣告創意用於廣告之中
use FacebookAds\Object\Ad;
use FacebookAds\Object\Fields\AdFields;
$data = array(
AdFields::NAME => 'My Ad',
AdFields::ADSET_ID => <AD_SET_ID>,
AdFields::CREATIVE => array(
'creative_id' => <CREATIVE_ID>,
),
);
$ad = new Ad(null, 'act_<AD_ACCOUNT_ID>');
$ad->setData($data);
$ad->create(array(
'redownload' => 1,
));
from facebookads.adobjects.ad import Ad
ad = Ad(parent_id='act_<AD_ACCOUNT_ID>')
ad[Ad.Field.name] = 'My Ad'
ad[Ad.Field.adset_id] = <AD_SET_ID>
ad[Ad.Field.creative] = {'creative_id': <CREATIVE_ID>}
ad[Ad.Field.redownload] = True
ad.remote_create(params={
'status': Ad.Status.paused,
})
Ad ad = new AdAccount(act_<AD_ACCOUNT_ID>, context).createAd()
.setName("My Ad")
.setAdsetId(<AD_SET_ID>)
.setCreative(
new AdCreative()
.setFieldId(<CREATIVE_ID>)
)
.setRedownload(true)
.execute();
String ad_id = ad.getId();
curl \
-F 'name=My Ad' \
-F 'adset_id=<AD_SET_ID>' \
-F 'creative={"creative_id":"<CREATIVE_ID>"}' \
-F 'redownload=1' \
-F 'access_token=<ACCESS_TOKEN>' \
https://graph.facebook.com/v2.11/act_<AD_ACCOUNT_ID>/ads
curl \ -X POST \ -F "name=<name>" \ -F "source=<>" \ -F "access_token=<access_token>" \ "https://graph.facebook.com/<API_VERSION>/act_<account_id>/adplayables"
name
:區分廣告帳號中廣告資產和其他試玩廣告差異的名稱;例如,{ad_name}
-> {playable_asset_name}
source
:本機電腦上檔案的絕對路徑access_token
:可從圖形 API 測試工具產生您可在試玩 HTML 5 檔案中新增兩個中繼資料標籤。如此可讓 Meta 將廣告中的試玩廣告歸入您的應用程式。
... <head> ... <meta name="ref-application-id" content="<YOUR_APP_ID>"> <meta name="ref-asset-id" content="<YOUR_ASSET_ID>"> ... </head> ...
curl \ -F 'name=Sample Creative' \ -F 'object_story_spec={ "page_id": "<PAGE_ID>", "video_data": { "call_to_action": {"type":"INSTALL_MOBILE_APP","value":{"application":<APP_ID>,"link":"<APP_STORE_URL>"}}, "image_url": "<THUMBNAIL_URL>", "link_description": "try it out", "video_id": "<VIDEO_ID>" } }' \ -F 'playable_asset_id=<PLAYABLE_ASSET_ID>' \ -F 'access_token=<ACCESS_TOKEN>' \ https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/adcreatives
curl \ -F 'name=My Ad' \ -F 'status=ACTIVE' \ -F 'adset_id=<AD_SET_ID>' \ -F 'creative={"creative_id":"<CREATIVE_ID>"}' \ -F 'access_token=<ACCESS_TOKEN>' \ https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/ads