1

https://developers.facebook.com/docs/reference/ads-api/adreportstats/

基于文档

time_ranges 时间戳对象数组 {time_start, time_stop} 或日期对象 {day, month, year}。

所以在 Graph API Explorer 中,我将 time_ranges 值设置为

time_ranges=[{"day_start":{"day":1,"month":11,"year":2013}},{"day_stop":{"day":10,"month":11,"year":2013}}]

这给我一个错误

{
  "error": {
    "message": "(#100) Please set time_start and time_stop or day_start and day_stop.", 
    "type": "OAuthException", 
    "code": 100
  }
}

为简洁起见,我删除了上述 URL 的其他部分。我已经尝试使用 date_preset 值并且报告返回数据。

谢谢。

编辑:完整的 URL(没有有效的帐户 ID)

https://graph.facebook.com/act_12345/reportstats?data_columns=["account_id","account_name","campaign_id","campaign_name","impressions","clicks","spend"]&time_ranges=["{ 'day_start':{'day':1,'month':11,'year':2013}}","{'day_stop':{'day':10,'month':11,'year':2013 }}"]

4

3 回答 3

4

我有(有!)一个相同的问题。

我通过使用time_startandtime_stop而不是day_startand来解决它day_stop。愚蠢,我知道……但这对我有用。

因此,要获取 1 天的数据(例如 11 月 19 日):

 &time_ranges=["{'time_start': '2013-11-19','time_stop':'2013-11-20'}"]
于 2013-11-21T21:44:25.360 回答
0

我有同样的问题,尝试使用:

time_ranges=["{'day_start':{'day':1,'month':11,'year':2013}, 'day_stop':{'day':10,'month':11,'year':2013}}"]

代替:

time_ranges=["{'day_start':{'day':1,'month':11,'year':2013}}","{'day_stop':{'day':10,'month':11,'year':2013}}"]

完整网址:

https://graph.facebook.com/act_12345/reportstats?data_columns=["account_id","account_name","campaign_id","campaign_name","impressions","clicks","spend"]&time_ranges=["{'day_start':{'day':1,'month':11,'year':2013}, 'day_stop':{'day':10,'month':11,'year':2013}}"]

我在https://developers.facebook.com/x/bugs/1423346704577387/打开了一个文档问题

于 2014-02-24T20:11:36.753 回答
0

奇怪的是,该示例似乎是一个字符串数组,它们是 json 对象。所以尝试改变这一行:

time_ranges=[{"day_start":{"day":1,"month":11,"year":2013}},{"day_stop":{"day":10,"month":11,"year":2013}}]

对此:

time_ranges=["{'day_start':{'day':1,'month':11,'year':2013}}","{'day_stop':{'day':10,'month':11,'year':2013}}"]
于 2013-11-14T04:09:22.040 回答