facebook / facebook-php-business-sdk

PHP SDK for Meta Marketing API
https://developers.facebook.com/docs/business-sdk
Other
837 stars 519 forks source link

Fatal error: Call to undefined method FacebookAds\Object\AdCampaign::getStats() #107

Closed nilaybrahmbhatt closed 9 years ago

nilaybrahmbhatt commented 9 years ago

HI, I TRIED TO FETCH STATES OF CAMPAIGNS.

BUT I GET ERROR

Fatal error: Call to undefined method FacebookAds\Object\AdCampaign::getStats()

MYCODE IS

$fields = array( 'start_time','actions','spent','clicks','impressions','end_time', ); $params = array(); $campaign = new AdCampaign("6024730380269"); $stats = $campaign->getStats($fields, $params);

pruno commented 9 years ago

Hi @nilaybrahmbhatt,

stats API has been deprecated in v2.4 in favor of the insights edge.

Full 2.4 API change-log: https://developers.facebook.com/docs/marketing-api/changelog#v2_4 Insights API: https://developers.facebook.com/docs/marketing-api/insights/v2.4 Main SDK commit: https://github.com/facebook/facebook-php-ads-sdk/commit/597a47021fe89062aa8ca6b163cc861b6974d6ff