Graph API Version

Ad Study Objectives

Reading

AdStudyObjectives

Example

Graph API Explorer
GET /v5.0/{ad-study-id}/objectives 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(
    '/{ad-study-id}/objectives',
    '{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(
    "/{ad-study-id}/objectives",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{ad-study-id}/objectives",
    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:@"/{ad-study-id}/objectives"
                                      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

Reading from this edge will return a JSON formatted result:

{ "data": [], "paging": {} }

data

A list of AdStudyObjective nodes.

paging

For more details about pagination, see the Graph API guide.

Validation Rules

ErrorDescription
200Permissions error

Creating

You can make a POST request to objectives edge from the following paths:
When posting to this edge, an AdStudyObjective will be created.

Parameters

ParameterDescription
adspixels
list<JSON or object-like arrays>

Ads pixels used for sales or converion tracking. Be sure to include the event_names that you want to measure.

id
numeric string or integer

Required
event_names
list<enum{AddPaymentInfo, AddToCart, AddToWishlist, CompleteRegistration, InitiateCheckout, Lead, Purchase, Search, ViewContent, Contact, CustomizeProduct, Donate, FindLocation, Schedule, StartTrial, SubmitApplication, Subscribe}>

applications
list<JSON or object-like arrays>

Applications that you wish to track mobile app installs or events from. Be sure to include the event_names that you want to measure.

id
numeric string or integer

Required
event_names
list<string>

customconversions
list<JSON or object-like arrays>

Custom conversions used for sales or converion tracking.

id
numeric string or integer

Required
event_names
list<string>

is_primary
boolean

A boolean to decide if this is the primary objective. Used for dashboarding.

name
string

A human readable string to help identify the objective.

offline_conversion_data_sets
list<JSON or object-like arrays>

The offline conversion data sets associated with the lift study

id
numeric string or integer

Required
event_names
list<string>

offsitepixels
list<JSON or object-like arrays>

Old conversion pixel for tracking online conversions.

id
numeric string or integer

Required
event_names
list<string>

product_sets
list<JSON or object-like arrays>

The product sets associated with the lift study

id
numeric string or integer

Required
event_names
list<string>

type
enum {SALES, NONSALES, MAE, TELCO, FTL, MAI, PARTNER, BRANDLIFT, BRAND}

An enum for the type of objective this is.

Return Type

This endpoint supports read-after-write and will read the node represented by id in the return type.
Struct {
id: numeric string,
}

Validation Rules

ErrorDescription
200Permissions error

Updating

You can't perform this operation on this endpoint.

Deleting

You can't perform this operation on this endpoint.