그래프 API 버전

Custom Conversions

Optimize ads delivery based on online and offline conversion events that you define. Track activity without adding new events Meta Pixel. Custom conversions objects are associated with an Ad Account. Use them to describe events you want to measure and events you want to track to optimize ads delivery.

Specify actions that are different from the nine standard events. See also Facebook Pixel, Conversion Tracking with Facebook Pixel and Promoted Object.

You need standard API access for this endpoint. See Marketing API, Access Levels.

For example, define a PURCHASE conversion as an event occuring when someone visits certain pages such as thankyou.html or confirmation.html:

curl \
-F 'name=URL based Custom Conversion' \
-F 'event_source_id=<FB_PIXEL_ID>' \
-F 'rule={"or":[{"url":{"i_contains": "thankyou.html"}},{"url":{"i_contains":"confirmation.html"}}]}' \
-F 'custom_event_type=PURCHASE' \
-F 'access_token=<ACCESS_TOKEN>' \
'https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/customconversions'

In this example, events occur if someone visits those two .html pages, case-insensitive of the page name and extention.

Limitations

Note that the maximum number of custom conversions you can have per ad account is 100.

If you use the Ads Insights API to get metrics on custom conversions, be aware of these limitations:

  • Getting product ID breakdowns are not supported.
  • Getting unique action counts are not supported.

읽기

Custom conversions on Facebook allows you to optimize and track actions without having to add anything to your Facebook pixel base code. They also allow you to optimize for and track actions that are different from the 9 standard events that come with the Facebook pixel.

2021년 9월 14일부터 엔드포인트의 필수 권한이 없는 앱에서 보낸 버전 12.0 이상 호출에 대해 다음 필드에 오류가 발생합니다. 이 변경 사항은 2021년 12월 13일부터 모든 버전에 적용됩니다.

  • pixel

List of custom conversions for an account:

curl -G \
-d 'fields=["pixel","rule","custom_event_type"]' \
-d "access_token=<ACCESS_TOKEN>" \
https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/customconversions

매개변수

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

필드

필드설명
id
numeric string

ID of the custom conversion

account_id
string

Ad Account ID assoicated to this custom conversion

business

Business that owns the custom conversion

creation_time
datetime

Time at which the conversion was created

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 type of the conversion event, e.g. PURCHASE

data_sources
list<ExternalEventSource>

Event sources of the custom conversion

default_conversion_value
integer

When conversion is URL based, the default conversion value associated to each conversion

description
string

Description of the custom conversion

event_source_type
enum

Event source type of the custom conversion, e.g. pixel, app, etc.

first_fired_time
datetime

Time at which the pixel was first fired

is_archived
bool

Whether this conversion is archived. Archived conversions are no longer tracked in the system

is_unavailable
bool

Whether this conversion is unavailable

last_fired_time
datetime

Time at which the pixel was last fired

name
string

Name of the custom conversion

pixel

The pixel that will send events

retention_days
unsigned int32

Retention period for advanced rule

rule
string

Rule of the custom conversion

에지

Edge설명
Edge<CustomConversionStatsResult>

Stats data for this conversion

오류 코드

오류설명
100Invalid parameter
270This Ads API request is not allowed for apps with development access level (Development access is by default for all apps, please request for upgrade). Make sure that the access token belongs to a user that is both admin of the app and admin of the ad account
368The action attempted has been deemed abusive or is otherwise disallowed

만들기

When you create a custom conversion, provide rule with these operators and data:

Name Description

Operators

The type of filter.

i_contains

Contains substring (case insensitive)

i_not_contains

Does not contain substring (case insensitive)

contains

Contains substring (case sensitive)

not_contains

Does not contain substring (case sensitive)

eq

Equal to (case sensitive)

neq

Not equal to (case sensitive)

lt

Less than (numeric fields only)

lte

Less than or equal to (numeric fields only)

gt

Greater than (numeric fields only)

gte

Greater than or equal to (numeric fields only)

regex_match

Matches a regular expression (eg: "example\.com.*purchase$"). The full PCRE grammar is supported

Data

The data being filtered.

url

The full escaped URL of the site visited

event

The name of the pixel event fired from your website. Example: Purchase

Examples

Defines a high-value PURCHASE when someone triggers the Purchase standard event and purchase value is greater than 100:

curl \
-F 'name=High value Purchase Custom Conversion' \
-F 'event_source_id=<FB_PIXEL_ID>' \
-F 'rule={"and":[{"event":{"eq": "Purchase"}},{"value":{"gt":100}}]}' \
-F 'custom_event_type=PURCHASE' \
-F 'access_token=<ACCESS_TOKEN>' \
'https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/customconversions'

Define a custom event then build a custom conversion for it. Specify a PURCHASE conversion that to track when a user-defined, item-sold custom event occurs. Track when someone purchases an item in a certain color.

Step 1: Define item-sold custom event in Facebook pixel on your website:

fbq('trackCustom', 'item-sold', {
   color: 'black',
   value: 1.00,
   currency: 'USD'
});

Step 2: Provide a PURCHASE conversion for the item-sold custom event for a given color by specifying it as a custom parameter:

curl \
-F 'name=Item Sold Custom Conversion' \
-F 'event_source_id=<FB_PIXEL_ID>' \
-F 'rule={"and":[{"event":{"eq": "item-sold"}},{"color":{"i_contains":"black"}}]}' \
-F 'custom_event_type=PURCHASE' \
-F 'access_token=<ACCESS_TOKEN>' \
'https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/customconversions'

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

매개변수

매개변수설명
custom_conversion_id
numeric string or integer

Custom conversion ID the business claims.

필수

반환 유형

Struct {
success: bool,
}

오류 코드

오류설명
100Invalid parameter
다음 경로에서 customconversions 에지에 POST 요청을 만들 수 있습니다:
이 에지에 게시할 때 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,
}

오류 코드

오류설명
100Invalid parameter
200Permissions error
2635You are calling a deprecated version of the Ads API. Please update to the latest version.
457The session has an invalid origin

업데이트 중

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

매개변수

매개변수설명
default_conversion_value
float

The default conversion value of the conversion being created

description
string

Description of the custom conversion

name
string

Name of the custom conversion

반환 유형

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

오류 코드

오류설명
100Invalid parameter

삭제 중

/{custom_conversion_id}에 DELETE 요청을 만들어 a CustomConversion을(를) 삭제할 수 있습니다.

매개변수

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

반환 유형

Struct {
success: bool,
}

오류 코드

오류설명
100Invalid parameter
200Permissions error