Not getting paused ads insights using Facebook Marketing API

后端 未结 2 1939
温柔的废话
温柔的废话 2021-01-16 04:05

I wrote this script that returns a list of ads with their stats but apprently I\'m getting only insights for active ads and not paused ones - For paused ones, I\'m just gett

2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-16 04:29

    You could combine more filtering criteria as example, for filter paused campaign, that the name contain the string name and start from the 1 march you can use:

    act_105433210/campaigns?filtering=[{'field':'effective_status','operator':'IN','value':['PAUSED']},{'field':'name','operator':'CONTAIN','value':'name'},{'field':'created_time','operator':'GREATER_THAN','value':'1551444673'}]&fields=created_time,name,effective_status,insights{spend,impressions,clicks}
    

    the timestamp should be an epoch timestamp, in the example is the:

    Epoch timestamp: 1551444673 Human time (GMT): Friday, March 1, 2019 12:51:13 PM

提交回复
热议问题