2. Example Query: Campaign Statistics
To get the statistics of a campaign 's last 7 day performance run the following query:
use FacebookAds\Object\AdCampaign; use FacebookAds\Object\Values\InsightsPresets; $campaign = new AdCampaign('<AD_CAMPAIGN_ID>'); $params = array( 'date_preset' => InsightsPresets::LAST_7_DAYS, ); $insights = $campaign->getInsights(null, $params); print_r($insights);
To learn more about how to query statistics, see the ad insights edge documentation.
3. All Endpoints
The Ads Insights API covers the following endpoints:
Any endpoints not in the above list are not covered in this API.
If you are planning to include reports for Facebook in your product interface, please refer to section 14.7 of the Ads API policy.