您可以從商家資產群組取得、新增及刪除資產。這包含廣告帳號、粉絲專頁、Facebook 像素、離線事件組合、應用程式、目錄、Instagram 帳號和自訂轉換。
管理您的商家資產群組,並瞭解如何將商家用戶連結到資產群組。商家資產群組可協助大型廣告商或代理商有效率地管理其商家的用戶和資產。您應該以對應現實世界運作的方式來組織資產和用戶。例如,商家可以根據品牌、地區、客戶或自選的組織原則來建構其資產和用戶。
如要取得商家資產群組中所有 Facebook 粉絲專頁的清單:
curl -i -X GET \ "https://graph.facebook.com/<API_VERSION>/<BUSINESS_ASSET_GROUP_ID>/contained_pages?access_token=<ACCESS_TOKEN>"
回應如下所示:
{ "data": [ { "name": "Sample Name", "id": "<ID>" }, { "name": "Another Name", "id": "<ID>" }, { "name": "Third Name", "id": "<ID>" } ], .... }
您可以新增粉絲專頁至商家資產群組。您可以新增自有粉絲專頁或共享的粉絲專頁:
curl -i -X POST \ "https://graph.facebook.com/<API_VERSION>/<BUSINESS_ASSET_GROUP_ID>/contained_pages?asset_id=<PAGE_ID>&access_token=<ACCESS_TOKEN>"
成功後,我們會傳回 true
。
若要從商家資產群組移除粉絲專頁:
curl -i -X DELETE \ "https://graph.facebook.com/<API_VERSION>/<BUSINESS_ASSET_GROUP_ID>/contained_pages?asset_id=<PAGE_ID>&access_token=<ACCESS_TOKEN>"
成功後,我們會傳回 true
。
商家資產群組可以包含自有或共享的廣告帳號。若要查看群組中的所有帳號:
curl -i -X GET \ "https://graph.facebook.com/<API_VERSION>/<BUSINESS_ASSET_GROUP_ID>/contained_adaccounts?access_token=<ACCESS_TOKEN>"
回應如下所示:
{ "data": [ { "account_id": "<ID>", "id": "act_<ID>" }, { "account_id": "<ID>", "id": "act_<ID>" }, { "account_id": "<ID>", "id": "act_<ID>" } ], .... } } }
若要新增廣告帳號至商家資產群組:
curl -i -X POST \ "https://graph.facebook.com/<API_VERSION>/<BUSINESS_ASSET_GROUP_ID>/contained_adaccounts?asset_id=<AD_ACCOUNT_ID>&access_token=<ACCESS_TOKEN>"
若要從商家資產群組移除廣告帳號:
curl -i -X DELETE \ "https://graph.facebook.com/<API_VERSION>/<BUSINESS_ASSET_GROUP_ID>/contained_adaccounts?asset_id=<AD_ACCOUNT_ID>&access_token=<ACCESS_TOKEN>"
您可以將自有或共享的商品目錄新增至商家資產群組。若要查看群組中的所有目錄:
curl -i -X GET \ "https://graph.facebook.com/<API_VERSION>/<BUSINESS_ASSET_GROUP_ID>/contained_product_catalogs?access_token=<ACCESS_TOKEN>"
回應如下所示:
{ "data": [ { "id": "<ID>", "name": "1 product catalog" }, { "id": "<ID>", "name": "First_Catalog_Products" } ], .... }
若要新增目錄至商家資產群組:
curl -i -X POST \ "https://graph.facebook.com/<API_VERSION>/<BUSINESS_ASSET_GROUP_ID>/contained_product_catalogs?asset_id=<CATALOG_ID>&access_token=<ACCESS_TOKEN>"
成功後,我們會傳回 true
。若要從商家資產群組移除目錄:
curl -i -X DELETE \ "https://graph.facebook.com/<API_VERSION>/<BUSINESS_ASSET_GROUP_ID>/contained_product_catalogs?asset_id=<CATALOG_ID>&access_token=<ACCESS_TOKEN>"
您可以將共享或自有的 Instagram 帳號新增至商家資產群組。若要取得現有帳號的清單:
curl -i -X GET \ "https://graph.facebook.com/<API_VERSION>/<BUSINESS_ASSET_GROUP_ID>/contained_instagram_accounts?access_token=<ACCESS_TOKEN>"
回應如下所示:
{ "data": [ { "id": "<ID>" }, { "id": "<ID>" } ], .... }
若要新增 Instagram 帳號至商家資產群組:
curl -i -X POST \ "https://graph.facebook.com/<API_VERSION>/<BUSINESS_ASSET_GROUP_ID>/contained_instagram_accounts?asset_id=<INSTAGRAM_ACCOUNT_ID>&access_token=<ACCESS_TOKEN>"
成功後,我們會傳回 true
。
若要從商家資產群組移除帳號:
curl -i -X DELETE \ "https://graph.facebook.com/<API_VERSION>/<BUSINESS_ASSET_GROUP_ID>/contained_instagram_accounts?asset_id=<ID>&access_token=<ACCESS_TOKEN>"
您可以在商家資產群組中新增或移除自有和共享的像素。若要查看商家資產群組中的所有現有像素:
curl -i -X GET \ "https://graph.facebook.com/<API_VERSION>/<BUSINESS_ASSET_GROUP_ID>/contained_pixels?access_token=<ACCESS_TOKEN>"
回應如下所示:
{ "data": [ { "id": "<ID>" }, { "id": "<ID>" } ], .... } } }
若要新增像素至商家資產群組:
curl -i -X POST \ "https://graph.facebook.com/<API_VERSION>/<BUSINESS_ASSET_GROUP_ID>/contained_pixels?asset_id=<PIXEL_ID>&access_token=<ACCESS_TOKEN>"
成功後,我們會傳回 true
。
若要從商家資產群組移除像素:
curl -i -X DELETE \ "https://graph.facebook.com/<API_VERSION>/<BUSINESS_ASSET_GROUP_ID>/contained_pixels?asset_id=<PIXEL_ID>&access_token=<ACCESS_TOKEN>"
商家資產群組可以包含共享和自有的離線事件資料集。若要查看商家資產群組中的所有資料集:
curl -i -X GET \ "https://graph.facebook.com/<API_VERSION>/<BUSINESS_ASSET_GROUP_ID>/contained_offline_conversion_data_sets?access_token=<ACCESS_TOKEN>"
回應如下所示:
{ "data": [ { "id": "<ID>", "name": "Transfer", "business": { "id": "<ID>", "name": "Acme Industries Inc." }, "enable_auto_assign_to_accounts": false, "is_restricted_use": false }, { "id": "<ID>", "name": "Default Offline Event Set For Biz1", "business": { "id": "<ID>", "name": "Biz1" }, "enable_auto_assign_to_accounts": true, "is_restricted_use": false } ], .... }
若要新增離線事件組合至商家資產群組:
curl -i -X POST \ "https://graph.facebook.com/<API_VERSION>/<BUSINESS_ASSET_GROUP_ID>/contained_offline_conversion_data_sets?asset_id=<EVENT_SET_ID>&access_token=<ACCESS_TOKEN>"
成功後,我們會傳回 true
。
若要從商家資產群組移除事件組合:
curl -i -X DELETE \ "https://graph.facebook.com/<API_VERSION>/<BUSINESS_ASSET_GROUP_ID>/contained_offline_conversion_data_sets?asset_id=<EVENT_SET_ID>&access_token=<ACCESS_TOKEN>"
若要取得商家資產群組中的所有共享和自有的應用程式:
curl -i -X GET \ "https://graph.facebook.com/<API_VERSION>/<BUSINESS_ASSET_GROUP_ID>/contained_applications?access_token=<ACCESS_TOKEN>"
回應:
{ "data": [ { "category": "Games", "link": "/instantgames/<ID>/", "name": "testing again", "id": "<ID>" }, { "category": "Lifestyle", "link": "https://www.facebook.com/games/?app_id=<ID>", "name": "AccountKitTest", "id": "<ID>" } ], .... }
若要新增應用程式至商家資產群組:
curl -i -X POST \ "https://graph.facebook.com/<API_VERSION>/<BUSINESS_ASSET_GROUP_ID>/contained_applications?asset_id=<APP_ID>&access_token=<ACCESS_TOKEN>"
若要從商家資產群組移除應用程式:
curl -i -X DELETE \ "https://graph.facebook.com/<API_VERSION>/<BUSINESS_ASSET_GROUP_ID>/contained_applications?asset_id=<APP_ID>&access_token=<ACCESS_TOKEN>"
在成功新增或移除應用程式後,我們會傳回 true
。
若要查看商家資產群組中所有自有和共享的自訂轉換資料集:
curl -i -X GET \ "https://graph.facebook.com/<API_VERSION>/<BUSINESS_ASSET_GROUP_ID>/contained_custom_conversions?access_token=<ACCESS_TOKEN>"
回應:
{ "data": [{ "data": [ { "id": "<ID>" }, { "id": "<ID>" } ], .... }
若要新增自訂轉換至商家資產群組:
curl -i -X POST \ "https://graph.facebook.com/<API_VERSION>/<BUSINESS_ASSET_GROUP_ID>/contained_custom_conversions?asset_id=<CUSTOM_CONVERSIONS_DATA_SET_ID>&access_token=<ACCESS_TOKEN>"
若要從商家資產群組刪除自訂轉換:
curl -i -X DELETE \ "https://graph.facebook.com/<API_VERSION>/<BUSINESS_ASSET_GROUP_ID>/contained_custom_conversions?asset_id=<CUSTOM_CONVERSIONS_DATA_SET_ID>&access_token=<ACCESS_TOKEN>"
在成功新增或移除自訂轉換後,我們會傳回 true
。