Версия API Graph

Ad Account, Custom Conversions

Data on custom conversion events from event sources, such as pixels. You can query this data to measure the effectiveness of our ads. Or use it to optimize ad delivery to target people who converted as defined by your customization and rules.

Чтение

AdAccountCustomConversions

Пример

Graph API Explorer
GET /v19.0/{ad-account-id}/customconversions 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-account-id}/customconversions',
    '{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-account-id}/customconversions",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{ad-account-id}/customconversions",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{ad-account-id}/customconversions"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
Чтобы узнать, как использовать API Graph, ознакомьтесь с нашим руководством по API Graph.

Параметры

Эта конечная точка не содержит параметров.

Поля

При чтении с данной границы контекста будет возвращен результат в формате JSON:

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

data

Список узлов «CustomConversion».

paging

Для получения дополнительных сведений о пагинации смотрите Руководство по API Graph.

Error Codes

ОшибкаОписание
100Invalid parameter
80004There have been too many calls to this ad-account. Wait a bit and try again. For more info, please refer to https://developers.facebook.com/docs/graph-api/overview/rate-limiting#ads-management.
2635You are calling a deprecated version of the Ads API. Please update to the latest version.
190Invalid OAuth 2.0 Access Token
200Permissions error

Создание

Вы можете сделать запрос POST к границе customconversions из этих местоположений:
При размещении публикации на этой границе создается a CustomConversion.

Параметры

ПараметрОписание
action_source_type
enum{app, chat, email, other, phone_call, physical_store, system_generated, website, business_messaging}

action source type the custom conversion is created from

advanced_rule
string

Advanced ruleset for the custom conversion being created allowing multiple sources.

custom_event_type
enum {ADD_PAYMENT_INFO, ADD_TO_CART, ADD_TO_WISHLIST, COMPLETE_REGISTRATION, CONTENT_VIEW, INITIATED_CHECKOUT, LEAD, PURCHASE, SEARCH, CONTACT, CUSTOMIZE_PRODUCT, DONATE, FIND_LOCATION, SCHEDULE, START_TRIAL, SUBMIT_APPLICATION, SUBSCRIBE, LISTING_INTERACTION, FACEBOOK_SELECTED, OTHER}

The custom event type of the conversion being created

default_conversion_value
float
Значение по умолчанию: 0

The default conversion value of the conversion being created

description
string

The description of the conversion being created

event_source_id
numeric string or integer

Event source ID, where event sources are pixel, offline event sets and so on. Aggregate custom conversion data from these sources.

name
string

The name of the conversion being created

Обязательно
rule
string

Only count an event as a custom conversion if it fulfills this rule.

Тип возврата

Эта конечная точка поддерживаетчтение после записи и будет считывать узел, представленный id в типе возврата.
Struct {
id: numeric string,
is_custom_event_type_predicted: numeric string,
}

Error Codes

ОшибкаОписание
100Invalid parameter
200Permissions error
80004There have been too many calls to this ad-account. Wait a bit and try again. For more info, please refer to https://developers.facebook.com/docs/graph-api/overview/rate-limiting#ads-management.

Обновление

Нельзя выполнить эту операцию в этой конечной точке.

Удаление

Нельзя выполнить эту операцию в этой конечной точке.