facebookarchive / php-graph-sdk

The Facebook SDK for PHP provides a native interface to the Graph API and Facebook Login. https://developers.facebook.com/docs/php
Other
3.17k stars 1.95k forks source link

Insights with breakdown `impression_device` sometimes missing `impression_device` property #1185

Closed jskrivseth closed 4 years ago

jskrivseth commented 4 years ago

When using the insights endpoint and requesting:

$insightsFields = ["ad_id", "adset_id", "actions", "action_values"];
$insightsParams = [
   'breakdowns' => ['impression_device'],
   'level' => 'ad',
   'time_increment' => 1
];
$cursor = $adAccount->getInsightsAsync($insightsFields, $insightsParams);
foreach ($cursor as $insight) {
   //we expect that $insight->impression_device to always exist for every record, but they don't
}

We receive a (mostly) expected response, but some of the insights simply don't have the impression_device property at all.

This only happens when using the v6 PHP client, but never with the v5 endpoint. I can't find anything in the release notes or documentation to help.

Any ideas why impression_device would be missing for only some records when asking for this breakdown?

jskrivseth commented 4 years ago

Moved this to a bug report on facebook/php-ads-sdk