Graph API Version

Ad Recommendation

Reading

A recommendation object that suggests potential improvements around the ad object's configuration.

Each recommendation contains a unique integer value: code, human readable: title and message. Additionally, a field indicating how important: importance and accurate: confidence we believe this recommendation is. Finally, a blame_field associating the recommendation with a field in the spec.

Currently supported recommendations (split by ad levels):
Level Code Summary Blame Fields
Ad Set1772120Incompatible Instagram placement for ad buying typetargeting
Ad Set1815312Audience Network Not Allowed For Ad Accounttargeting
Ad Set1815331Buying Type Not Supported for Messenger Placementtargeting
Ad Set1815420Billing event is invalid for Audience Network inside video views objectivetargeting
Ad Set1815560Instant Article Not Allowed For AdAccounttargeting
Ad Set1815604Placement Not Supported By Dynamic Creativetargeting
Ad Set1815609Placement Not Supported By Objectivetargeting
Ad Set1815610Device Platform Not Supported By Objectivetargeting
Ad Set1815612Device Platform Not Supported By Optimization Goaltargeting
Ad Set1815618Positions Filtered Because No Corresponding Publisher Or Devicetargeting
Ad Set1815619Publisher Placement Not Availabletargeting
Ad Set1942004Your Ad Set Targets Multiple Countriestargeting
Ad Set1942006Ad Isn't Optimized for Conversionsoptimization_goal
Ad Set1942016Ad Set Endedend_time
Ad Set2238043Buying Type Not Supported for IG Explore Placementtargeting
Ad1942001Targeted Languages Don't Match Textcreative
Ad1942006Ad Isn't Optimized for Conversionstracking_specs
Ad1942007Country Languages Don't Match Ad Creativecreative
Ad1942017Text Overlay Penalty Level Lowcreative
Ad1942018Text Overlay Penalty Level Mediumcreative
Ad1942019Text Overlay Penalty Level Highcreative
Ad1942022Relevance score of your ad is low
Ad1942027Ad Image Needs Improvementcreative
Ad1942028This Ad Cannot Be Delivered to Some Positions
Ad2007014Multi-photo not supportedcreative

Examples

You can read the recommendations field off of a campaign, ad set, or ad object. The example illustrates reading the recommendations off of an ad.

use FacebookAds\Object\Ad;
use FacebookAds\Object\Fields\AdFields;

$ad = new Ad($ad_id);
$ad->read(array(
  AdFields::NAME,
  AdFields::RECOMMENDATIONS,
));

// Output Ad name.
echo $ad->{AdFields::NAME}.PHP_EOL;
// Output recommendations
echo $ad->{AdFields::RECOMMENDATIONS}.PHP_EOL;
curl \
-d "fields=id,recommendations" \
-d "access_token=<ACCESS_TOKEN>" \
https://graph.facebook.com/<API_VERSION>/<AD_ID>

Example

Graph API Explorer
GET v5.0/...?fields={fieldname_of_type_AdRecommendation} HTTP/1.1
Host: graph.facebook.com
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->get(
    '...?fields={fieldname_of_type_AdRecommendation}',
    '{access-token}'
  );
} catch(Facebook\Exceptions\FacebookResponseException $e) {
  echo 'Graph returned an error: ' . $e->getMessage();
  exit;
} catch(Facebook\Exceptions\FacebookSDKException $e) {
  echo 'Facebook SDK returned an error: ' . $e->getMessage();
  exit;
}
$graphNode = $response->getGraphNode();
/* handle the result */
/* make the API call */
FB.api(
    "...?fields={fieldname_of_type_AdRecommendation}",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "...?fields={fieldname_of_type_AdRecommendation}",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
// For more complex open graph stories, use `FBSDKShareAPI`
// with `FBSDKShareOpenGraphContent`
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"...?fields={fieldname_of_type_AdRecommendation}"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
If you want to learn how to use the Graph API, read our Using Graph API guide.

Parameters

This endpoint doesn't have any parameters.

Fields

FieldDescription
blame_field
string

Field to associate the recommendation with (optional)

code
int32

Unique recommendation code

confidence
enum {HIGH, MEDIUM, LOW}

Indicator of how reliable recommendation is. Allowed values are: HIGH, MEDIUM, LOW

importance
enum {HIGH, MEDIUM, LOW}

Indicator of how important recommendation is. Allowed values are: HIGH, MEDIUM, LOW

message
string

Content of the recommendation message

recommendation_data
AdRecommendationData

Additional data associated with the recommendation. Returned fields can vary depending on the recommendation code.

title
string

Recommendation title

Creating

You can't perform this operation on this endpoint.

Updating

You can't perform this operation on this endpoint.

Deleting

You can't perform this operation on this endpoint.