Skip to content

Ad Pixel

Updated: Apr 29, 2026

Reading

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

Example

Select language

HTTPPHP SDKJavaScript SDKAndroid SDKiOS SDK


GET /v25.0/{ads-pixel-id} HTTP/1.1  
Host: graph.facebook.com

Try it in Graph API Explorer

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
id numeric stringID of the pixel default
automatic_matching_fields list<enum>Advanced matching fields which are enabled for automatic advanced matching
can_proxy boolcan_proxy
code stringPixel code to be placed on the website
config  stringThe configuration to use for uploads to this dataset. Format determined by the method of upload (eg. UI or SDK)
creation_time datetimeTime at which the pixel was created
creator UserThe user who created this pixel
data_use_setting enumSetting to capture how pixel data should be used
description  stringSELF_EXPLANATORY
duplicate_entries  integerNumber of duplicate entries for this dataset
enable_auto_assign_to_accounts  boolWhether the dataset is auto assigned and auto tracked for all accounts that the owner business owns
enable_automatic_matching boolRepresents whether automatic advanced matching is enabled for the pixel for identity matching purposes
event_stats  stringEvent stats of this dataset
event_time_max  integerLatest entry of this dataset
event_time_min  integerEarliest entry of this dataset
first_party_cookie_status enumFirst party cookie status to indicate whether first party cookies can be set for this pixel
has_1p_pixel_event boolwhether pixel has sent us 1p signals
is_consolidated_container  boolA boolean value indicating whether this signal container has unified pixel and offline conversion data set
is_created_by_business boolFlag stands for if a pixel is created by business
is_crm boolTrue if a pixel contains lead gen data source config
is_mta_use  boolWhether the dataset is restricted to MTA only
is_restricted_use  boolWhether the dataset is restricted to Lift only
is_unavailable boolWhether this pixel is unavailable
last_fired_time datetimeTime at which the pixel was last fired
last_upload_app  stringThe app that made the most recent upload
last_upload_app_changed_time  integerTime when the app that made the most recent upload last changed
match_rate_approx  int32Approximate match rate percentage for the entries in this dataset
matched_entries  integerNumber of matched entries of this dataset
name stringName of the pixel
owner_business BusinessID of the business that owns this pixel or null if the pixel has not been claimed by any business yet.
usage  OfflineConversionDataSetUsageUsage info for the dataset
valid_entries  integerNumber of valid entries of this dataset

Edges

EdgeDescription
assigned_users Edge<AssignedUser>assigned_users
da_checks Edge<DACheck>A list of results after running Dynamic Ads checks on this pixel.
offline_event_uploads  Edge<OfflineConversionDataSetUpload>The offline uploads associated with this event set
openbridge_configurations Edge<OpenBridgeConfiguration>Get all the openbridge configurations associated to this Pixel
shared_agencies Edge<Business>Agencies or other businesses this pixel is shared with
stats Edge<AdsPixelStatsResult>Stats data for this pixel

Error Codes

Error CodeDescription
200Permissions error
100Invalid parameter
80004There have been too many calls to this ad-account. Wait a bit and try again. For more info, please refer to /docs/graph-api/overview/rate-limiting#ads-management.
368The action attempted has been deemed abusive or is otherwise disallowed
190Invalid OAuth 2.0 Access Token
2500Error parsing graph query

Creating

/act_{ad_account_id}/adspixels

You can make a POST request to adspixels edge from the following paths:

When posting to this edge, an AdsPixel will be created.

Example

Select language

HTTPPHP SDKJavaScript SDKAndroid SDKiOS SDKcURL


POST /v25.0/act_<AD_ACCOUNT_ID>/adspixels HTTP/1.1  
Host: graph.facebook.com  
  
name=My+WCA+Pixel

Try it in Graph API Explorer

If you want to learn how to use the Graph API, read our Using Graph API guide

Parameters

ParameterDescription
name stringName of the pixel

Return Type

This endpoint supports read-after-write and will read the node represented by id in the return type.

Struct  {
id: numeric string,
}

Error Codes

Error CodeDescription
6202More than one pixel exist for this account
6200A pixel already exists for this account
100Invalid parameter
200Permissions error

Updating

/{ads_pixel_id}

You can update an AdsPixel by making a POST request to /{ads_pixel_id}.

Parameters

ParameterDescription
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 booleanEnable 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 stringName of the pixel
server_events_business_ids array<numeric string>server_events_business_ids

Return Type

This endpoint supports read-after-write and will read the node to which you POSTed.

Struct  {
success: bool,
}

Error Codes

Error CodeDescription
190Invalid OAuth 2.0 Access Token
100Invalid parameter

Deleting

Unofficial mirror for reference/search purposes. All content originates from developers.facebook.com — see the source link at the top of each page. Machine-readable indexes: llms.txt · llms-full.txt · About