I'm trying to get the insights from a Facebook adset using Node.js. It is working fine, except that it doesn't seem to refresh the data. The budget remaining does decrease, yet the impressions and reach etc. stay the same when querying from the API. When you look at the adaccount in Facebook itself, the data has changed.
So my question is, when does the API refresh these fields or how can I force the data to be updated?
When using the Graph API Explorer (https://developers.facebook.com/tools/explorer/) using this call:
{adsetId}/insights?fields=clicks,impressions,reach,spend
It also gives outdated information (some hours earlier).
We we're facing a similar issue. Turned out the default value for the date_preset
field is last_30d
which does not include today. If you want the latest data from the API you can pass the time_range
parameter so it includes the latest data.
See https://developers.facebook.com/docs/marketing-api/reference/adgroup/insights for more information.