그래프 API 버전

Ad Pixel

읽기

A Facebook pixel is a small piece of JavaScript code that an advertiser places on every page of their website. This piece of code provides a set of lightweight functionalities for sending user-specific events and event-specific custom data to Facebook. Advertisers can use the Facebook pixel to capture intent information about how people are using their website. A single Facebook pixel is added to all pages of a website, and is then used to create website custom audiences

Graph API Explorer
GET /v19.0/{ads-pixel-id} 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(
    '/{ads-pixel-id}',
    '{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(
    "/{ads-pixel-id}",
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/{ads-pixel-id}",
    null,
    HttpMethod.GET,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/{ads-pixel-id}"
                                      parameters:params
                                      HTTPMethod:@"GET"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
그래프 API를 사용하는 방법을 알아보려면 그래프 API 사용 가이드를 읽어보세요.

매개변수

이 엔드포인트는 매개변수가 없습니다.

필드

필드설명
id
numeric string

ID of the pixel

automatic_matching_fields
list<enum>

Advanced matching fields which are enabled for automatic advanced matching

can_proxy
bool

can_proxy

code
string

Pixel code to be placed on the website

config
string

The configuration to use for uploads to this dataset. Format determined by the method of upload (eg. UI or SDK)

creation_time
datetime

Time at which the pixel was created

creator

The user who created this pixel

data_use_setting
enum

Setting to capture how pixel data should be used

description
string

SELF_EXPLANATORY

duplicate_entries
integer

Number of duplicate entries for this dataset

enable_auto_assign_to_accounts
bool

Whether the dataset is auto assigned and auto tracked for all accounts that the owner business owns

enable_automatic_matching
bool

Represents whether automatic advanced matching is enabled for the pixel for identity matching purposes

event_stats
string

Event stats of this dataset

event_time_max
integer

Latest entry of this dataset

event_time_min
integer

Earliest entry of this dataset

first_party_cookie_status
enum

First party cookie status to indicate whether first party cookies can be set for this pixel

is_consolidated_container
bool

A boolean value indicating whether this signal container has unified pixel and offline conversion data set

is_created_by_business
bool

Flag stands for if a pixel is created by business

is_crm
bool

True if a pixel contains lead gen data source config

is_mta_use
bool

Whether the dataset is restricted to MTA only

is_restricted_use
bool

Whether the dataset is restricted to Lift only

is_unavailable
bool

Whether this pixel is unavailable

last_fired_time
datetime

Time at which the pixel was last fired

last_upload_app
string

The app that made the most recent upload

last_upload_app_changed_time
integer

Time when the app that made the most recent upload last changed

match_rate_approx
int32

Approximate match rate percentage for the entries in this dataset

matched_entries
integer

Number of matched entries of this dataset

name
string

Name of the pixel

owner_business

ID of the business that owns this pixel or null if the pixel has not been claimed by any business yet.

usage
OfflineConversionDataSetUsage

Usage info for the dataset

valid_entries
integer

Number of valid entries of this dataset

에지

Edge설명
Edge<Business>

Agencies that have access to this dataset

Edge<AssignedUser>

assigned_users

Edge<DACheck>

A list of results after running Dynamic Ads checks on this pixel.

Edge<OfflineConversionDataSetUpload>

The offline uploads associated with this event set

Edge<OpenBridgeConfiguration>

Get all the openbridge configurations associated to this Pixel

Edge<Business>

Agencies or other businesses this pixel is shared with

Edge<AdsPixelStatsResult>

Stats data for this pixel

오류 코드

오류설명
200Permissions error
100Invalid parameter
368The action attempted has been deemed abusive or is otherwise disallowed
190Invalid OAuth 2.0 Access Token
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.

만들기

다음 경로에서 adspixels 에지에 POST 요청을 만들 수 있습니다:
이 에지에 게시할 때 an AdsPixel이(가) 생성됩니다.

Graph API Explorer
POST /v19.0/act_<AD_ACCOUNT_ID>/adspixels HTTP/1.1
Host: graph.facebook.com

name=My+WCA+Pixel
/* PHP SDK v5.0.0 */
/* make the API call */
try {
  // Returns a `Facebook\FacebookResponse` object
  $response = $fb->post(
    '/act_<AD_ACCOUNT_ID>/adspixels',
    array (
      'name' => 'My WCA Pixel',
    ),
    '{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(
    "/act_<AD_ACCOUNT_ID>/adspixels",
    "POST",
    {
        "name": "My WCA Pixel"
    },
    function (response) {
      if (response && !response.error) {
        /* handle the result */
      }
    }
);
Bundle params = new Bundle();
params.putString("name", "My WCA Pixel");
/* make the API call */
new GraphRequest(
    AccessToken.getCurrentAccessToken(),
    "/act_<AD_ACCOUNT_ID>/adspixels",
    params,
    HttpMethod.POST,
    new GraphRequest.Callback() {
        public void onCompleted(GraphResponse response) {
            /* handle the result */
        }
    }
).executeAsync();
NSDictionary *params = @{
  @"name": @"My WCA Pixel",
};
/* make the API call */
FBSDKGraphRequest *request = [[FBSDKGraphRequest alloc]
                               initWithGraphPath:@"/act_<AD_ACCOUNT_ID>/adspixels"
                                      parameters:params
                                      HTTPMethod:@"POST"];
[request startWithCompletionHandler:^(FBSDKGraphRequestConnection *connection,
                                      id result,
                                      NSError *error) {
    // Handle the result
}];
curl -X POST \
  -F 'name="My WCA Pixel"' \
  -F 'access_token=<ACCESS_TOKEN>' \
  https://graph.facebook.com/v19.0/act_<AD_ACCOUNT_ID>/adspixels
그래프 API를 사용하는 방법을 알아보려면 그래프 API 사용 가이드를 읽어보세요.

매개변수

매개변수설명
name
string

Name of the pixel

반환 유형

이 엔드포인트는 기록 후 읽기를 지원하며 반환 유형에서 id로 표시되는 노드를 읽습니다.
Struct {
id: numeric string,
}

오류 코드

오류설명
6202More than one pixel exist for this account
100Invalid parameter
6200A pixel already exists for this account
200Permissions error
190Invalid OAuth 2.0 Access Token
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.

업데이트 중

/{ads_pixel_id}에 POST 요청을 하여 an AdsPixel을(를) 업데이트할 수 있습니다.

매개변수

매개변수설명
automatic_matching_fields
array<enum {em, fn, ln, ph, ge, zp, ct, st, country, db, external_id}>

Advanced matching fields for which automatic advanced matching should be enabled

data_use_setting
enum {EMPTY, ADVERTISING_AND_ANALYTICS, ANALYTICS_ONLY}

Setting to capture how pixel data should be used

enable_automatic_matching
boolean

Enable automatic advanced matching for the pixel for identity matching purposes

first_party_cookie_status
enum {EMPTY, FIRST_PARTY_COOKIE_ENABLED, FIRST_PARTY_COOKIE_DISABLED}

First party cookie status to indicate whether first party cookies can be set for this pixel

name
string

Name of the pixel

server_events_business_ids
array<Server Events Permitted Business ID>

server_events_business_ids

반환 유형

이 엔드포인트는 기록 후 읽기 기능을 지원하며 회원님이 게시한 노드를 읽습니다.
Struct {
success: bool,
}

오류 코드

오류설명
190Invalid OAuth 2.0 Access Token
100Invalid parameter

삭제 중

이 엔드포인트에서 수행할 수 없는 작업입니다.