Get Ad Insights

For stats on your Instagram ads, use the Insights API from ad account to ads.

use FacebookAds\Object\Campaign;

$campaign = new Campaign(<CAMPAIGN_ID>);
$insights = $campaign->getInsights();
from facebookads.adobjects.campaign import Campaign

campaign = Campaign(<CAMPAIGN_ID>)
insights = campaign.get_insights()
curl -G \
  -d 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v2.11/<CAMPAIGN_ID>/insights

If you are running a campaign on Instagram and Facebook, add breakdowns=publisher_platform to see the stats of Facebook and Instagram placements separately:

curl -X GET \ -d 'fields="impressions"' \ -d 'breakdown="publisher_platform"' \ -d 'access_token=<ACCESS_TOKEN>' \ https://graph.facebook.com/v7.0/<AD_SET_ID>/insights
'use strict'; const bizSdk = require('facebook-nodejs-business-sdk'); const AdSet = bizSdk.AdSet; const AdsInsights = bizSdk.AdsInsights; const access_token = '<ACCESS_TOKEN>'; const app_secret = '<APP_SECRET>'; const app_id = '<APP_ID>'; const id = '<AD_SET_ID>'; const api = bizSdk.FacebookAdsApi.init(access_token); const showDebugingInfo = true; // Setting this to true shows more debugging info. if (showDebugingInfo) { api.setDebug(true); } const logApiCallResult = (apiCallName, data) => { console.log(apiCallName); if (showDebugingInfo) { console.log('Data:' + JSON.stringify(data)); } }; let fields, params; fields = [ 'impressions', ]; params = { 'breakdown' : 'publisher_platform', }; const insightss = (new AdSet(id)).getInsights( fields, params ); logApiCallResult('insightss api call complete.', insightss);
require __DIR__ . '/vendor/autoload.php'; use FacebookAds\Object\AdSet; use FacebookAds\Object\AdsInsights; use FacebookAds\Api; use FacebookAds\Logger\CurlLogger; $access_token = '<ACCESS_TOKEN>'; $app_secret = '<APP_SECRET>'; $app_id = '<APP_ID>'; $id = '<AD_SET_ID>'; $api = Api::init($app_id, $app_secret, $access_token); $api->setLogger(new CurlLogger()); $fields = array( 'impressions', ); $params = array( 'breakdown' => 'publisher_platform', ); echo json_encode((new AdSet($id))->getInsights( $fields, $params )->getResponse()->getContent(), JSON_PRETTY_PRINT);
from facebook_business.adobjects.adset import AdSet from facebook_business.adobjects.adsinsights import AdsInsights from facebook_business.api import FacebookAdsApi access_token = '<ACCESS_TOKEN>' app_secret = '<APP_SECRET>' app_id = '<APP_ID>' id = '<AD_SET_ID>' FacebookAdsApi.init(access_token=access_token) fields = [ 'impressions', ] params = { 'breakdown': 'publisher_platform', } print AdSet(id).get_insights( fields=fields, params=params, )
import com.facebook.ads.sdk.*; import java.io.File; import java.util.Arrays; public class SAMPLE_CODE_EXAMPLE { public static void main (String args[]) throws APIException { String access_token = \"<ACCESS_TOKEN>\"; String app_secret = \"<APP_SECRET>\"; String app_id = \"<APP_ID>\"; String id = \"<AD_SET_ID>\"; APIContext context = new APIContext(access_token).enableDebug(true); new AdSet(id, context).getInsights() .setParam(\"breakdown\", \"publisher_platform\") .requestField(\"impressions\") .execute(); } }
require 'facebook_ads' access_token = '<ACCESS_TOKEN>' app_secret = '<APP_SECRET>' app_id = '<APP_ID>' id = '<AD_SET_ID>' FacebookAds.configure do |config| config.access_token = access_token config.app_secret = app_secret end ad_set = FacebookAds::AdSet.get(id) insightss = ad_set.insights({ fields: { 'impressions' }, breakdown: 'publisher_platform', })

The result looks like this:

{
  "data": [
    {
      "actions": [
        {
          "action_type": "comment", 
          "value": 49
        }, 
        ...
      ], 
      "actions_per_impression": 0.13427956056216, 
      ...
      "clicks": 3917, 
 
      "video_avg_pct_watched_actions": [
        {
          "action_type": "video_view", 
          "value": 88.13
        }
      ], 
      ...
      "video_p25_watched_actions": [
        {
          "action_type": "video_view", 
          "value": 28016
        }
      ], 
      "video_p50_watched_actions": [
        {
          "action_type": "video_view", 
          "value": 17606
        }
      ], 
      ...
      "placement": "instagram_stream"
    }
  ], 
  "paging": {
    ...
  }
}

The two possible placements in Insights are instagram_stream and instagram_stories.

There are other breakdown combinations which include publisher_platform that you can use. To track performance of ads with both Facebook and Instagram placements with external tools, use the url_tags macro SITE_SOURCE_NAME to distinguish different placements.

Tracking Tags

View tags are not publicly available. If we permit view tags by an approved vendor on Facebook mobile campaigns, we also allow them for Instagram ads. You can use Ad creative's url_tag field with Instagram ads.

You can use third-party tracking tags for Instagram ads, however note do not optimize ads delivery for third-party tracking tools. To make sure that the third party tracking tool can track Instagram ads properly, use Ad creative's url_tag field with utm_source=instagram.