如何在营销 api 中过滤具有特定 objective 的 Facebook 广告帐户活动?
How to filter facebook adaccount campaigns with specfic objective in marketing api?
我正在构建 Facebook 广告管理器应用程序。我需要过滤具有特定目标的活动,如“达到”等。
我无法在 Facebook 营销 API 文档中找到任何参数。
https://developers.facebook.com/docs/marketing-api/reference/ad-account/campaigns/#Reading
这是来自 Facebook 的阅读示例。
/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->get(
'/act_<AD_ACCOUNT_ID>/campaigns?effective_status=%5B%22ACTIVE%22%2C%22PAUSED%22%5D&fields=name%2Cobjective',
'{access-token}'
);
} catch(Facebook\Exceptions\FacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
这里有我遗漏的参数吗?提前致谢。
您可以使用 filtering operator 作为工作示例,您可以搜索 POST_ENGAGEMENT
或 CONVERSIONS
objective 在 ACTIVE
或 PAUSED
状态:
act_xxx/campaigns?fields=name,objective,effective_status&filtering=[{'field':'objective','operator':'IN','value':['POST_ENGAGEMENT','CONVERSIONS']}, {'field':'effective_status','operator':'IN','value':['ACTIVE','PAUSED']}]
将return:
{
"data": [
{
"name": <NAME>,
"objective": "POST_ENGAGEMENT",
"effective_status": "PAUSED",
"id": <ID>
},
{
"name": <NAME>,
"objective": "CONVERSIONS",
"effective_status": "PAUSED",
"id": <ID>
},
{
"name": <NAME>,
"objective": "POST_ENGAGEMENT",
"effective_status": "PAUSED",
"id": <ID>
},
{
....
}
我正在构建 Facebook 广告管理器应用程序。我需要过滤具有特定目标的活动,如“达到”等。 我无法在 Facebook 营销 API 文档中找到任何参数。
https://developers.facebook.com/docs/marketing-api/reference/ad-account/campaigns/#Reading
这是来自 Facebook 的阅读示例。
/* PHP SDK v5.0.0 */
/* make the API call */
try {
// Returns a `Facebook\FacebookResponse` object
$response = $fb->get(
'/act_<AD_ACCOUNT_ID>/campaigns?effective_status=%5B%22ACTIVE%22%2C%22PAUSED%22%5D&fields=name%2Cobjective',
'{access-token}'
);
} catch(Facebook\Exceptions\FacebookResponseException $e) {
echo 'Graph returned an error: ' . $e->getMessage();
exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
echo 'Facebook SDK returned an error: ' . $e->getMessage();
exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
这里有我遗漏的参数吗?提前致谢。
您可以使用 filtering operator 作为工作示例,您可以搜索 POST_ENGAGEMENT
或 CONVERSIONS
objective 在 ACTIVE
或 PAUSED
状态:
act_xxx/campaigns?fields=name,objective,effective_status&filtering=[{'field':'objective','operator':'IN','value':['POST_ENGAGEMENT','CONVERSIONS']}, {'field':'effective_status','operator':'IN','value':['ACTIVE','PAUSED']}]
将return:
{
"data": [
{
"name": <NAME>,
"objective": "POST_ENGAGEMENT",
"effective_status": "PAUSED",
"id": <ID>
},
{
"name": <NAME>,
"objective": "CONVERSIONS",
"effective_status": "PAUSED",
"id": <ID>
},
{
"name": <NAME>,
"objective": "POST_ENGAGEMENT",
"effective_status": "PAUSED",
"id": <ID>
},
{
....
}