Meta Pixel usage, standard events and Advanced Matching with edge cases together form a comprehensive reference.
For information and support on “Data Analytics & Measurement”, visit DNOMIA’s website.
Facebook Meta Pixel
When a visitor lands on your website and starts a session, they can be associated with many different activities (button clicks, form submissions, product purchases, signing up, etc.) that you offer and/or are automatically collected, including “page views”. In such cases, the Facebook pixel associated with events/activities activates and reports the activities1. This allows you to understand what actions visitors and/or potential customers (who will become your customers after purchase) take after seeing Facebook ad(s), and also makes it possible to reach these people through a custom audience. Additionally, as the number of users and user-related actions increases, Ads Manager will make ads more accurate. This mechanism that ensures ads reach people who are more likely to take specific actions is called conversion optimization.
Standard Events
Events (can be expressed as activities in Google Analytics) represent actions that occur on your website, such as a visitor filling out a form, signing up, and/or making a purchase. For an event to be tracked, Facebook pixel standard code and at least one standard event (PageView) must be installed.
Whether you install Pixel through Meta Events Manager with the manual snippet, through platform integrations such as Shopify, Ticimax, IdeaSoft, T-Soft, or via GTM, the trigger points and parameter structure of standard events remain the same.
What actions are defined as standard events?
Standard events are basically defined with track and supported by parameters with specific object properties that allow you to add detailed information about the event if needed.
We can say that the usage structures correspond to GTAG enhanced e-commerce activities2. Therefore, dataLayer usage can be considered a common solution for both Google Analytics and Facebook.
fbq("track", "[parameter]");
A small note here. If there are multiple Facebook Meta Pixels on the website, you may see trackCustom, trackSingle, or trackSingleCustom instead of track. This difference only affects the behavior of the relevant pixel; the code structure generally remains the same.
Below you can see the defined events that can be tracked and their usage under headings3.
| Event | Typical use |
|---|---|
| PageView | Page view |
| ViewContent | Product/content detail |
| Search | On-site search |
| AddToCart | Add to cart |
| AddToWishlist | Add to wishlist |
| InitiateCheckout | Checkout start |
| AddPaymentInfo | Payment info entry |
| Purchase | Purchase |
| Lead | Form submission |
| CompleteRegistration | Registration complete |
| Contact | Contact |
| CustomizeProduct | Product customization |
| Donate | Donation |
| FindLocation | Location search |
| Schedule | Appointment booking |
| StartTrial | Trial start |
| SubmitApplication | Application submission |
| Subscribe | Subscription |
AddToCart Usage
Fires when a link and/or button that adds a product to the cart is clicked. Can contain content_ids, content_name, content_type, contents, currency, value values. For Dynamic Ads, content_ids, content_type, and contents are required.
fbq("track", "AddToCart");
Defining content_ids and content_type allows targeted campaigns with specific product matches among many products, and conversions can be analyzed in detail. contents can be applied to include EAN code or product price(s), id, quantity.
[
{
id: "ABC123",
quantity: 2,
item_price: 5.99,
},
{
id: "XYZ789",
quantity: 2,
item_price: 9.99,
},
];
item_price defines the price of the specific single product, not the total price when there are multiple products. In this case:
fbq("track", "AddToCart", {
content_ids: ["1234"],
content_type: "product", // or 'product_group'
});
fbq("track", "AddToCart", {
contents: [
{
id: "ABC123",
quantity: 2,
item_price: 5.99,
},
{
id: "XYZ789",
quantity: 2,
item_price: 9.99,
},
],
});
For more detailed usage with all parameters:
fbq("track", "AddToCart", {
content_type: "product",
content_ids: ["1234"],
content_name: "ABC Leather Sandal",
content_category: "Shoes",
value: 0.5,
currency: "USD",
});
content_type is determined by the type of IDs being passed, not the number of IDs. Use product when passing individual product or variant IDs (e.g., Shopify variant ID), and product_group when passing parent/group IDs (e.g., Shopify product ID). Additionally, if Product Catalog is active and products are added, content_ids values must match the product IDs there (especially for dynamic ads). If working with multiple Pixel IDs, the AddToCart definition:
fbq("trackSingle", "[Facebook-pixel-ID-2]", "AddToCart", {
content_type: "product",
content_ids: ["1234"],
});
To use with Img Pixel:
<noscript
><img
src="https://www.facebook.com/tr?id=[Facebook-pixel-ID]&ev=AddToCart&cd[content_type]=product&cd[content_ids]=1234&noscript=1"
height="1"
width="1"
style="display:none"
/></noscript>
For more detailed usage with all parameters:
<noscript
><img
src="https://www.facebook.com/tr?id=[Facebook-pixel-ID]&ev=AddToCart&cd[content_name]=ABC%20Leather%20Sandal&cd[content_category]=Shoes&cd[content_type]=product&cd[content_ids]=1234&cd[value]=0.50&cd[currency]=USD&noscript=1"
height="1"
width="1"
style="display:none"
/></noscript>
AddToWishlist Usage
This event can be triggered when a link and/or button that adds a product to a wishlist is clicked. Can contain content_name, content_category, content_ids, contents, currency, value values.
fbq("track", "AddToWishlist");
For more detailed usage with all parameters:
fbq("track", "AddToWishlist", {
content_ids: ["1234"],
content_name: "ABC Leather Sandal",
content_category: "Shoes",
value: 0.5,
currency: "USD",
});
content_ids can take single or multiple product IDs. If working with multiple Pixel IDs, the AddToWishlist definition:
fbq("trackSingle", "[Facebook-pixel-ID-2]", "AddToWishlist");
To use with Img Pixel:
<noscript
><img
height="1"
width="1"
style="display:none"
src="https://www.facebook.com/tr?id='[Facebook-pixel-ID]&ev=AddToWishlist&noscript=1"
/></noscript>
AddPaymentInfo Usage
Defines the transaction flow where payment information is added. Can be associated with the click when a potential customer enters invoice and/or payment details and initiates the registration process. Can also be associated with active tab transitions. Can contain content_category, content_ids, contents, currency, value values.
fbq("track", "AddPaymentInfo");
For more detailed usage with all parameters:
fbq("track", "AddPaymentInfo", {
content_ids: ["1234"],
content_name: "ABC Leather Sandal",
content_category: "Shoes",
value: 0.5,
currency: "USD",
});
content_ids can take single or multiple product IDs. If working with multiple Pixel IDs, the AddPaymentInfo definition:
fbq("trackSingle", "[Facebook-pixel-ID-2]", "AddPaymentInfo");
To use with Img Pixel:
<noscript
><img
height="1"
width="1"
style="display:none"
src="https://www.facebook.com/tr?id='[Facebook-pixel-ID]&ev=AddPaymentInfo&noscript=1"
/></noscript>
CompleteRegistration Usage
Defines when a registration form is submitted / transaction is completed. Can be used for newsletter forms, membership registrations, and request forms. Can contain content_name, currency, status, value values. status sends true if registration is completed, false if not.
fbq("track", "CompleteRegistration");
For more detailed usage with all parameters:
fbq("track", "CompleteRegistration", {
content_name: "ABC Leather Sandal",
value: 0.5,
status: 1,
});
If working with multiple Pixel IDs, the CompleteRegistration definition:
fbq("trackSingle", "[Facebook-pixel-ID-2]", "CompleteRegistration");
To use with Img Pixel:
<noscript
><img
height="1"
width="1"
style="display:none"
src="https://www.facebook.com/tr?id='[Facebook-pixel-ID]&ev=CompleteRegistration&noscript=1"
/></noscript>
Contact Usage
Can be associated when a visitor/user/customer clicks a phone number for contact purposes, sends SMS or email, or starts a chat session to ask questions.
fbq("track", "Contact");
If working with multiple Pixel IDs, the Contact definition:
fbq("trackSingle", "[Facebook-pixel-ID-2]", "Contact");
To use with Img Pixel:
<noscript
><img
height="1"
width="1"
style="display:none"
src="https://www.facebook.com/tr?id='[Facebook-pixel-ID]&ev=Contact&noscript=1"
/></noscript>
CustomizeProduct Usage
This event can be triggered when customization operations (color, size, variation, etc.) are made for a product.
fbq("track", "CustomizeProduct");
If working with multiple Pixel IDs, the CustomizeProduct definition:
fbq("trackSingle", "[Facebook-pixel-ID-2]", "CustomizeProduct");
To use with Img Pixel:
<noscript
><img
height="1"
width="1"
style="display:none"
src="https://www.facebook.com/tr?id='[Facebook-pixel-ID]&ev=CustomizeProduct&noscript=1"
/></noscript>
Donate Usage
Can be associated when a visitor makes a donation.
fbq("track", "Donate");
If working with multiple Pixel IDs, the Donate definition:
fbq("trackSingle", "[Facebook-pixel-ID-2]", "Donate");
To use with Img Pixel:
<noscript
><img
height="1"
width="1"
style="display:none"
src="https://www.facebook.com/tr?id='[Facebook-pixel-ID]&ev=Donate&noscript=1"
/></noscript>
FindLocation Usage
Can be associated when a user searches for a company or a physical branch address. Additionally, this event can also be used when searching for a specific product/department or unit (information, checkout, returns, exit, etc.) within a branch or store.
fbq("track", "FindLocation");
If working with multiple Pixel IDs, the FindLocation definition:
fbq("trackSingle", "[Facebook-pixel-ID-2]", "FindLocation");
To use with Img Pixel:
<noscript
><img
height="1"
width="1"
style="display:none"
src="https://www.facebook.com/tr?id='[Facebook-pixel-ID]&ev=FindLocation&noscript=1"
/></noscript>
InitiateCheckout Usage
Can be associated when a potential customer clicks a link or button to start the payment process and proceeds to the purchase flow. Can contain content_category, content_ids, contents, currency, num_items, value values.
fbq("track", "InitiateCheckout");
For more detailed usage with all parameters:
fbq("track", "InitiateCheckout", {
content_ids: ["1234"],
content_category: "snippets",
value: 0.5,
num_ids: 1,
currency: "USD",
});
If working with multiple Pixel IDs, the InitiateCheckout definition:
fbq("trackSingle", "[Facebook-pixel-ID-2]", "InitiateCheckout");
To use with Img Pixel:
<noscript
><img
src="https://www.facebook.com/tr?id=[Facebook-pixel-ID]&ev=InitiateCheckout&noscript=1"
height="1"
width="1"
style="display:none"
/></noscript>
For more detailed usage with all parameters:
<noscript
><img
src="https://www.facebook.com/tr?id=[Facebook-pixel-ID]&ev=InitiateCheckout&cd[content_category]=snippets&cd[num_ids]=1&cd[content_ids]=1234&cd[value]=0.50&cd[currency]=USD&noscript=1"
height="1"
width="1"
style="display:none"
/></noscript>
Lead Usage
Can be associated with a form submission on landing pages. Can contain content_category, content_name, currency, value values.
fbq("track", "Lead");
For more detailed usage with all parameters:
fbq("track", "Lead", {
content_name: "Sign-up", // lp definition
content_category: "B2B",
value: 0.5,
num_ids: 1,
currency: "USD",
});
If working with multiple Pixel IDs, the Lead definition:
fbq("trackSingle", "[Facebook-pixel-ID-2]", "Lead");
To use with Img Pixel:
<noscript
><img
src="https://www.facebook.com/tr?id=[Facebook-pixel-ID]&ev=Lead&noscript=1"
height="1"
width="1"
style="display:none"
/></noscript>
For more detailed usage with all parameters:
<noscript
><img
src="https://www.facebook.com/tr?id=[Facebook-pixel-ID]&ev=Lead&cd[content_category]=B2B&cd[content_name]=Sign-up&cd[content_ids]=1234&cd[value]=0.50&cd[currency]=USD&noscript=1"
height="1"
width="1"
style="display:none"
/></noscript>
PageView Usage
This event is typically triggered by default when visitors view a page. In virtual pages and modal structures like quick product view (virtual pageview), it can also be triggered separately.
fbq("track", "PageView");
If working with multiple Pixel IDs, the PageView definition:
fbq("trackSingle", "[Facebook-pixel-ID-2]", "PageView");
To use with Img Pixel:
<noscript
><img
height="1"
width="1"
style="display:none"
src="https://www.facebook.com/tr?id='[Facebook-pixel-ID]&ev=PageView&noscript=1"
/></noscript>
Purchase Usage
This event can be triggered when payment processes are completed (when the thank you page is displayed). Can contain content_ids, content_name, content_type, contents, currency, num_items, value values.
currency and value values are required. For dynamic ads, content_ids, content_type, contents values should be used.
fbq("track", "Purchase", {
value: 0.5,
currency: "USD",
});
fbq("track", "Purchase", {
content_name: "ABC Leather Sandal",
content_type: "product",
content_ids: "[1234]",
value: 0.5,
num_ids: 1,
currency: "USD",
});
An additional example with contents:
fbq("track", "Purchase", {
content_type: "product",
contents: [
{
id: "1234",
quantity: 2,
item_price: 10.0,
},
{
id: "4642",
quantity: 1,
item_price: 5.0,
},
],
value: 25.0,
currency: "USD",
});
If working with multiple Pixel IDs, the Purchase definition:
fbq("trackSingle", "[Facebook-pixel-ID-2]", "Purchase", {
value: 0.5,
currency: "USD",
});
To use with Img Pixel:
<noscript
><img
src="https://www.facebook.com/tr?id=[Facebook-pixel-ID]&ev=Purchase&cd[value]=0.50&cd[currency]=USD&noscript=1"
height="1"
width="1"
style="display:none"
/></noscript>
For more detailed usage with all parameters:
<noscript
><img
src="https://www.facebook.com/tr?id=[Facebook-pixel-ID]&ev=Purchase&cd[content_name]=ABC%20Leather%20Sandal&cd[content_category]=Shoes&cd[content_type]=product&cd[content_ids]=1234&cd[value]=0.50&cd[currency]=USD&noscript=1"
height="1"
width="1"
style="display:none"
/></noscript>
Schedule Usage
Fires when a person books an appointment to visit one of your physical locations: a clinic appointment, a service booking, a salon reservation, an in-store fitting session. Trigger it at the moment the booking is confirmed. It has no required parameters, and Meta’s reference documentation lists no specific object properties for Schedule3.
fbq("track", "Schedule");
Setups that want to carry the booking’s content and estimated value add content_name, content_category, value, and currency. Since these fields are not officially listed for Schedule, there is no guarantee they feed value-based optimization in ad reporting, though they remain visible in Events Manager.
fbq("track", "Schedule", {
content_name: "dental-checkup",
content_category: "clinic-appointment",
value: 750.0,
currency: "TRY",
});
If working with multiple Pixel IDs:
fbq("trackSingle", "[Facebook-pixel-ID-2]", "Schedule");
To use with Img Pixel:
<noscript
><img
height="1"
width="1"
style="display:none"
src="https://www.facebook.com/tr?id='[Facebook-pixel-ID]&ev=Schedule&noscript=1"
/></noscript>
Search Usage
Can be associated when a visitor searches for a product or content. Can take content_category, content_ids, contents, currency, search_string, value values. search_string takes the search query term.
fbq("track", "Search");
For detailed usage:
fbq("track", "Search", {
content_category: "Sandals",
content_ids: "[1234]",
value: 0.5,
currency: "USD",
search_string: "Man Sandals",
});
If working with multiple Pixel IDs, the Search definition:
fbq("trackSingle", "[Facebook-pixel-ID-2]", "Search");
To use with Img Pixel:
<noscript
><img
src="https://www.facebook.com/tr?id=[Facebook-pixel-ID]&ev=Search&cd[content_category]=Sandals&cd[content_type]=product&cd[content_ids]=1234&cd[value]=0.50&cd[currency]=USD&cd[search_string]=Man%20Sandals&noscript=1"
height="1"
width="1"
style="display:none"
/></noscript>
StartTrial Usage
When a visitor accepts a limited (time, usage) trial offer (product, service, or usage). For example, a 15-day free trial offer. Can take currency, predicted_ltv, value values. predicted_ltv is the advertiser’s predicted lifetime value for a subscriber, expressed as a full value.
fbq("track", "StartTrial");
For detailed usage:
fbq("track", "StartTrial", {
value: 0.5,
currency: "USD",
predicted_ltv: 15,
});
If working with multiple Pixel IDs, the StartTrial definition:
fbq("trackSingle", "[Facebook-pixel-ID-2]", "StartTrial");
To use with Img Pixel:
<noscript
><img
src="https://www.facebook.com/tr?id=[Facebook-pixel-ID]&ev=StartTrial&noscript=1"
height="1"
width="1"
style="display:none"
/></noscript>
For detailed usage:
<noscript
><img
src="https://www.facebook.com/tr?id=[Facebook-pixel-ID]&ev=StartTrial&cd[predicted_ltv]=15&cd[value]=0.50&cd[currency]=USD&noscript=1"
height="1"
width="1"
style="display:none"
/></noscript>
SubmitApplication Usage
This event can be used when a visitor applies for a product, service, or program offer. For example, job applications, courses, credit card acquisitions, etc.
fbq("track", "SubmitApplication");
If working with multiple Pixel IDs, the SubmitApplication definition:
fbq("trackSingle", "[Facebook-pixel-ID-2]", "SubmitApplication");
To use with Img Pixel:
<noscript
><img
height="1"
width="1"
style="display:none"
src="https://www.facebook.com/tr?id='[Facebook-pixel-ID]&ev=SubmitApplication&noscript=1"
/></noscript>
Subscribe Usage
Can be associated when a visitor starts a paid membership for product or service usage. Can take currency, predicted_ltv, value values.
fbq("track", "Subscribe");
Detailed usage:
fbq("track", "Subscribe", {
value: 0.5,
currency: "USD",
predicted_ltv: 15,
});
If working with multiple Pixel IDs, the Subscribe definition:
fbq("trackSingle", "[Facebook-pixel-ID-2]", "Subscribe");
To use with Img Pixel:
<noscript
><img
src="https://www.facebook.com/tr?id=[Facebook-pixel-ID]&ev=Subscribe&noscript=1"
height="1"
width="1"
style="display:none"
/></noscript>
For detailed usage:
<noscript
><img
src="https://www.facebook.com/tr?id=[Facebook-pixel-ID]&ev=Subscribe&cd[predicted_ltv]=15&cd[value]=0.50&cd[currency]=USD&noscript=1"
height="1"
width="1"
style="display:none"
/></noscript>
ViewContent Usage
Can be associated when a tracked page (product, content, etc.) is viewed. For example, cart, campaign detail page, special offer, product detail page, and similar. Can take content_ids, content_name, content_type, contents, currency, value values. For dynamic ads, content_ids, content_type, and contents values must be defined.
fbq("track", "ViewContent");
Detailed usage:
fbq("track", "ViewContent", {
content_type: "product",
content_ids: ["1234"],
content_name: "ABC Leather Sandal",
content_category: "Shoes",
value: 0.5,
currency: "USD",
});
If working with multiple Pixel IDs, the ViewContent definition:
fbq("trackSingle", "[Facebook-pixel-ID-2]", "ViewContent");
To use with Img Pixel:
<noscript
><img
src="https://www.facebook.com/tr?id=[Facebook-pixel-ID]&ev=ViewContent&noscript=1"
height="1"
width="1"
style="display:none"
/></noscript>
For more detailed usage with all parameters:
<noscript
><img
src="https://www.facebook.com/tr?id=[Facebook-pixel-ID]&ev=ViewContent&cd[content_name]=ABC%20Leather%20Sandal&cd[content_category]=Shoes&cd[content_type]=product&cd[content_ids]=1234&cd[value]=0.50&cd[currency]=USD&noscript=1"
height="1"
width="1"
style="display:none"
/></noscript>
content_type: product vs product_group
The content_type parameter is critical for Advantage+ catalog ads and dynamic retargeting. It determines which level in the Meta catalog the passed IDs should match against.
Meta Catalog Structure
The Meta product catalog has two levels:
- Content ID: Individual product or variant identifier (the
idfield in the catalog) - Item Group ID: Product group identifier that groups different variants (size, color, etc.) of the same product together
In e-commerce platforms (Shopify, WooCommerce, etc.), this structure typically maps as follows:
| Platform Concept | Meta Catalog Equivalent | content_type |
|---|---|---|
| Variant ID (each size/color separate) | Content ID | product |
| Product ID (parent, covers all variants) | Item Group ID | product_group |
Usage Across the E-commerce Funnel
Using different content_type values on different page types is both valid and recommended. The Meta catalog can match at both levels:
// Category / listing page: no variant selected yet, parent ID available
fbq("track", "ViewContent", {
content_type: "product_group",
content_ids: ["7890", "7891", "7892"],
content_category: "Shoes",
});
// Product detail page: specific variant selected
fbq("track", "ViewContent", {
content_type: "product",
content_ids: ["4001"],
content_name: "Blue T-Shirt - Size M",
value: 29.99,
currency: "USD",
});
// Add to cart: selected variant
fbq("track", "AddToCart", {
content_type: "product",
content_ids: ["4001"],
value: 29.99,
currency: "USD",
});
// Purchase: variants in the cart
fbq("track", "Purchase", {
content_type: "product",
contents: [
{ id: "4001", quantity: 1, item_price: 29.99 },
{ id: "5023", quantity: 2, item_price: 49.99 },
],
value: 129.97,
currency: "USD",
});
Common Mistakes
Sending variant IDs with product_group: If content_ids contains variant IDs but you use content_type: 'product_group', Meta will try to look up those IDs as Item Group IDs and find no match in the catalog. Dynamic ads won’t work, and conversion data will be incomplete.
ID format mismatch with catalog: Shopify sends parent product IDs to the pixel by default, but your catalog may contain variant IDs (or vice versa). You need to verify that the IDs sent from the pixel match their counterparts in the catalog exactly. Facebook Pixel Helper can assist with this verification.
Additional Usage and Definitions
The events and parameters mentioned above can be custom defined based on needs. For example, all steps in a payment process can be marked as Step1, Step2, Step3. In this case, the trackCustom content would be:
fbq("trackCustom", "Step4");
Additional parameters can also be defined for those steps.
fbq("trackCustom", "Step4", {
// optional parameters
});
The same operation can be scoped to a specific pixel ID with trackSingleCustom.
fbq("trackSingleCustom", "[Facebook-pixel-ID-2]", "Step4", {
// optional parameters
});
To define a discount coupon (ShareDiscount), mark the users who use it, and carry additional parameters (promotion):
fbq("trackCustom", "ShareDiscount", {
promotion: "share_discount_20%",
});
The same operation can be scoped to a specific pixel ID with trackSingleCustom.
fbq("trackSingleCustom", "[Facebook-pixel-ID-2]", "ShareDiscount", {
promotion: "share_discount_20%",
});
On the other hand, custom properties can also be added to an existing standard event. For example, adding compared product property, campaign name, and promotion code to the Purchase standard event:
fbq("track", "Purchase", {
value: 115.0,
currency: "USD",
contents: [
{
id: "301",
quantity: 1,
item_price: 85.0,
},
{
id: "401",
quantity: 2,
item_price: 15.0,
},
],
content_type: "product",
compared_product: "recommended-banner-shoes",
campaign_name: "discount-banner",
promotion: "share_discount_20%",
});
A typo that may occur when using a standard event (such as writing Purchased instead of Purchase) can cause the operation to fail and return an error. To catch such issues early, verify multi-pixel setups, and work with Test Events, see the validation section of the Advanced Matching and Special Cases post.
Event Tracking
Operations can be performed through Track Event on Page Load or Track Event When Action is Taken on Page options. What are the differences between these tracking definitions?
Track Event on Page Load
: This option can be considered when an important action is performed (completion of a purchase transaction, membership, etc.) and there is a redirect to a confirmation or thank you page. In this case, the relevant code for page load events should be placed within the <head>…</head> tags.
Track Event When Action is Taken on Page : This option can be considered when the activities to be tracked consist of visitors adding products to cart, form confirmation clicks, phone clicks, purchase button clicks, or clicking an important page link. In this case, the event code will be defined through the element (button, link, etc.) associated with the event to be tracked. Since this operation can be used throughout the session after page load, the code can be kept in an external file or along with other JavaScript code.
In addition to these, assigning values to events (Conversion Value as 1 or Currency) is another recommended practice for more detailed analysis.
Advanced Matching Parameters
Advanced Matching lets you send hashed user data with Pixel events: em, ph, fn, ln, db, ge, ct, st, zp, country, and external_id. It directly affects Event Match Quality (EMQ) and, together with Conversions API, is the strongest lever for attribution recovery after iOS 14.5 and Safari ITP4.
On the Pixel side, the parameters go into the init call:
fbq("init", "PIXEL_ID", {
em: "jane.doe@example.com", // lowercase, library hashes it
ph: "905321234567", // digits only, library hashes it
fn: "jane",
ln: "doe",
ct: "istanbul",
country: "tr",
external_id: "user_4812",
});
The Pixel JavaScript library normalizes and SHA-256 hashes these fields before transmission, so you send them as plain text on the client side. CAPI works differently: every PII field sent from your server must be pre-hashed. Copying the Pixel object straight into a backend payload is a common mistake.
Per-parameter normalization rules (leading zeros in phone numbers, spaces in city names, postal code formats), fbc and fbp cookie behavior, how to read the EMQ score, and multiple pixel scenarios belong to the dedicated post: Facebook Pixel Advanced Matching and Special Cases.
Using with Conversions API
Browser-side tracking has become less reliable due to ad blockers, ITP (Intelligent Tracking Prevention), and third-party cookie restrictions. Conversions API (CAPI) reduces that loss with server-side event transmission, and when it runs alongside the Pixel, data is collected from both the browser and the server.
When both channels are active, the eventID parameter is required so the same event is not counted twice:
fbq(
"track",
"Purchase",
{
value: 115.0,
currency: "USD",
content_type: "product",
content_ids: ["ABC123"],
},
{
eventID: "order-12345-abc", // Unique event identifier
},
);
An event sent from the server with the same eventID collapses into a single conversion on Meta’s side5. The deduplication window, event_id generation rules, and how to diagnose events that fail to match are covered in the Advanced Matching and Special Cases post.
GDPR Compliance and Consent Management
Under GDPR, explicit consent must be obtained from users for cookie usage. Meta Pixel supports this with the consent API.
// Stop data transmission by default when page loads
fbq("consent", "revoke");
fbq("init", "PIXEL-ID");
fbq("track", "PageView");
// After user accepts cookie policy
fbq("consent", "grant");
The revoke call must be made before the init function, otherwise events start firing before consent is given. Why Meta’s consent mechanism is not the same as Google Consent Mode v2, how consent state travels to CAPI, and why LDU does not satisfy GDPR are covered in the consent section of the Advanced Matching and Special Cases post.
Single Page Application (SPA) Integration
In single page applications (SPA) developed with modern JavaScript frameworks like React, Vue, Angular, standard pixel setup may not be sufficient because URLs change without page refresh. Meta Pixel automatically detects History API changes and triggers PageView events, but manual triggering is required for other events.
// On route change in React Router or similar structure
const trackRouteChange = (pathname) => {
switch (pathname) {
case "/product":
fbq("track", "ViewContent", { content_type: "product" });
break;
case "/cart":
fbq("track", "AddToCart");
break;
case "/checkout":
fbq("track", "InitiateCheckout");
break;
}
};
// Inside useEffect or componentDidUpdate
useEffect(() => {
trackRouteChange(location.pathname);
}, [location.pathname]);
To disable automatic PageView triggering, disablePushState: true can be used but this is generally not recommended.
Limited Data Use (LDU) - US Privacy Regulations
For state-based privacy regulations in the United States (California CCPA, Colorado, Connecticut), Meta offers the Limited Data Use feature. When this feature is enabled, Meta processes data only in a service provider role.
// LDU off (default behavior)
fbq("dataProcessingOptions", []);
// LDU on - Let Meta determine geographic location
fbq("dataProcessingOptions", ["LDU"], 0, 0);
// LDU on - Manual specification for California
fbq("dataProcessingOptions", ["LDU"], 1, 1000);
fbq("init", "PIXEL-ID");
fbq("track", "PageView");
The dataProcessingOptions call must be made before the init function. When LDU is enabled, campaign performance and retargeting capabilities may be restricted.
Note: As of June 2023, LDU applies to California, Colorado, and Connecticut states. This setting does not directly apply to users in Türkiye but should be considered in campaigns with global targeting.
Footnotes
- 01 Meta Pixel supports 17 standard events, currency and value are required for Purchase
- 02 contents or content_ids parameter is required for Advantage+ catalog ads
- 03 trackSingle/trackSingleCustom should be used for multiple pixel management
- 04 eventID deduplication is mandatory when used with Conversions API
- 05 consent API (revoke/grant) must be used for GDPR compliance
- 06 Manual event triggering is required on route changes in SPA applications
+ What is Meta Pixel and what does it do?
Meta Pixel is a JavaScript code added to your website. It tracks visitor actions like page views, add to cart, and purchases. This data is used for Facebook/Instagram ad optimization, custom audience creation, and conversion measurement.
+ What are Meta Pixel standard events?
There are 17 standard events: AddPaymentInfo, AddToCart, AddToWishlist, CompleteRegistration, Contact, CustomizeProduct, Donate, FindLocation, InitiateCheckout, Lead, Purchase, Schedule, Search, StartTrial, SubmitApplication, Subscribe, ViewContent. PageView comes on top of these, as part of the Pixel base code.
+ Which parameters are required for the Purchase event?
Currency and value parameters are required for the Purchase event. If you're using Advantage+ catalog ads, contents or content_ids parameter is also required.
+ How do you manage multiple Meta Pixels?
Use trackSingle and trackSingleCustom functions. While the standard track function sends events to all initialized pixels, trackSingle allows you to send events to a specific pixel ID.
+ Why is Conversions API necessary?
Browser-side tracking loses a share of events to ad blockers, ITP, and third-party cookie restrictions, and the loss rate varies by site and audience. Conversions API reduces that loss with server-side transmission. When used with Pixel, deduplication must be done with the eventID parameter.
+ How to configure Meta Pixel for GDPR?
Stop data transmission with fbq('consent', 'revoke'), then start it with fbq('consent', 'grant') after user consent. The revoke call must be made before the init function.