facebook-python-business-sdk icon indicating copy to clipboard operation
facebook-python-business-sdk copied to clipboard

start_time / end_time invalid for fetching stats in hour level

Open linpingta opened this issue 11 years ago • 2 comments

I have one question that really confused me about statistics.

When I try to fetch stats in [start_time, end_time] recently, like below:

account = AdAccount("act_<ACT_ID>")
params = {
    'adgroup_ids' : <JSON ID STR>,
    'start_time' : <UNIX_TIME>,                 # 20150319:10:00, here is 1426730400
    'end_time' : <UNIX_TIME>,                  # 20150319:11:00, here is 1426734000
}
adgroup_stats_list = account.get_ad_group_stats(params=params)

for adgroup_stats in adgroup_list:
     print adgroup_stats['adgroup_id']
     print adgroup_stats['clicks']
     print adgroup_stats['impressions']
     print adgroup_stats['actions']['mobile_app_install']

it returns stats not in [10:00, 11:00] , but [0:00, current_time], it seems start_time and end_time not useful in hour level, however, when I used the API one month ago, it returns clicks and impressions in [10:00, 11:00], it seems sth changed, and I'm not sure the standard behavior for this API call.

Could anyone answer my question? thanks a lot

linpingta avatar Mar 27 '15 08:03 linpingta

Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.

ghost avatar Aug 04 '15 18:08 ghost

The AdReportStats endpoint has been deprecated with the advent of v2.4. The insights edge supports requests to get stats on different ad objects. You can find the equivalent for the above call with the insights api. More details can be fond here- https://developers.facebook.com/docs/marketing-api/insights/v2.4

rituparnamukherjee avatar Sep 03 '15 21:09 rituparnamukherjee