gpt4 book ai didi

php - 如何使用 fb api 计算预计每日到达率

转载 作者:可可西里 更新时间:2023-10-31 23:19:48 25 4
gpt4 key购买 nike

我想使用 fb api 显示每日预估覆盖面。

我试过下面的代码:-

$ch = curl_init();
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_USERAGENT, 'facebook');

$url_en = urlencode("{'geo_locations':{'countries': ['US'],},'age_min':20,'age_max':24}");


curl_setopt($ch, CURLOPT_URL, "https://graph.facebook.com/v2.2/act_1375199556085956/reachestimate?access_token=ACCESS TOKEN&targeting_spec=".$url_en);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 0);
//curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$data = curl_exec($ch);

但是得到下面的响应数据:-

"data": {
"users": 14600000,
"bid_estimations": [
{
"unsupported": false,
"location": 3,
"cpa_min": 79,
"cpa_median": 145,
"cpa_max": 195,
"cpc_min": 45,
"cpc_median": 70,
"cpc_max": 87,
"cpm_min": 8,
"cpm_median": 20,
"cpm_max": 27
}
],
"estimate_ready": true
}
}

但是,我想要这样的结果:

enter image description here

请帮我解决这个问题。

最佳答案

在 v2.9 中添加

/<AD_ACCOUNT>/delivery_estimate

/<AD_SET>/delivery_estimate

引用:https://developers.facebook.com/docs/marketing-api/buying-api/targeting/v2.9

关于php - 如何使用 fb api 计算预计每日到达率,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28231828/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com