Reputation: 185
Graph API Explorer returning following get request
act_396592**/insights?fields=actions
AS
{
"data": [
]
}
I have also tried using ad id and time range
/6072038816***/insights?fields=impressions&since=2017-08-01&until=2017-08-10
Note: This account has enough ads. I have taken ads_read permission.
Upvotes: 1
Views: 3155
Reputation: 1712
For future reference: the default value for date_preset
of 'last_30d' is particularly deceitful when you retrieve insights as an edge for e.g. ads or campaigns and can be the cause for not receiving any Ads Insights.
This only returns insights for ads active in the last 30 days:
<ad account id>/ads?fields=name,id,created_time,insights{impressions,cost_per_unique_click}
All other ads are retrieved as well, but without Insights.
To include all Ads Insights, use .date_preset(lifetime)
:
<ad account id>/ads?fields=name,id,created_time,insights.date_preset(lifetime){impressions,cost_per_unique_click}
Upvotes: 2
Reputation: 185
act_396592**/insights
Above Request didn't work, because Facebook by default shows last 30 days insights doc. If the ad wasn't active within last 30 days then empty data returns.
/6072038816***/insights?fields=impressions&since=2017-08-01&until=2017-08-10
Above request did't work, because parameters are wrong. I don't know why it didn't throw any error. Its indeed confusing. The one of correct ways is, using time_range
/6072038816***/insights?fields=impressions&time_range={'since':'2017-08-01','until':'2017-08-10'}
or using date_preset
/insights?fields=reach&date_preset=lifetime
Upvotes: 8
Reputation: 2613
Specifically for ads, there are times when you will not be able to retrieve data via Insights. This is particularly true for ads that have been edited. This is a side-effect of an improvement that was made to allow feedback from posts to be carried over to updated ads.
This section (taken from the source mentioned below) explicitly mentions potentially losing access to Insights:
Once we carry social feedback after you edit an ad, the new ad's post and the old post share social feedback. This relationship results in other limitations. Once you edit an ad, you cannot:
- Publish or schedule to publish new or old ad posts
- Retrieve post insights for old or new ad posts
- Reuse old or new ad posts Boost old or new ad posts
- Read old or new ad posts at /promotable_posts
I encourage you to read the full blog post available here.
Source: https://developers.facebook.com/ads/blog/post/2017/07/18/transfering-reactions/
Upvotes: 0