I am trying to get insights for ongoing and past Ads.
Using graph api
$fields2=array('fields' => 'cpc,clicks,impressions,actions,spend,reach,video_p100_watched_actions,video_p25_watched_actions,video_p50_watched_actions,video_p75_watched_actions,video_p95_watched_actions,video_avg_percent_watched_actions',
'time_increment' => "1",
'access_token'=>$token);
$fields2=http_build_query($fields2);
$curl2 = curl_init();
curl_setopt_array($curl2, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_URL => "https://graph.facebook.com/v2.8/$AD_ID/insights/?$fields2"
));
After giving it an Ad ID I get all the metrics that I want, unless an AD is no longer running.
For all Ads that are no longer running, all I get is this
{
"data": [
]
}
Is there a way to get insights for Ads that are no longer running? If so, which fields do I need to add?