facebook ads api
api测试
https://developers.facebook.com/tools/explorer/517735271920003?method=GET&path=act_1107316072738457%2Finsights%3F%26fields%3Dclicks%2Cimpressions%2Cspend%26level%3Daccount%26breakdowns%3D%26time_increment%3D1%26time_range%3D%7B'since'%3A'2017-11-26'%2C'until'%3A'2017-12-26'%7D&version=v2.11
me/adaccounts
#getting ad accounts 获取到ad node
2、FB.api('/me/adaccounts'); FB.api('/me/adaccounts?fields=id,name'); FB.api('act_221377094983518?fields=id,name');
#creating campaigns 创建广告系列
3、FB.api('/act_221377094983518/campaigns', 'POST', {'name':'我的广告','objective':'LINK_CLICKS'}); MOBILE_APP_INSTALLS
、CONVERSIONS
等
#updating campaigns 修改广告系列的相关设置
4、FB.api('23842545377820361', 'POST', {'status':'PAUSED'}); //暂停
app 添加products:marketing api
添加account授权
获取token
获取userid、过期时间、short time access token
获取long time user access token:(60天有效期)
oauth/access_token?grant_type=fb_exchange_token&client_id=***********&client_secret=********&fb_exchange_token={short-time-access-token}
获取app access token:
oauth/access_token?client_id=********&client_secret=**********&grant_type=client_credentials
获取short time user access token:(2小时有效期)
登陆=》调用callbackurl,给出accesstoken=》添加app id、app secret后获取long time access token=》保存=》调用接口使用
类似授权登陆的流程
接口调用,graph api explorer可以不用添加param:access_token={valid access token}
me/adaccounts
{user id}/adaccounts
act_{ads account id}/users
1 2 3 4 5 6 7 8 9 10 11 | /// <summary> /// SystemUserId or UserId. /// ///( SystemUserId /// https://graph.facebook.com/API_VERSION/BUSINESS_ID/system_users /// ref:https://developers.facebook.com/docs/marketing-api/businessmanager/systemuser) /// ///( UserId /// ref:https://developers.facebook.com/docs/graph-api/reference/user/ /// https://graph.facebook.com/API_VERSION/me/ids_for_business) /// </summary> |
act_{ads account id}/insights?
act_{ads account id}/insights?fields=account_id,account_name,campaign_id{cost_per_action,results},campaign_name,date_stop,date_start,clicks,impressions,total_action_value,total_actions,spend,actions,action_values,website_purchase_roas,reach&level=account&breakdowns=&time_increment=1&action_attribution_windows=1d_view,28d_click,default&time_range={'since':'2018-01-01','until':'2018-01-22'}
#facebook 获取report
curl "https://graph.facebook.com/v2.11/act_1534433596654710/insights?access_token=************************&fields=account_id,account_name,campaign_id{cost_per_action,results},campaign_name,d
ate_stop,date_start,clicks,impressions,total_action_value,total_actions,spend,actions,action_values,website_purchase_roa
s,reach&level=account&breakdowns=&time_increment=1&action_attribution_windows=1d_view,28d_click,default&time_range={'sin
ce':'2018-01-01','until':'2018-01-29'}"
https://developers.facebook.com/docs/applinks/metadata-reference
https://developers.facebook.com/docs/marketing-api/dynamic-product-ads/debugging-tools/event_statistics/v2.12
https://developers.facebook.com/docs/marketing-api/reference/ad-campaign-group/insights/
https://developers.facebook.com/docs/marketing-api/reference/ad-report-run/
https://developers.facebook.com/docs/marketing-api/targeting-specs
https://developers.facebook.com/docs/marketing-api/targeting-search#country_group
https://developers.facebook.com/docs/marketing-api/reference/ads-action-stats/ #action_device
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 没有源码,如何修改代码逻辑?
· 一个奇形怪状的面试题:Bean中的CHM要不要加volatile?
· [.NET]调用本地 Deepseek 模型
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· .NET Core 托管堆内存泄露/CPU异常的常见思路
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· DeepSeek R1 简明指南:架构、训练、本地部署及硬件要求
· 没有源码,如何修改代码逻辑?
· NetPad:一个.NET开源、跨平台的C#编辑器
· 面试官:你是如何进行SQL调优的?