This commit is contained in:
ray zhou
2026-06-29 14:51:55 +08:00
parent 225fb2bd28
commit 2dd9f17da9
319 changed files with 29461 additions and 9412 deletions

View File

@@ -0,0 +1,360 @@
How to Set Up Meta Conversions API: The Complete 2026 Guide
If you are running Meta ads in 2026, relying on the Meta Pixel alone is no longer enough. Browser-based tracking has been degraded by iOS privacy restrictions, ad blockers, and consent banners to the point where pixel-only setups miss over half of actual conversions. The Meta Conversions API (also called Meta CAPI) is the server-side tracking solution that closes that gap by sending conversion data directly from your server to Meta's servers, bypassing browser limitations entirely.
This guide covers everything you need to know about the Meta Conversions API: what it is, how it compares to the Meta Pixel, the three main setup methods, the critical parameters that determine your data quality, how to configure event deduplication, how to connect your CRM, and how to optimize your Event Match Quality score for maximum ad performance.
Whether you are setting up Meta CAPI for the first time or migrating from the now-discontinued Offline Conversions API, this is the only guide you need.
## What Is Meta Conversions API?
The Meta Conversions API is a server-to-server tracking interface that allows you to send web events, offline events, and CRM events directly from your server to Meta's advertising platform. Unlike the Meta Pixel, which runs in the user's browser and depends on JavaScript execution, cookies, and uninterrupted page loads, the Conversions API operates independently of the browser environment.
When a user takes an action on your website, such as completing a purchase, submitting a lead form, or adding an item to their cart, the Conversions API sends that event data from your backend infrastructure to Meta. This means that even when a browser blocks the Pixel, fails to load JavaScript, or restricts cookies, Meta still receives your conversion data. With the rollout of Meta's Adaptive Ranking Model, the quality of this signal data is more important than ever for ad ranking and delivery.
Meta designed the Conversions API as the long-term replacement for browser-dependent tracking. It now handles both online and offline conversion events through a single unified integration, which became especially important after Meta discontinued its separate Offline Conversions API in May 2025.
## Meta Conversions API vs. Meta Pixel: What Is the Difference?
Understanding the difference between the Conversions API and the Meta Pixel is essential before deciding how to implement your tracking.
The Meta Pixel is a snippet of JavaScript code that loads in the user's browser. When a user visits your website or completes a conversion event, the Pixel fires and sends that data to Meta through the browser. This approach worked reliably for years, but privacy changes have steadily eroded its effectiveness. iOS 14.5's App Tracking Transparency framework, browser-based ad blockers, intelligent tracking prevention in Safari, and cookie consent banners all interfere with the Pixel's ability to fire and report accurately.
The Meta Conversions API sends the same event data, but from your server rather than the user's browser. Because server-to-server communication is not affected by ad blockers, cookie restrictions, or browser privacy features, CAPI captures conversions that the Pixel misses entirely. Stores running only pixel tracking typically see attribution accuracy drop to around 40% or lower, meaning more than half of their actual conversions go unreported.
The key differences:
Data transmission path. The Pixel sends data from the browser to Meta. The Conversions API sends data from your server to Meta.
Reliability. The Pixel depends on JavaScript execution, cookie availability, and uninterrupted page loads. CAPI depends on your server being operational, which is far more reliable and within your control.
Data richness. The Pixel can only capture what happens in the browser. CAPI can send data from any source your server has access to, including CRM records, point-of-sale systems, call tracking platforms, and offline events.
Privacy resilience. The Pixel is directly affected by iOS ATT, ad blockers, and consent frameworks. CAPI operates server-side and is not impacted by these browser-level restrictions.
Should you use both? Yes. Meta explicitly recommends running the Meta Pixel and CAPI together in what is called dual tracking. The Pixel captures browser-side signals like scroll behavior, page views, and real-time user interactions. CAPI ensures conversion events are captured reliably regardless of browser conditions. Together, they provide the most complete data picture. When you run both, you need event deduplication (covered below) to prevent double-counting.
## The Three Ways to Set Up Meta Conversions API
There are three primary methods for implementing Meta CAPI, each with different levels of complexity, cost, and flexibility. The right choice depends on your technical resources, platform, and whether you advertise exclusively on Meta or across multiple platforms.
### Method 1: Meta Conversions API Gateway (Simplest Setup)
The Meta Conversions API Gateway is a managed, no-code solution that Meta provides for advertisers who want server-side tracking without custom development. It works alongside your existing Meta Pixel to automatically send server-side copies of Pixel events to Meta.
How it works. The CAPI Gateway monitors your Meta Pixel events. Whenever the Gateway detects a Pixel event firing in the browser, it simultaneously sends a server-side copy of that same event to Meta. Event deduplication is handled automatically, meaning you do not need to configure event_id matching manually.
Setup time. 2 to 4 hours.
Cost. Gateway hosting services run $10 to $400+ per month depending on your event volume and hosting provider. Stape, one of the most popular Gateway hosts, offers plans starting at $10 per pixel per month.
Best for. Advertisers who need a low-maintenance, automated setup with minimal technical work. Stores on Shopify or WooCommerce that want server-side tracking without developer involvement. Meta-only advertisers who do not need to send events to Google, TikTok, or other platforms through the same infrastructure.
Limitations. The Gateway mirrors what the Pixel sees. If a user's browser blocks the Pixel from firing in the first place, the Gateway has nothing to mirror, meaning it cannot capture conversions the Pixel misses entirely. It also only works with Meta and does not serve as a centralized tracking hub for other ad platforms. Customization options are limited compared to manual implementation or server-side GTM.
### Method 2: Server-Side Google Tag Manager (Best Balance of Flexibility and Control)
Server-side Google Tag Manager (sGTM) runs in a cloud environment rather than in the user's browser. It receives events from your client-side GTM container (or directly from your website) and forwards them to Meta's Conversions API endpoint, as well as to any other ad platform you use.
How it works. Your website sends events to a GA4 web tag, which forwards them to your server-side GTM container hosted in a cloud environment (typically Google Cloud Platform, AWS, or a managed provider like Stape). The server-side container then processes these events and sends them to Meta via the Conversions API, to Google via their server-side tags, and to any other platform you configure.
Setup time. 4 to 8 hours.
Cost. $10 to $50 per month for server hosting, depending on traffic volume.
Best for. Advertisers running campaigns across multiple platforms (Meta, Google, TikTok, Pinterest) who want a single centralized tracking infrastructure. Businesses that need more control over what data is sent, how it is processed, and which platforms receive it. Organizations with moderate technical resources or access to a developer or analytics specialist.
Key advantage over Gateway. sGTM is not Meta-specific. It serves as a universal server-side tracking hub, meaning you set up server-side infrastructure once and use it for every ad platform. For businesses investing in multi-platform advertising, this makes sGTM the more strategic long-term choice.
Key caveat. GA4 events often originate in the browser. If the client-side GA4 tag never fires (due to ad blockers or consent rejection), the server-side container never receives the event either. sGTM improves tracking reliability significantly but does not achieve 100% capture in all scenarios.
### Method 3: Manual / Direct API Implementation (Most Customizable)
Manual implementation means your development team writes server-side code that captures conversion events and sends them directly to Meta's Conversions API endpoint via HTTP POST requests. There is no intermediary platform between your server and Meta.
How it works. Your backend application detects a conversion event (a purchase completing, a lead form submission, an appointment booking) and constructs a POST request containing the event name, event time, user data parameters, and custom data. This request is sent to the Meta Events API endpoint using your access token for authentication.
Setup time. 20 to 40 hours of developer time.
Cost. $500 to $5,000+ one-time development cost. No ongoing hosting fees beyond your existing server infrastructure.
Best for. Businesses with custom-built platforms, complex funnels, or non-standard conversion events that cannot be captured by standard Pixel events. Organizations that need to send offline events (in-store purchases, phone conversions, post-sale upsells) that never touch a website. Companies with in-house development teams that want complete control over the data pipeline.
Key advantage. Total flexibility. You control exactly what data is sent, when it is sent, and how it is structured. This is the only method that can reliably capture events that never touch a browser at all, such as CRM lifecycle changes and offline conversions.
### Setup Method Comparison
| Feature | CAPI Gateway | Server-Side GTM | Manual / Direct API |
| --- | --- | --- | --- |
| Setup Time | 2-4 hours | 4-8 hours | 20-40 hours |
| Technical Skill Required | Low (no-code) | Medium | High (developer) |
| Monthly Cost | $10-$400+ | $10-$50 | $0 (self-hosted) |
| Customization | Limited | High | Full |
| Multi-Platform Support | Meta only | All platforms | Meta only (per build) |
| Event Deduplication | Automatic | Manual config | Manual config |
| Offline Event Support | No | Yes (with custom setup) | Yes |
| Best For | Quick Meta-only setup | Multi-platform advertisers | Custom platforms and offline events |
## Critical Meta Conversions API Parameters You Need to Know
The quality of your Conversions API implementation depends entirely on the parameters you send with each event. Sending incomplete or improperly formatted data degrades your Event Match Quality, which directly reduces how effectively Meta can optimize your campaigns.
### Required Parameters
event_name. The name of the conversion event (Purchase, AddToCart, Lead, CompleteRegistration, ViewContent, InitiateCheckout, etc.). This must match Meta's standard event naming conventions.
event_time. A Unix timestamp representing when the event occurred. Send this as close to real-time as possible. Meta accepts events up to 7 days old, but delays beyond one hour reduce optimization effectiveness.
action_source. Tells Meta where the event originated. For website events, use "website." For CRM or offline events, use "system_generated" or "physical_store."
### User Data Parameters
These parameters live inside the user_data object and determine how well Meta can match each event to a Facebook user profile.
em (email). Hashed with SHA256 before sending. This is the single highest-impact parameter for Event Match Quality, typically improving your score by up to 4 points.
ph (phone). Formatted in E.164 international format, then hashed with SHA256. Adds approximately 3 points to your EMQ score.
fn and ln (first name and last name). Lowercased and hashed with SHA256.
external_id. Your internal user or customer ID, hashed with SHA256. Helps Meta maintain consistent identity matching across sessions.
### The fbp and fbc Parameters
These two parameters are critical for matching server events to browser sessions, and they have specific formatting requirements that many implementations get wrong.
fbp (browser ID). This value comes from the _fbp first-party cookie that the Meta Pixel sets in the user's browser. It identifies the browser session. Format: fb.1.[creation_timestamp].[random_number]. Example: fb.1.1596403881668.1116446470.
fbc (click ID). This value comes from the fbclid URL parameter that Meta appends when a user clicks your ad. Format: fb.1.[creation_timestamp].[fbclid_value]. Example: fb.1.1596403881668.AbCdEfGhIjKlMnOpQrStUvWxYz.
Critical rules for fbp and fbc. These values must NOT be hashed. Hashing them will break matching entirely. Only set fbc when a real fbclid exists in the URL. Never fabricate an fbc value, as this degrades data integrity. To send these values server-side, capture them from the browser (via hidden form fields, cookie reading on your server, or client-side JavaScript that passes them to your backend) and include them in the user_data object of your CAPI request.
### Custom Data Parameters
currency. Three-letter ISO currency code (USD, EUR, GBP).
value. The monetary value of the conversion event.
content_ids. Product IDs for catalog-based events like Purchase and AddToCart.
content_type. Either "product" or "product_group" for catalog events.
## How to Set Up Event Deduplication
If you are running the Meta Pixel and Conversions API together (which Meta recommends), you must configure event deduplication to prevent the same conversion from being counted twice.
### How Deduplication Works
When Meta receives an event from the Pixel and a matching event from the Conversions API within a 48-hour window, it uses two fields to determine if they represent the same user action: event_name and event_id. If both fields match between the browser event and the server event, Meta recognizes them as duplicates and counts the conversion only once.
Important: Deduplication does not rely on user identifiers like email, phone, fbp, or fbc. Those parameters help with user matching (connecting the event to a Facebook profile), not event deduplication. Deduplication only checks event_name and event_id.
### How to Generate and Pass event_id
The event_id must be a unique string that you generate once per user action and then pass to both the Pixel and the Conversions API.
Step 1. When a conversion event occurs, generate a unique identifier. Use a UUID v4, ULID, or any other method that produces a reliably unique string.
Step 2. Pass this identifier to the Meta Pixel as the eventID parameter in your fbq('track') call.
Step 3. Pass the same identifier to the Conversions API as the event_id parameter in your server-side POST request.
Step 4. Ensure both values are identical strings. Any mismatch, even a difference in casing or whitespace, will cause deduplication to fail and the event will be double-counted.
### Event Order Matters
Meta deduplicates only when the browser event arrives first and the server event arrives second. If the server event arrives before the browser event, Meta may count both. In practice, this rarely causes issues because the Pixel fires instantaneously in the browser while server-side processing introduces a slight natural delay. However, if your server-side implementation sends events with significant latency (more than a few seconds), test your deduplication carefully.
### Testing Deduplication
After implementation, verify deduplication is working by checking your Events Manager. Compare the total event count from "Browser" events and "Server" events individually against the deduplicated total. If the combined total roughly equals the individual totals (rather than doubling them), deduplication is functioning correctly. If your total event count appears doubled, review your event_id implementation. The most common failure points are mismatched strings, missing event_id on one side, or inconsistent event naming.
## How to Connect Your CRM with Meta Conversions API
One of the most powerful applications of the Conversions API is sending CRM lifecycle events to Meta. This allows Meta to optimize campaigns based on what happens after the initial conversion, such as when a lead becomes a qualified opportunity, books a demo, or closes as a customer.
Without CRM integration, Meta only sees the initial form fill or signup. It has no visibility into which leads actually converted into revenue, which means it cannot distinguish between high-quality and low-quality leads when optimizing your campaigns.
### Why CRM Integration Matters
When you send CRM events through CAPI, Meta can optimize for deeper funnel outcomes. Instead of optimizing for "lead" events (which may include a high percentage of unqualified submissions), you can optimize for "qualified lead," "demo booked," or even "closed-won" events. This fundamentally changes the quality of traffic Meta sends you.
### HubSpot Native Integration
HubSpot offers a built-in Conversions API integration. After connecting your Facebook Ads account in HubSpot's settings, you can create conversion events that sync CRM lifecycle stage changes and form submissions directly to Meta through CAPI.
Requirements: You must have a Meta Pixel installed in your HubSpot account. Only form submissions and lifecycle stage changes that occur after creating the conversion event will be synced. Only HubSpot-created forms are supported; submissions from external forms embedded in HubSpot cannot be synced through the native integration.
### Salesforce and Other CRMs
For Salesforce, Pipedrive, Zoho, and other CRMs that do not offer native Meta CAPI integrations, you have several options.
Third-party connectors. Platforms like Datahash, Stape, and LeadsBridge provide pre-built integrations that connect your CRM to Meta CAPI without custom development. Datahash supports Salesforce, HubSpot, Zoho, LeadSquared, Bitrix24, Freshsales, Microsoft Dynamics, and more.
Webhook-based setup. Most modern CRMs support webhooks in their automation tools. You can configure a webhook that fires whenever a deal changes stage or a contact reaches a specific lifecycle milestone, sending the relevant data to your Conversions API endpoint.
Server-side GTM. If you have already implemented sGTM, you can route CRM events through the same server-side container that handles your website events, keeping all your tracking infrastructure centralized.
### Critical CRM Integration Detail: Preserving Click IDs
When a user clicks your Meta ad and lands on your website, the URL contains an fbclid parameter. To enable Meta to connect a CRM conversion (which may happen days or weeks later) back to the original ad click, you must capture and store the fbclid value with the contact record in your CRM at the time of initial form submission. When you later send the CRM event through CAPI, include this stored fbc value in the user_data object. Without this, Meta cannot attribute the downstream conversion to the original ad click.
## What Happened to Meta's Offline Conversions API
If you previously used Meta's Offline Conversions API to track in-store purchases, phone conversions, or other offline events, you need to know that Meta permanently discontinued it in May 2025.
Version 16.0 of the Graph API was the last to support the Offline Conversions API. With Graph API v17.0 and all subsequent versions, the old system with separate Offline Datasets and manual CSV uploads is completely gone.
What this means for your setup. All offline conversion tracking now flows through the standard Conversions API. There is no longer a separate API, endpoint, or dataset type for offline events. When sending offline events through CAPI, set the action_source parameter to "physical_store" (for in-store events) or "system_generated" (for CRM or backend events) to distinguish them from website events.
Migration note. Some advertisers reported significant issues during the migration from the Offline Conversions API to CAPI, including drops of up to 70% in accepted events. If you migrated and noticed a decline in event acceptance, review your parameter formatting, ensure you are not hashing fbp and fbc values, and verify that your event_time values fall within Meta's 7-day acceptance window.
If you were using third-party tools like Zapier or Twilio Segment with the old Offline Conversions API, those integrations stopped functioning in May 2025. Both platforms now offer updated connectors for the standard Conversions API. In Zapier, make sure to select "Physical Store" as the Action Source when configuring offline conversion events.
## How to Improve Your Event Match Quality Score
Event Match Quality (EMQ) is a score from 0 to 10 that Meta assigns to each of your conversion events. It measures how effectively Meta can match your server-side events to Facebook user profiles. Higher EMQ means better attribution, smarter audience optimization, and stronger campaign performance.
### What EMQ Scores to Target
Purchase events: 8.8 to 9.3 is the ideal range. These events typically carry the most user data (email, phone, address) because the user has completed a transaction.
AddToCart events: Target 8.0 or above.
PageView events: 6.5 to 7.5 is normal. Users have not yet provided personal data at this stage, so matching is inherently more limited.
General benchmark: Meta's internal benchmark sits around 6 out of 10. Scores above 8 are excellent. Do not chase a perfect 10 at the expense of campaign performance. An 8.5 EMQ with strong conversion volume outperforms a 9.5 EMQ with poor campaign performance.
### The Highest-Impact Improvements
Send hashed email with every event. This is the single biggest lever. Adding the em parameter typically improves EMQ by up to 4 points. Hash all email addresses with SHA256 before sending. Lowercase the email first, remove leading and trailing whitespace, then hash.
Send hashed phone number. Format in E.164 international format (example: +14155551234), then hash with SHA256. This typically adds 3 points to your EMQ score.
Include fbp and fbc. These browser and click identifiers connect server events to browser sessions. Remember: do not hash these values.
Send multiple identifiers together. Meta's matching confidence increases dramatically when you send email + phone + external_id + fbp + fbc together rather than any single identifier alone. When your events contain only one or two identifiers, Meta has limited ways to confirm user identity.
Enable Advanced Matching. Turn on Advanced Matching in your Events Manager settings. This allows the Pixel to automatically capture additional user data from form fields on your website, which supplements the data you send through CAPI.
### Monitoring EMQ
Check your EMQ scores in Events Manager at least weekly. Scores update every 48 hours, but stable improvements take 1 to 2 weeks to reflect. Performance impact (lower CPA, higher ROAS) typically shows within 2 to 4 weeks as Meta's algorithm adapts to improved signal quality.
Navigate to Events Manager, select your Pixel, click on any event (like Purchase), and look for the Event Match Quality score. If any event scores below 6.0, prioritize adding the missing user data parameters outlined above.
## Step-by-Step: Setting Up Meta Conversions API with Server-Side GTM
For most advertisers running multi-platform campaigns, server-side GTM offers the best balance of control, flexibility, and cost. Here is the implementation walkthrough.
### Prerequisites
You need a Meta Business Manager account with admin access, a Meta Pixel already installed on your website, a Google Tag Manager account with a web container, and a server-side GTM container hosted in a cloud environment (Google Cloud Platform, AWS, or a managed provider like Stape or Taggstar).
Step 1: Generate a Meta Access Token. In Meta Events Manager, navigate to your Pixel settings. Under the Conversions API section, generate a new access token. Save this token securely. You will need it when configuring the Meta tag in your server-side GTM container.
Step 2: Configure your client-side GTM to send events to the server container. Set up GA4 event tags in your web GTM container that fire on your key conversion events (Purchase, AddToCart, Lead, etc.). Configure these tags to send data to your server-side GTM endpoint rather than (or in addition to) directly to GA4.
Step 3: Create the Meta Conversions API tag in server-side GTM. In your server-side GTM container, add the Meta Conversions API tag template. Configure it with your Pixel ID and the access token generated in Step 1. Map incoming GA4 event parameters to Meta's expected parameters (event_name, user_data fields, custom_data fields).
Step 4: Configure user data mapping. Map email, phone, first name, last name, and any other available user data parameters from your GA4 events to the corresponding Meta CAPI parameters. Ensure hashing is applied correctly (SHA256 for email, phone, name fields; no hashing for fbp and fbc).
Step 5: Set up event_id for deduplication. Generate a unique event_id on the client side (in your website JavaScript) for each conversion event. Pass this ID to both your client-side Meta Pixel fbq('track') call and to your GA4 event tag. The server-side container will forward this same event_id to Meta's CAPI, enabling deduplication.
Step 6: Test in Meta Events Manager. Go to Events Manager and open the Test Events tab. Perform conversion actions on your website and verify that events appear with both "Browser" and "Server" sources. Confirm that the deduplicated event count does not double your expected total.
Step 7: Monitor Event Match Quality. After events have been flowing for 48 hours, check your EMQ scores for each event type. If scores are below your targets, review which user data parameters are missing and add them.
## Common CAPI Setup Mistakes to Avoid
Hashing fbp and fbc. These browser and click identifier parameters must be sent in plain text. Hashing them breaks Meta's ability to match server events to browser sessions.
Fabricating fbc values. Only send an fbc parameter when a real fbclid exists in the URL from an actual ad click. Sending fabricated click IDs degrades your data integrity and can harm campaign optimization.
Delayed event sending. Send events as close to real-time as possible, ideally within minutes of the conversion. Events sent hours or days later provide less optimization value to Meta's algorithm.
Mismatched event_id values. If the event_id in your Pixel call does not exactly match the event_id in your CAPI request (including casing and whitespace), deduplication fails and events are double-counted.
Forgetting to capture fbclid for CRM events. If you plan to send downstream CRM events (like "demo booked" or "closed won") through CAPI, you must capture the fbclid from the landing page URL at the time of initial conversion and store it with the contact record. Without this, Meta cannot attribute the CRM event back to the original ad click.
Using the wrong action_source. Website events should use "website." CRM events should use "system_generated." Offline or in-store events should use "physical_store." Using the wrong value can cause events to be misclassified or rejected.
## Frequently Asked Questions
### What is Meta CAPI?
Meta CAPI (Conversions API) is a server-to-server tracking interface that sends conversion event data directly from your server to Meta's advertising platform. It works alongside the Meta Pixel to improve tracking accuracy, bypass browser-based privacy restrictions, and provide Meta with more complete conversion data for campaign optimization. In 2026, Meta recommends every advertiser running paid campaigns implement CAPI in addition to the Pixel.
### Do I still need the Meta Pixel if I have CAPI?
Yes. Meta recommends running both together. The Pixel captures real-time browser events and user behavior signals. CAPI ensures reliable conversion tracking even when browser limitations prevent the Pixel from firing. Together, they provide the most complete data. When running both, configure event deduplication using matching event_id values to prevent double-counting.
### How much does Meta Conversions API cost to set up?
The cost depends on your implementation method. CAPI Gateway hosting runs $10 to $400+ per month. Server-side GTM hosting costs $10 to $50 per month. Manual/direct API implementation has no ongoing hosting cost but requires $500 to $5,000+ in developer time for the initial build. Platform-native integrations (like Shopify's built-in CAPI connector) are typically free.
### What happened to Meta's Offline Conversions API?
Meta permanently discontinued the Offline Conversions API in May 2025. All offline conversion tracking (in-store purchases, phone conversions, CRM events) now flows through the standard Conversions API. When sending offline events, use the action_source parameter set to "physical_store" or "system_generated" to identify them correctly.
### How do I connect my CRM to Meta Conversions API?
HubSpot offers a native CAPI integration that syncs lifecycle stage changes and form submissions directly to Meta. For Salesforce, Pipedrive, and other CRMs, use third-party connectors (Datahash, Stape, LeadsBridge) or configure webhooks that send data to your CAPI endpoint when deals change stages. The critical step is capturing and storing the fbclid click ID with each contact record so Meta can attribute downstream CRM events back to the original ad click.
### What is a good Event Match Quality score?
For Purchase events, target 8.8 to 9.3. For AddToCart, target 8.0+. For PageView events, 6.5 to 7.5 is normal. Meta's internal benchmark is around 6 out of 10. The highest-impact improvement is sending hashed email addresses with every event, which can increase your EMQ score by up to 4 points.
### How long does it take to see results after setting up CAPI?
Most advertisers see improved attribution data within 48 hours of implementation. Event Match Quality scores update every 48 hours. Meaningful performance improvements (lower CPA, higher ROAS) typically appear within 2 to 4 weeks as Meta's algorithm adapts to the improved signal quality. Brands report 15 to 20% campaign performance improvement on average with full CAPI implementation.
Colby Flood
Facebook Ads
Feb 22, 2026
20 min
## Ready to Take Control of Your Facebook Ad Creative Analytics?
Apply for exclusive access to DataAlly's first round of Beta testing.
Name*
Email*
Company Name*
Company Website*
Role/Title:*Select one...Founder/OwnerHead of OperationsMedia BuyerCreative StrategistOther
Company Size:*Select one...1-56-1011-2021-5050-100100-250250+
What is your biggest creative analytics or reporting challenge?*How did you hear about us?*
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

View File

@@ -0,0 +1,504 @@
Meta Conversions API fbc and fbp Parameters - Watsspace
26 min read
# Meta Conversions API fbc and fbp Parameters
Author
Published
Metas Conversions API is only as strong as the signals you send to it. Two small but mighty parameters—fbc and fbp—often determine whether your events can be accurately matched, attributed, and optimized inside Ads Manager. In this deep-dive guide for the Watsspace Digital Marketing Blog, well explain exactly what fbc and fbp are, why they matter, how to format them correctly, and how to implement them in both browser and server environments. Youll also find code examples, a practical checklist, and authoritative stats to benchmark your results.
## What Are Metas fbc and fbp Parameters?
fbc and fbp are identifiers used by Meta to improve event matching for the Pixel and the Conversions API:
- fbp is a browser identifier derived from the _fbp first-party cookie. It indicates the browser/session context for a user.
- fbc is a click identifier derived from the fbclid parameter appended to URLs when a user lands on your site from a Meta ad. The Pixel can store it in the _fbc first-party cookie.
Sending these values consistently with your server-side events gives Meta stronger signals, which typically means better attribution, more stable performance, and more resilient optimization when client-side signals are limited.
## Why fbc and fbp Matter for Conversions API
As privacy changes reduce the availability of client-side identifiers, server-side signals need all the context they can get. The combination of event_name, event_id, user_data (including fbc/fbp), and consent flags drive your Event Match Quality score in Events Manager.
- Resilience after iOS 14.5: Opt-out rates for app tracking reached an estimated 8095% in some apps. Flurry Analytics reported that global iOS opt-in rates remained around 20% through 2022, meaning many users are not providing IDFA-level signals.
- Loss of third-party cookies: Chrome maintains the largest desktop browser share globally, often reported near 6065%. StatCounter shows Chrome dominantly leading, making server-side and first-party data strategies crucial as third-party cookies phase out.
- Performance lift: Advertisers who implement Conversions API alongside the Pixel frequently report measurable improvements in event match rates and downstream CPA/ROAS. Meta has shared case examples where blended Pixel + CAPI setups improved cost efficiency; many industry case studies cite 820% lifts in attributed conversions depending on the vertical and data quality. Meta Business Help Center
## How fbp Works (The Browser ID)
fbp is designed to identify a browser instance via the first-party _fbp cookie set by the Meta Pixel. This cookie is generally set on the first pageview where the Pixel runs and typically persists for roughly 90 days (rolling) unless cleared earlier by the user or privacy controls.
- Source: The _fbp cookie in the browser (first-party).
- Use: Helps Meta tie server-to-server conversion events back to the correct browser session.
- Format: A string that begins with “fb.” and includes a version and timestamp.
When you send server-side events, include fbp in the user_data object if available. This improves event matching even when other signals (like email or phone) are not present.
## How fbc Works (The Click ID)
fbc represents the actual Facebook Click ID, derived from the fbclid query parameter that appears on landing page URLs for clicks from Meta ads. The Pixel may store it in the _fbc cookie when fbclid is present.
- Source: The fbclid parameter in the landing page URL. The Pixel can convert it into an _fbc cookie.
- Use: Provides a direct ad click reference, strengthening attribution for downstream events.
- Condition: Only set when fbclid exists. If a user didnt arrive via a Meta ad (no fbclid), you typically should not generate fbc artificially.
## fbp vs fbc: Quick Comparison
| Parameter | Purpose | Primary Source | Cookie Name | When Available | Example Format | Send If Missing? |
| --- | --- | --- | --- | --- | --- | --- |
| fbp | Browser/session identifier | _fbp first-party cookie set by Pixel | _fbp | After Pixel runs on page | fb.1.1672531200123.1234567890 | Optional but recommended; do not fabricate |
| fbc | Facebook Click ID from ad click | fbclid in URL; stored as _fbc cookie | _fbc | Only when user lands with fbclid | fb.1.1672531200123.ABCD1234efGhIJkLm | Send only when a valid fbclid exists |
## Formatting Requirements and Examples
Meta expects specific patterns for both parameters. Incorrect formatting is a common reason for Event Match Quality issues.
- fbp format: fb.1.<creation_time_millis>.<random_number>
- fbc format: fb.1.<creation_time_millis>.
Examples:
- fbp: fb.1.1717099212345.987654321
- fbc: fb.1.1717099212345.AQzXy1abcDEFghiJKlMNopQ
Notes:
- Do not hash fbc or fbp. They are sent as plain strings in user_data.
- Do not invent fbc if there was no Meta click. Only send when fbclid is present or when an _fbc cookie exists.
- The prefix fb.1 represents the version and is part of the expected format.
## Capturing fbp and fbc in Practice
The critical step is reliably capturing these values from the browser and making them available to your server-side endpoint that posts events to the Conversions API.
### Reading _fbp and _fbc Cookies in the Browser
Use small, robust utility functions to read first-party cookies.
```
// Get cookie by name
function getCookie(name) {
const value = `; ${document.cookie}`;
const parts = value.split(`; ${name}=`);
if (parts.length === 2) return parts.pop().split(';').shift();
return null;
}
// Return fbp and fbc values if available
function getMetaIds() {
const fbp = getCookie('_fbp');
const fbc = getCookie('_fbc');
return { fbp, fbc };
}
// Example usage
const { fbp, fbc } = getMetaIds();
console.log('fbp:', fbp, 'fbc:', fbc);
```
When fbclid is present on the landing page, the Pixel typically writes the _fbc cookie automatically. If for any reason it doesnt, you can create an _fbc cookie yourself—but only if fbclid is present.
### Building fbc from the fbclid in the URL
If your landing pages include fbclid, you can normalize it into the correct fbc format and set a cookie. Be sure to comply with consent and regional privacy regulations—do not set tracking cookies before the user has granted consent where required.
```
function getParam(name) {
const url = new URL(window.location.href);
return url.searchParams.get(name);
}
function setCookie(name, value, days) {
const d = new Date();
d.setTime(d.getTime() + (days*24*60*60*1000));
const expires = "expires=" + d.toUTCString();
document.cookie = `${name}=${value}; ${expires}; path=/; SameSite=Lax`;
}
(function initFbc() {
const fbclid = getParam('fbclid');
if (!fbclid) return; // Only set _fbc when there is a real fbclid
const creationTime = Date.now(); // milliseconds
const fbc = `fb.1.${creationTime}.${fbclid}`;
setCookie('_fbc', fbc, 90); // common practice ~90 days
})();
```
This ensures that downstream pages still have access to fbc even after the user navigates away from the initial landing URL.
### Persisting Identifiers for Server Use
To send fbp and fbc with server-side events, you need them on your server:
- Option A: Send them in a hidden field on your forms and include them with order confirmation payloads.
- Option B: Use an authenticated session or local storage sync to post the values to your server via AJAX on pageview.
- Option C: Implement server-side GTM or an edge-worker approach that copies the cookies via request headers.
Whichever route you choose, ensure you respect consent and avoid transmitting these IDs if users have opted out.
## Sending fbp/fbc with the Conversions API
On the server, include both identifiers inside the user_data object when making your POST to Metas events endpoint. Also include event_name, event_time, and consider using event_id for deduplication with your Pixel.
### Event Payload Structure
```
{
"data": [
{
"event_name": "Purchase",
"event_time": 1717099330,
"event_id": "order_12345",
"action_source": "website",
"user_data": {
"fbp": "fb.1.1717099212345.9876543210",
"fbc": "fb.1.1717099212345.AQzXy1abcDEFghiJKlMNopQ",
"em": "2bb80d537b1da3e38bd30361aa855686bde0...",
"ph": "89b9e71d40ca...",
"client_user_agent": "Mozilla/5.0 ...",
"client_ip_address": "203.0.113.9"
},
"custom_data": {
"currency": "USD",
"value": 129.99,
"order_id": "12345"
}
}
],
"test_event_code": "TEST123ABC"
}
```
Notes:
- Do not hash fbc/fbp. Fields like em and ph should be SHA-256 hashed (lowercased, trimmed) unless you mark them as unhashed where allowed.
- event_id should match between the Pixel and CAPI for the same event to enable deduplication.
- Use test_event_code from Events Manager when validating your setup.
### Node.js Example (Express + Fetch)
This example demonstrates sending a purchase event with both identifiers. Replace placeholders with your pixel ID and access token.
```
import express from 'express';
import fetch from 'node-fetch';
const app = express();
app.use(express.json());
app.post('/server-purchase', async (req, res) => {
try {
const {
fbp, fbc, email, phone, value, currency, order_id,
client_ip, client_ua, event_id
} = req.body;
const hashedEmail = email ? sha256(email.trim().toLowerCase()) : undefined;
const hashedPhone = phone ? sha256(phone.replace(/D/g,'')).toString() : undefined;
const payload = {
data: [
{
event_name: "Purchase",
event_time: Math.floor(Date.now()/1000),
event_id,
action_source: "website",
user_data: {
fbp,
fbc,
em: hashedEmail,
ph: hashedPhone,
client_ip_address: client_ip,
client_user_agent: client_ua
},
custom_data: {
currency,
value,
order_id
}
}
]
};
const r = await fetch(`https://graph.facebook.com/v19.0/YOUR_PIXEL_ID/events`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ ...payload, access_token: 'YOUR_ACCESS_TOKEN' })
});
const json = await r.json();
res.status(r.ok ? 200 : 400).json(json);
} catch (e) {
console.error(e);
res.status(500).json({ error: 'Server error' });
}
});
app.listen(3000, () => console.log('Server running on port 3000'));
```
In production, ensure that hashing and validation utilities are robust and that you handle consent before sending any user_data.
### Python Example (requests)
```
import time
import hashlib
import requests
PIXEL_ID = "YOUR_PIXEL_ID"
ACCESS_TOKEN = "YOUR_ACCESS_TOKEN"
def sha256_str(s: str) -> str:
return hashlib.sha256(s.encode('utf-8')).hexdigest()
def post_purchase(event_id, fbp, fbc, email, phone, value, currency, ip, ua):
data = [{
"event_name": "Purchase",
"event_time": int(time.time()),
"event_id": event_id,
"action_source": "website",
"user_data": {
"fbp": fbp,
"fbc": fbc,
"em": sha256_str(email.strip().lower()) if email else None,
"ph": sha256_str(''.join(filter(str.isdigit, phone))) if phone else None,
"client_ip_address": ip,
"client_user_agent": ua
},
"custom_data": {
"currency": currency,
"value": value,
"order_id": event_id
}
}]
payload = { "data": data, "access_token": ACCESS_TOKEN }
url = f"https://graph.facebook.com/v19.0/{PIXEL_ID}/events"
r = requests.post(url, json=payload)
return r.status_code, r.json()
# Example usage:
# status, resp = post_purchase("order_12345", fbp, fbc, email, phone, 129.99, "USD", ip, ua)
```
## Deduplication, Event Match Quality, and Measurement
Deduplication ensures you dont double-count events sent by both the Pixel and the Conversions API. Use the same event_id value client-side and server-side for the same event (e.g., the same purchase), and Meta will keep only one record.
- Event Match Quality (EMQ): This score (010) reflects how well Meta can match your events to users. Strong fbc/fbp coverage, alongside hashed email/phone and IP/UA where consented, raises EMQ. Meta Events Manager
- Consistency: Pass fbp and fbc consistently for all eligible events, not just Purchases. Add to key events like AddToCart, InitiateCheckout, Lead, and CompleteRegistration.
- Attribution stability: fbc links directly to the ad click, stabilizing reporting across attribution windows.
## Compliance, Consent, and Retention
fbc and fbp are personal data under many privacy regimes because they can identify a device/browser or user journey. Treat them with the same rigor as other user identifiers.
- Consent management: In regions covered by GDPR, ePrivacy, or similar laws, only set the _fbp and _fbc cookies after the user grants consent. If consent is withdrawn, stop sending and clear identifiers where required.
- Data retention: Keep identifiers for only as long as necessary. While the cookies commonly persist up to ~90 days, ensure your internal storage aligns with your policies.
- Transparency: Update your privacy policy to name the data collected, purposes, and partners (Meta), including cookie usage and opt-out instructions.
- US state laws: For CCPA/CPRA and other state privacy laws, honor “Do Not Sell or Share” and GPC signals, and configure limited data use where appropriate.
## Validation, Debugging, and Common Errors
Test carefully before moving to production. Meta provides tools for validation and troubleshooting.
Format errors: A very common issue is invalid formatting:
- fbp must match something like: fb.1.13-digit-timestamp.random
- fbc must match: fb.1.13-digit-timestamp.fbclid
Regex validation examples:
- fbp: /^fb.1.d{13}.d+$/
- fbc: /^fb.1.d{13}.[A-Za-z0-9_-]+$/
## Security and Data Quality Tips
Data quality and integrity drive match rates and optimization outcomes. Treat fbc/fbp like any other critical analytics signal.
- Dedup conflicts: If event_id differs between Pixel and CAPI for the same purchase, youll see duplicates. Standardize how you generate event_ids.
- Integrity: Use server-side validation to ensure fbp/fbc conform to patterns before sending.
- Transport: Always send Conversions API events over HTTPS.
- Access control: Restrict who can access server logs that might include fbc/fbp; rotate access tokens and keep them in secure vaults.
- Latency: Avoid long delays between ad click and conversion event submission. Meta recommends sending conversion events as quickly as feasible.
- Consistency: Use the same domain settings and ensure cookies are set with appropriate path, SameSite, and secure flags where applicable.
## Realistic Implementation Patterns
Depending on your stack and resources, you can implement fbc/fbp capture in several ways.
Direct Pixel + Server Endpoint:
- Pixel sets _fbp and sometimes _fbc.
- Your site captures them (e.g., via hidden inputs on checkout).
- Your server posts to CAPI on order confirmation.
Server-Side Tagging (SST):
- Use a server container or edge proxy that receives browser events.
- Read fbp/fbc from request cookies and forward them to CAPI.
- Smoothly handle consent gating and data minimization.
Headless/SPA setups:
- Persist fbp/fbc in a secure storage layer and pass them with API calls.
- Ensure client-side navigation doesnt lose first hits fbclid-derived fbc.
## Code Snippets You Can Reuse
Below are small utilities to safely capture and validate fbc/fbp before sending them to your server.
```
// Extract fbp/fbc with validation
function validateFbp(val) {
return /^fb.1.d{13}.d+$/.test(val);
}
function validateFbc(val) {
return /^fb.1.d{13}.[A-Za-z0-9_-]+$/.test(val);
}
function getSafeMetaIds() {
const fbp = getCookie('_fbp');
const fbc = getCookie('_fbc');
return {
fbp: fbp && validateFbp(fbp) ? fbp : null,
fbc: fbc && validateFbc(fbc) ? fbc : null
};
}
```
Server-side express middleware to attach identifiers from cookies if present:
```
function parseCookieHeader(cookieHeader) {
const out = {};
if (!cookieHeader) return out;
cookieHeader.split(';').forEach(pair => {
const [k, ...rest] = pair.trim().split('=');
out[k] = decodeURIComponent(rest.join('=') || '');
});
return out;
}
function metaIdMiddleware(req, res, next) {
const cookies = parseCookieHeader(req.headers.cookie || '');
req.metaIds = { fbp: cookies['_fbp'] || null, fbc: cookies['_fbc'] || null };
next();
}
```
## Frequently Asked Questions About fbc and fbp
- Do I need both fbc and fbp? No, but having both often yields better match rates. fbp helps even when there was no ad click. fbc is very valuable when it exists because its a direct click reference.
- Should I hash fbc/fbp? No. These are sent as clear strings. Only hash PII fields such as email or phone.
- What if the user deletes cookies? Then fbp/fbc may be lost. This is expected. Your implementation should be robust to missing values.
- Is fbc required for all events? No. Only send it when the user arrived via a Meta ad with a valid fbclid (or your Pixel set _fbc).
- Does fbp replace cookies? No. fbp itself is a value from a first-party cookie. It helps inform Metas matching for server-side events.
- Where can I see if these are being received? In Events Manager under diagnostics and the Test Events tool. Meta Events Manager
## Benchmarks, Research, and What “Good” Looks Like
You can use the following references to gauge whether your fbc/fbp implementation is paying off:
- Event Match Quality (EMQ): Aim for a score above 6 for your key events. Improvements in fbc/fbp completeness typically move this number. Meta Events Manager
- Attribution window stability: After implementing CAPI with fbc/fbp, many advertisers see less volatility in 1-day click/7-day click reporting and more events attributed in Ads Manager vs. analytics platforms with stricter tracking prevention. Meta Business Help Center
- Performance lift: Case studies commonly cite 820% increases in matched events and/or improvements in CPA/ROAS when CAPI runs alongside the Pixel with high-quality user_data. Actual results vary by sector, traffic mix, and consent rates. Meta Business Help Center
- iOS tracking opt-in: Flurry Analytics has reported iOS app tracking opt-in rates around 20% in aggregate, underscoring the importance of server-side and first-party identifiers. Flurry Analytics
- Market context: Chromes dominant share, often near 6065% globally, means browser privacy changes strongly influence results. StatCounter
## Edge Cases and Advanced Considerations
A few less common but important scenarios can affect fbc/fbp behavior and quality.
- Cross-domain journeys: If your funnel spans multiple domains, ensure your fbp/fbc are preserved on the conversion domain. Consider passing them via query parameters upon redirect or using first-party server-side tagging on each domain.
- Subdomains: Set cookie domain to the parent domain (e.g., .example.com) when legitimate, so that checkout.example.com and www.example.com share the same values.
- SPA frameworks: Ensure virtual pageviews dont interrupt cookie writing. On first render with fbclid present, write _fbc synchronously after consent.
- Offline conversions: For phone or in-store conversions that originated from web traffic, retain the fbp/fbc (where lawful) with the lead/customer record for later Conversions API uploads.
- Rate limiting and batching: For high-traffic sites, send events in batches and monitor Graph API rate limits. Keep event_time close to real-time for best results.
## Quality Assurance Checklist for fbc/fbp
- Consent respected: Cookies set only after lawful consent (where required). Document your logic.
- Cookie presence: Confirm _fbp appears on first pageview with Pixel; _fbc appears only when fbclid is present.
- Correct formatting: Validate with regex before sending to your server.
- Server receive path: Ensure fbc/fbp are passed to your server endpoint via form fields, headers, or AJAX.
- Event payloads: Inspect server logs (sanitized) to verify user_data includes fbp/fbc.
- Test Events: Use a test event code and confirm events in Events Manager.
- Deduplication: Confirm the same event_id is used client and server for the same transaction.
- Monitor EMQ: Track scores pre- and post-implementation; investigate dips promptly.
- Diagnostics: Resolve warnings about invalid or missing fbc/fbp promptly.
## Common Mistakes to Avoid
- Hashing fbc/fbp: These values must not be hashed. Doing so will break matching.
- Fabricating fbc: Only set fbc when a real fbclid exists. Making one up degrades data integrity.
- Ignoring consent: Setting these cookies without lawful basis in regulated regions risks non-compliance.
- Inconsistent event_id: If you dont share event_id between Pixel and CAPI, you risk duplicates.
- Missing user agent/IP: Where lawful, include client_user_agent and client_ip_address to bolster match quality.
## Simple Troubleshooting Flow
1. Check Pixel: Is the Pixel firing? Is _fbp set? When fbclid exists, is _fbc set?
2. Test URL: Manually append ?fbclid=test123 to a landing URL (in a dev environment) to verify _fbc creation after consent.
3. Inspect cookies: Confirm formatting starts with fb.1 and includes a 13-digit timestamp.
4. Server logs: Confirm user_data.fbp/fbc are arriving at your server and in CAPI payloads.
5. Events Manager: Use Test Events to verify receipt; review Diagnostics for formatting errors.
6. Compare attribution: Track changes in EMQ and matched events week over week.
## Sample End-to-End Flow
Heres a minimal outline of how data should travel in a robust setup:
1. User clicks a Meta ad and lands on your site with fbclid in the URL.
2. User consents to tracking; your site sets _fbp and constructs _fbc using the fbclid.
3. User completes a purchase; your client-side code collects fbp/fbc (and any PII, hashed as required) and posts them to your server along with event_id.
4. Your server sends the Purchase event to Conversions API with user_data including fbp/fbc, IP, UA, and hashed PII where lawful.
5. Pixel also sends the Purchase with the same event_id; Meta deduplicates and attributes correctly.
## Key Takeaways and Action Plan
- Implement both fbp and fbc: fbp is broadly useful; fbc is crucial when users arrive from Meta ads.
- Format precisely: Both must begin with fb.1; include a 13-digit timestamp; use fbclid for fbc.
- Respect privacy: Gate cookie creation and data transmission behind consent.
- Deduplicate reliably: Share event_id between Pixel and CAPI to prevent double counting.
- Monitor EMQ: Use Events Manager diagnostics to validate and iterate.
## A Final Word on Strategy
fbc and fbp are not just technical niceties; theyre strategic levers. In a world of signal loss and tightening privacy standards, these two parameters help your server-side conversion data carry the context Meta needs to optimize your campaigns. Combined with hashed PII, accurate event_ids, and consent-aware capture, they can materially improve your Event Match Quality and make your reporting and optimization more resilient.
If you take one step today, ensure your site is correctly setting and persisting _fbp, deriving _fbc from fbclid when present, and passing both from browser to server right into your Conversions API payloads. Then measure the lift in Event Match Quality and matched conversions—those metrics will tell you youre on the right track.
Check out other posts
- Meta Conversions API Best Practices
- Is Meta Conversions API GDPR Compliant?
- Meta Conversions API: The Complete Guide
- Meta Conversions API Deduplication event_id
- Facebook Conversions API vs Pixel - Key Differences
- Are Google Ads Enhanced Conversions GDPR Compliant?
- Is There VAT on Meta Ads?
- Meta Ads vs Google Ads: Which is the Best?
- Are Meta Ads Worth It?
- What is Meta Vibes?
- How to fix "Meta AI isn't available yet in your country"
- What is a Good CPC for Meta Ads?
- What is a Good CTR for Meta Ads?
- What is Frequency in Meta Ads?
- How to Get Invoice from Meta Ads
- How to get a tax invoice from Meta ads?
- What is Meta Andromeda?
- Which CRM is good for Meta ads?
- Is Meta Ads Certification Free?
- How to Make Meta Ads Above Average?

View File

@@ -0,0 +1,278 @@
Typeform Meta (Facebook) Conversions API Tracking
November 20, 2025
# Typeform Meta (Facebook) Conversions API Tracking
I recently had a client who needed Facebook or Meta Conversions API (CAPI) Conversion Tracking for Typeform. This setup is one of the most difficult ones. Took a long time to figure this one out. Very technical. But Ill provide a rough summary of the technical solution, which you can use for inspiration.
## Hire Me and Get The Best Typeform Tracking App
👀 Pssst.
You can also get in touch with me, if you want the most accurate Typeform Meta CAPI setup, done-for-you, quickly, with zero effort.
## Why Meta Conversions API tracking is important for Typeform?
The better your conversion tracking is, the more money you will make.
Simple as that.
If you run ads on meta and the action you want your users to take is a typeform submission, meta-convergence API is a non-negotiable.
All ad platforms, whether its Google Ads, Meta Ads, TikTok or others, rely on conversion tracking. If these platforms do not receive information on who converted and who did not, they are essentially shooting blind. Your ads will simply not work effectively. Especially for Meta, the entire AI advertising targeting algorithm is based on conversion tracking.
## Event Match Quality Score and Results
The more information about the conversion you share with Meta, the higher your Meta Event Match Quality Score will be. If you share the email, the phone number, first name, last name, IP address, device, click ID, country, zip code, gender, every parameter will increase your event match quality score and we will track more conversions.
Read this post on Reddit that talks about the results that happen if you can improve your meta event match quality score. Meta Event match quality score (EMQ) is the ranking meta gives you on how good your conversion tracking is. 0 to 10.
The Reddit post is a very good primer on why a more advanced Typeform Facebook / Meta CAPI installation makes you tons of money:
When you improve your EMQ score from 8.6 to 9.3, heres what we consistently see:
- Cost per acquisition drops by 18% ($42 → $35)
- Customer match rates increase by 24%
- ROAS improves by 22% on average
- Ad spend efficiency increases by ~$2,100/month at $1,000 daily spend
Server-Side Implementation The most critical element that 90% of stores get wrong is proper server-side implementation. Heres what you need to know:
1. Data Completeness: Your server needs to send the right identification parameters in the right format. Focus on high-priority parameters:
- Email (High priority)
- Click ID/fbc (High priority)
- Phone number (Medium priority)
- External ID (Medium priority)
- Browser ID/fbp (Medium priority)
1. Processing Speed: Real-time event processing is crucial. Batched events significantly reduce your EMQ score. Your events should reach Meta within seconds, not minutes or hours.
2. Event Accuracy: Deduplication is essential. Double-counting events destroys your EMQ score and wastes ad spend.
The key idea here was that the improvement in the Reddit post Meta Event Mtch Quality Score was only +0.8. Oftentimes with proper Meta conversions API setup, for an iframe-based conversion like Typeform, the difference may be more like +6.0
Absolutely insane increase. It will literally make or break your ads. You ads will make or break your business. I am not exaggerating because we have literally saved the businesses from going bankrupt just by installing high quality conversion tracking.
How good our tracking is determines how many conversions we will see. See below example where Im using different conversion tracking methods to track conversions for Acuity Scheduling (which is vety similar iFrame-based system as Typeform)
You may think you have conversion tracking but you are only tracking 30% or 50% of your conversions. With proper Typeform Meta conversions API installation, were usually able to get that to 90 to 95%. This means the meta-AI targeting algorithm has twice the data to figure out who is most likely to convert to target your ads only to the people who will actually buy. It is an unfair competitive advantage where you will beat the competition.
## How to do Typeform Meta / Facebook Conversions API setup?
Short answer: its difficult.
Typeform is already difficult to track because it is an iframe-based widget. Basically it is not part of your website. It is a website within a website. To track Typeform conversions there are two methods. We can either use a JavaScript iframe message listener and embed Typeform inside your website or we can use a redirect to a custom thank you page. Both have their pros and cons.
### Redirect
The redirect to a thank you page has the benefit of having field values available in the URL. We can do /thank-you?email= [email protected]&phone=+1555555&firstname=john&lastname=smith
etc. This helps us if we want to do meta Facebook Pixel Advanced Matching and send hashed first-party data via our browser side tracking for a solid foundation. Its also a method to do Google Ads enhanced conversion tracking if you also run Google Ads for your Typeform conversion.
The downside of this is that it is
- often difficult to manage. You may need multiple thank you pages.
- There will be personal information or PII in the URL. Google Analytics and Metapixel do not really allow this, so you may need a very complex URL cleaning function before you send Google Analytics or Metapixel events.Google Analytics is easier because we can choose the page view URL we want to send and it doesnt have to be the exact one the user is viewing.
- Metapixel is more difficult because it will use whatever URL we are browsing. We cannot remove this sensitive information, but we also kind of have to remove it or Meta will start blocking our parameters and may start blocking other things in our ad account as well.
We will often get bad referrers in Google Analytics. We may see traffic that seems to be originating from typeform.com, so we have to exclude those referrers for clean analytics.
We often get duplicate conversions. In Google Ads this usually is not a big problem because for every Google Ads conversion we can choose if we want to track one or every. However, in Meta we do not have this option. Users often accidentally refresh the thank you page because iOS, Safari for example will reload the last visited page. If user reopens their browser they will send duplicate conversions. Our numbers will not be accurate.
We have to block this page from search engines. It is in theory possible that bots or crawlers or people will visit this thank you page by accident.
Super annoying detail in Typeform (unlike for example Tally forms or Jotform): we do not get the unique submission ID of this specific form submission. We really would prefer to have this, especially for MetaConversions API and Pixel to deduplicate events.
### JavaScript iFrame Listener
The other method which I usually prefer is listening to a message type form sends via the iframe. So we add a listener script to Google Tag Manager or our website.
The benefits of this method is that we dont need to create thank you pages and we get the ID of the form and the unique submission ID. The unique submission ID will match our server side event so it is perfect for deduplication, Facebook, Meta Conversions API and Meta Pixel events.
The downside is that we do not get the field values. So for example, meta pixel advanced matching is almost impossible. We could send a webhook to a Cloudflare worker or whatever that would get us this information, but thats probably too much work.
The more practical downside is that we cannot do Google Ads enhanced conversion tracking with the email address and phone number for more accurate conversion tracking. And also we cannot create different conversions based on the field values. So lets say you ask a question like, do you want residential solar panels or business solar panels. And you want a different conversion based on their Typeform field value. This is only possible with the redirect method.
So both the Typeform redirect and the Typeform iframe message conversion tracking method have some pros and cons. For perfection we unfortunately usually need to do the thank you page, although it is more work.
### The principles for Typeform Facebook / Meta Conversions API setup
So heres how to actually do the most accurate meta Facebook tracking for Typeform.
Create a Typeform redirect to a custom thank you page. Add the field values as URL parameters.
Set up browser-side conversion tracking in Google Tag Manager by creating a custom HTML function that will look for the Typeform form ID (e.g. ?typeform_form=PVB2C) in the URL. This way we can use one thank you page in our website for multiple type forms and we dont need different pages like /thank you-1 or /thank you-2 etc.
This custom HTML script will need to be, unfortunately, pretty complicated because it needs to look for these parameters in our URL. It needs to store them in a variable or cookie or local storage. And then it needs to clean up our URL from PII, which again Google Analytics for example does not allow.
example.com/thank-you?typeform_form=PVB2C&email= [email protected]&phone=+1555555
👇
example.com/thank-you?typeform_form=PVB2C
You can use JavaScript, or Google Tag Manager Trim Query template
```
<!--Clean up url of PII-->
<script>
// Store the original URL
var originalURLBeforeUrlCleanup = window.location.href;
console.log("POTENTIALLY VIOLATING URL FIXER: Original URL stored: ", originalURLBeforeUrlCleanup);
// Construct the new URL// Use the variable provided by another function that has trimmed the query
var newURL = {{Trim Query - Page URL (ct_ PII Cleaned)}};
console.log("POTENTIALLY VIOLATING URL FIXER: New URL after removing specified parameters: ", newURL);
// Update the browser URL without refreshing the page
if (window.history && window.history.replaceState) {
window.history.replaceState({}, document.title, newURL);
console.log("POTENTIALLY VIOLATING URL FIXER: Browser URL updated to: ", newURL);
} // Push a custom event to the data layer after PII cleanup
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
'event': 'initialization-after-pii-cleanup',
'originalURLBeforeUrlCleanup': originalURLBeforeUrlCleanup,
'newURL': newURL
});
console.log("Data Layer event 'initialization-after-pii-cleanup' pushed"); </script>
```
Ideally, whatever method we use, we will create a new page view trigger. This page view trigger will replace our normal page view triggers in our Google Tag Manager for all pages. The way this custom page view trigger works is that it will either see that we are not on a thank you page and there is no personal information in our URL we should clean up. Or it will detect the personal information and will clean it up using TrimQuery or the default URL document.location without the parameters. Or will clean up the names, emails, etc. by detecting them. The trick is that our Google Analytics, our MetaPixel, and any base tracking tags will be fired using this custom page view thing to not get blocked from Meta by sending private sensitive information in the URL.
### Client Side Tracking and Data Layer
Next, we will fire a custom data layer event not by the URL which is now being cleaned up, but instead by the custom JavaScript object cookie or local storage. And we will have a trigger for our Google Ads conversions, Meta Pixel conversions and other client-side Google Tag Manager conversion tags.
### Tools for sending Facebook Meta Conversions API events
For Facebook / Meta Conversions API Typeform events, you can use a Cloudflare worker, you can vibe code your own server-side tracking system with Cursor or ChatGPT, or you can use a visual no-code tool as Zapier or n8n.com or make.com.
- Here please note that N8N does not have a built-in MetaConversions API module, so thats tricky. You can use HTTP request system or I think purchase a third-party module.
- Zapier MetaConversions API feels like a childs toy. It doesnt have all the field values. I think they just want to reduce their support load. So Zapier doesnt have the Meta or Facebook Click ID field. This is a disaster.
- Make.com I think has a really solid Meta-conversions API module. It handles hashing the parameters easier than the others.
These events are fairly straightforward to implement. However, now we get to the trickier parts.
### User identifiers and other parameters
Remember the event match quality score, how we want to send all the possible parameters? Like Click ID, user agent, IP address, Facebook click and Facebook Pixel cookies? The problem is that we do not have these within Typeform. We can get some results by the first-party user data like email, phone number, first name, last name, but its not enough if we really care about our ad performance.
So we need to pass this information into Typeform.
Creating hidden fields allows us to have all the parameters available for Facebook Meta-Conversions API. Here is where it gets even more difficult. If you only have one landing page and the visitors cannot browse your website, you may be able to store the Facebook click ID, UTM parameters, etc because Typeform iframe inherits them from the parent page, the landing page URL. But most of the time your users may be able to browse your website and you will lose the original URL parameters. This means you will need to remember the URL parameters in your browser so you will use JavaScript to create a custom tracking app that stores the click IDs and others in the browser e.g. as JavaScript cookies.
You will then need to create a custom version of your Typeform embed thats generated by adding these parameters into the hidden fields of your Typeform.
If our object with hidden field attribution values is called iframePrepopulationParameters, we can create dynamic type form button using an example code like this.
```
// Your Typeform URL
var TYPEFORM_URL = 'https://form.typeform.com/to/YOUR_FORM_ID';
// Create popup with prefilled hidden fields
var popup = window.typeformEmbed.makePopup(TYPEFORM_URL, {
mode: 'popup',
autoClose: 0,
hideScrollbars: true,
opacity: 100,
hidden: iframePrepopulationParameters
});
// Button trigger
var btn = document.querySelector('.btn.btn--border.theme-btn--primary-inverse.sqs-button-element--primary');
if (btn) {
btn.addEventListener('click', function (e) {
e.preventDefault();
popup.open();
}, { passive: false });
}
```
The end result we want is to have a reliable attribution of our Google and Facebook click identifiers in hidden fields in our Typeform results.
However, it gets even more difficult.
### Deduplication, and event IDs
Remember when I mentioned type form thank you page URL does not have the submission ID. This means we dont have a reliable way to deduplicate Facebook Pixel and Facebook conversions API events.
So we need to add a few more hidden fields into our type form. We want a random ID, just 10 random digits, which will be available in a thank you page and via the API in a hidden field. Notice that this should not be stored in the browser like the others. This one would be unique to the submission, not the user and their device.
This way we can deduplicate Meta Pixel event from the Meta Conversions API server-side event.
### Formatting the Facebook Click ID
Another pretty difficult part is formatting our Facebook Click ID. Whenever we use Google Ads conversion tracking like offline conversion tracking or conversion enhancement, we can just pass the Google Click ID. Done. Easy.
In meta or Facebook we need custom formatting for our click ID including a Unix timestamp. This is why we also wanted to pass that into our Typeform hidden fields. Please note that the timestamp should not be the timestamp when they submitted the type form, but the first visit time when we first saw them enter our website. This is how the cookie would work via Meta Pixel.
Facebook documentation of click ID formatting:
The formatted ClickID value must be of the form`version.subdomainIndex.creationTime.{fbclid}`, where:
- version is always this prefix:`fb`
- subdomainIndex is which domain the cookie is defined on (`'com' = 0`,`'example.com' = 1`,`'www.example.com' = 2`)
- creationTime is the UNIX time since epoch in milliseconds when the`_fbc` cookie was stored. If you dont save the`_fbc` cookie, use the timestamp when you first observed or received this`fbclid` value
- `{fbclid}` is the value for the`fbclid` query parameter in the page URL.
Heres an example of what the resulting`fbc` parameter value could look like (note that the`{fbclid}` portion is invalid):
```
fb.1.1554763741205.AbCdEfGhIjKlMnOpQrStUvWxYz1234567890
```
Using a visual no-code tool like make.com, and Meta Conversions API module, the click ID formatting is possible, but annoyably complex. Below is an example formatting function, assuming we have the click ID and the first visit UNIX timestamp in our Typeform hidden field.
### IP Address and User Agent
If we aim for perfection (and of course we aim for perfection, not having good tracking always equals leaving money on the table and having ads not perform as well), we also want to store the Facebook pixel cookie, the Facebook click cookie created by the Facebook pixel, user agent and IP address.
For this I have a pretty good solution but not a perfect solution yet. The problem with something like Facebook, PixelCookie or an IP address is that it takes a little bit of time to get these. In the browser we do not have the IP address of our visitor and Typeform does not store the visitor IP addresses (like JotForm does).
So the problem is that we would want to pre-populate information into Typeform hidden fields before we have that information. Now we could get the information, like IP addresses via a free API like this:
```
// Async function for IP lookup
async function getIP() {
try {
const response = await fetch('https://api.ipify.org?format=json'); //You can use it without limit (even if you're doing millions of requests per minute.
const { ip } = await response.json();
return ip;
} catch (error) {
console.log("Typeform iFrame PREPOPULATOR: ⚠️ Failed to fetch IP:", error);
return 'unknown';
}
}
```
… But we dont really want to delay loading of our Typeform and we probably dont want to do too much of a custom Typeform in bed just to keep things reliable.
At the moment my best solution will pass these fields into the typeform if they exist but I do not take any risks in dynamically generating a custom typeform. Basically this means that if the visitor visits more than one page we get all the information. If they convert directly on the landing page without visiting any other pages we will have very good tracking but not the absolute peak or perfection with IP address.
Another quirk in Facebook and Meta-conversions API is that it doesnt take user agent or IP address separately. It will only take both or neither one. This is pretty annoying because many times we would have the user agent but maybe not IP address if you use landing pages that do not have navigation menus.
If you use a custom-coded app or Cloudflare worker, you can easily Vibecode a solution. If you use a visual no-code tool like make.com, we will need to get a little bit creative. Heres an example that will only send IP address if we also have user agent, and will only send user Agent if we also have IP address.
Remember, were aiming for perfection. Our ads are gonna crush. Competitors are gonna be left waiting with their negative ROAS.
## One more parameter…
Facebook conversions API also wants to know the URL where the conversion happens. This is super easy or basically automatic with the meta or Facebook pixel, but on the server side we dont necessarily know the URL, especially if our type form exists on multiple pages. Also I recommend sending the conversion page into a hidden field as well.
## Facebook Convesion Event Names?
One last thing to take into account is choosing the event. Usually Typeform is used for lead generation, so event like lead or submit application work really well. I recommend standard events (like Lead) because custom events (like Typeform_Contact_form_submit) need to be manually turned into custom conversions, and activated by running a campaign with this custom goal to start seeing the results. So its a lot of hassle and standard events are easier.
However, if your niche is more on the healthcare side where the data is more sensitive, you will need to use custom event names. For those cases, I would also skip the hidden field prepopulation and use settings to forget the sent data in a tool like make.com, just so you wont be breaking anyones privacy. But this would be a topic for another blog post because it varies so much by country and
## Improving things further?
This is already pretty enterprise-grade conversion tracking setup. Thats better than 99.99% of Typeform conversion tracking setups. With something like this, you will have very good time watching the money come in through your Facebook ads with near-perfect tracking and targeting.
For a future version of an even better setup, Im considering skipping the Typeform hidden field prepopulation and going through a webhook instead, combining all the attribution information we store in the browser. Then sending the info from Typeform iframe embeds JavaScript postmessage, sending the Typeform form ID and Typeform unique submission ID to a server where we will use typeform API to fetch the information of this specific form submission and then put all these pieces together. This has the benefit of always having IP address and any Meta Pixel generated cookies that again on the first load would be slower than the typeform embed so they may not be available. It would also solve problems for potential messy Google Analytics URLs and the redirect thank you annoyances.
For a few more tiny boosts in performance, we may consider a solution that makes our cookies last longer if Apple Intelligent Tracking Prevention tries to remove them. This could be used with a lazier local storage cookie keeper or a fancier server-side fingerprinting option. However, tracking like this tutorial shows will get you insane results and the rest is probably micro-optimization that may not have a noticeable impact in your tracking accuracy or ad performance.
## Want a pro to handle Meta tracking for you?
Typeform <> Facebook/ Meta Conversion API conversion tracking is pretty complicated.
If you would like a pro to set it up for you, Im now building an affordable monthly subscription app that handles all of this for you. Zero effort required. Its just gonna work and make your ads perform like theyve never performed before. If that sounds interesting, get in touch.

View File

@@ -0,0 +1,348 @@
Conversions API End-to-End Implementation
Ads and Commerce
# Conversions API End-to-End Implementation
Updated: May 5, 2026
Ads Management Standard Access is now Marketing API Access Tier
No code changes are needed.
Tier labels have been updated: “Standard Access” is now Limited Access, and “Advanced Access” is now Full Access. The revised qualification threshold for Full Access has been reduced from 1,500 to 500 Marketing API calls in the past 15 days. The underlying permission identifier remains the same, and existing access levels are preserved automatically. Learn more in the Marketing API Access Tier documentation.
The Conversions API supports advertisers efforts to provide consumers with appropriate data transparency and control while also helping them to continue providing personal experiences. With the API, you can share data directly from your server, rather than through a browser.
### Benefits of Integration
Deeper-Funnel Visibility: The Conversions API allows you to share a wider array of data when compared to the Meta Pixel. With the API, you can make decisions taking into account more information, such as CRM data, lower funnel events (including qualified leads), and multi-site conversion paths across a website and a physical location.
Data Control: When used via a Server-Only implementation (for example, without the Meta Pixel), the Conversions API gives you added control over what data you share. You can choose to append insights to your events, providing data such as product margins or historical information, like customer value scores.
Signal Reliability and Resiliency: Data sharing through the Conversions API may be more reliable than browser-based methods alone, like the Meta Pixel. The API is designed to be less susceptible to issues like a browser crash or connectivity problems. New industry data transmission restrictions may limit the efficacy of cookies and Pixel tracking, so the Conversions API helps you have control on sharing signals that may no longer be captured by the Pixel.
Additional Resources: View the Conversions API Direct Integration Playbook for Developers (PDF) and Direct Integration Webinar for Developers
## Overview
You can think about your Conversions API integration in two main stages:
Preparation — Select which type of integration makes sense for you, define which events to send, and review available optimization options.
Execution — Learn how to implement the API. For this stage, you can also use a partner integration.
The following is a snapshot of the complete integration process:
Select events to share with Meta with user consent (if any). Set up your business assets: Meta Pixel, Meta Application, Business Manager, Server Connection, System User.
Step 1: One event - Sending any event, manually or automated using the system users token. Completing this step means you have correctly set up authentication. Step 2: Fully Integrated - You need to be sending some automated events to be considered integrated. Completing this milestone means you are able to optimize for Conversions API even in the event that you stop using the Pixel or the Pixel is blocked.
Once you are fully integrated, send enough automated funnel events to be considered fully onboarded. Then, optimize your match rate based on guidance from Event Match Quality. Make sure:
- The events can be sent via either channel (browser or server) and it is not being double-counted.
- The events are being sent as close to real-time as possible.
- Provide customer information parameters to be used for identity matching.
| Requirements | Full Integration | Optimization |
| --- | --- | --- |
### Existing Pixel Users
If you have an existing Meta Pixel integration, the Conversions API integration should be built as an extension of the Pixel integration, instead of as an entirely different connection.
### General Consent
If you have logic for controlling consent with respect to sharing Pixel data, use the same logic with respect to sharing data via Conversions API.
### Alternatives
- If you want to optimize your ads for app events, please use the App Events API.
## Preparation
### Pick Your Integration Type
To start, select the integration option you would like to implement:
Redundant Setup (Recommended)
Send all events via both Pixel and Conversions API. This is the recommended setup for those who would like to keep the Pixel on their website, and are able to fully adopt the Conversions API. To succeed, you must be able to generate a persistent`event_id` for both Pixel and Conversions API events. This means sending the same`event_name` and`event_id` on both the Pixel and the Conversions API event, in order to deduplicate identical events. This setup provides performance on par or better than using only the browser Pixel. The server can capture events that may not be tracked by the browser, such as purchases that occur on a separate website, lead conversions, or phone calls.
Split Setup
Send different types of events via Pixel and Conversions API. For example, you could send`PageView` and`ViewContent` via Pixel, and`Lead` or`Purchase` via Conversions API. While this option is not as optimal as a redundant setup, you may consider it if you do not want to use a fully redundant setup. Take into consideration that you may need to complete additional work as browser changes are implemented.
Server-Only Implementation
Only send events through the Conversions API, instead of through the browser. We recommend implementing either a redundant setup or a split setup before switching to this approach.
| Setup | Approach Description |
| --- | --- |
### Define Events to Send
Once you have chosen your integration approach, you can define which events you want to send. Signals are most useful if they are matched to Meta user IDs, so it is important to think through what parameters you are sending us with an event and how often you would like to send them.
#### Event Options
Send events that are most relevant to your business. See a full list of supported standard and custom Meta events.
#### Event Parameters
You can send multiple parameters inside each event. See parameters used by Conversions API to learn more about those fields.
You can add multiple types of IDs to your events, including`event_id`,`external_id` and`order_id`. Its important to know the difference between these parameters:
External ID
Your unique ID for a specific customer.
Learn more about External ID.
Event ID
A unique ID for a given event.
Used on event deduplication. This field is very important if you are sending events via both browser Pixel and conversions API.
Order ID
A unique ID for a given order. This parameter only works for purchase events and expects an`order_id` field in`custom_data`.
This implementation is limited to select Meta partners. Contact your Meta representative for access. Used on purchase event deduplication, if you send events via both browser Pixel and conversions API.
- Once you send us your first order, we discard the second one if:
- You send a second event with the same`order_id` within a specific time window, and We resolve that the same user completed both orders.
You can deduplicate purchase events within two windows: 48 hours (recommended) or 28 days. This is the window between the first and second instances of the same event.
| ID | Description | How It Is Used |
| --- | --- | --- |
#### Data Freshness
We recommend that you send events in real time or in batches based on a specific timeline via the Conversions API. Sending your events in real time or within 1 hour helps ensure that they can be used for attribution and optimized for ad delivery.
Sending your events more than 2 hours after they occurred can cause a significant decrease in performance for ads optimized for those events. Events sent with a delay of 24 hours or more may experience significant issues with attribution and optimized ad delivery.
If youre sending events with long conversion windows, send the event as close to real time as possible from the point at which the full conversion is completed.
Move on to the next step once you have:
- A list of events to send.
- The specific fields you want to send with each event.
- Defined how frequently you will send events.
### Available Optimization Types
The Conversions API offers the following optimization types:
Conversions Optimization
Optimize ad delivery to show ads to people most likely to make a conversion.
Value Optimization (also known as Return on Ads Spend Optimization)
Optimize ad delivery to show ads to people most likely to make a conversion of a specified value, such as purchases over $50.
Dynamic Product Ads
Optimize ad delivery to show ads for specific products to people most likely to purchase those specific products.
| Optimization Option | Description |
| --- | --- |
## Execution
There are two ways to implement your integration:
- Direct Integration — You, as an advertiser, directly implement the Conversions API.
- Integration as a Platform — You, as a marketing partner, offer conversions API as a service to your clients.
Advertisers using the Conversions API through one of our marketing partners should follow our partners implementation guidelines.
## Direct Integration
### Step 1: Set Up Requirements
Prior to using the Conversions API, set up the following assets:
Meta Pixel
When you send events through the Conversions API, theyre processed and stored in the same way as the events you send through your Pixel. When you implement the Conversions API, you select which Pixel you want to send your events to. Sending your Conversions API events to a Pixel lets you use your Conversions API events in the same way you use your browser-based Pixel events for measurement, attribution, and ad delivery optimization. We recommend sending events from the browser and your server to the same Meta Pixel ID.
You need a Business Manager to use the API. Business Manager helps advertisers integrate Meta marketing efforts across their business and with external partners. If you dont have a Business Manager, see the Help Center article on how to Create a Business Manager.
Access Token
To use the Conversions API, you need an access token. There are two ways of getting your access token:
- Via Events Manager(Recommended)
- Using Your Own App
| Asset | Description |
| --- | --- |
Move on to Implement the API once you have the assets ready. Remember to save IDs for your assets, since you use those on your API calls.
### Step 2: Implement the API
Once you are done with the requirements, start the implementation process. While building on the Conversions API, always check the developer documentation.
#### Test Calls (Optional)
If this is your first time using the API, start with a test call. To do that, you need a payload and a method for making API calls. After the call is completed, check Events Manager to verify the call worked as expected.
Use the Payload Helper to generate a sample payload to be sent with your call. Follow the instructions listed on the tool. Your payload should look something like this:
```
{
"data": [
{
"event_name": "Purchase",
"event_time": 1601673450,
"user_data": {
"em": "7b17fb0bd173f625b58636fb796407c22b3d16fc78302d79f0fd30c2fc2fc068",
"ph": null
},
"custom_data": {
"currency": "USD",
"value": "142.52"
}
}
]
}
```
If you want to test your payload from the Payload Helper, add your Pixel ID under Test this Payload and click on Send to Test Events. You should be able to see the event on Events Manager > Your Pixel > Test Events. Learn more about the Test Events Tool.
Once you are satisfied with your payload, decide how you want to make your call. You can use our Graph API Explorer (see Guide) or your own servers. If you are using your servers, you can use CURL or the Meta Business SDK—We highly recommend using the Meta Business SDK. Independently on your call method, you should call the`/{pixel_id}/events` endpoint and attach the JSON data generated by the Payload Helper. Once you make the call, you should get a response like this:
```
{
"events_received": 1,
"messages": [],
"fbtrace_id": <FB-TRACE-ID>
}
```
| Payload | API Call Method |
| --- | --- |
After you complete your first call, verify your events on Events Manager > Your Pixel > Overview.
Move on to Send and Verify Events once you have checked your test events in Events Manager.
#### Send and Verify Events
To start sending events, make a`POST` request to the APIs`/events` edge. Attach a payload to your call —if you need help generating your payload, visit the Payload Helper. See the following resources for more information and code samples:
- Using the API > Send requests
- Dropped Events
- Upload Time versus Event Transaction Time
- Batch Requests
- Hashing
After you start sending events, go to Events Manager and confirm that we have received the events you sent. Learn how to Verify Your Events.
If your implementation is complementary to a browser Pixel, move on to deduplication settings. Otherwise, you are all set! Check Support if you still have questions.
### Step 3: Add Parameters for Deduplication
If youre sending identical events from your Pixel and through the Conversions API, you need to set up deduplication for your events sent via both channels. First, read developer documentation to understand the deduplication logic.
#### Event-based deduplication
If we find the same server key combination (`event_id`,`event_name`) and browser key combination (`eventID`,`event`) sent to the same Pixel ID within 48 hours, we discard the later sent duplicate events.
To help ensure your events are deduplicated:
For the corresponding events, make sure the following parameters are set to the same value:
- `event_id` from your server event and`eventID` from your browser event
- `event_name` from your server and browser events
#### Alternative to event-based deduplication
While Event ID will always be the best way to deduplicate events, its a fairly complex implementation. You can leverage alternative solutions by using external_id or fbp parameters. If you have configured the external_id or fbp parameters to be passed via both browser and server, we will deduplicate events automatically if we see the same event with same external_id or fbp parameters within 48 hours.
### Optional Step 4: Explore Business SDK Features
https://developers.facebook.com/documentation/ads-commerce/conversions-api/guides/business-sdk-features
The Meta Business SDK has advanced features designed especially for Conversions API users:
- Ensure that each unique event sent via both Pixel and the Conversions API has its own`event_id`. This ID should not be shared with other events.
- Asynchronous Requests— Use this feature if you do not want to block your programs execution to wait for a request to be completed. With this approach, you make your request and get a signal back from the server once it has been completed. While you wait for the response, the program can keep executing.
- Concurrent Batching— Leverage asynchronous requests to increase throughput by utilizing resources more efficiently. Create batched requests to support use cases like event request workers, cron jobs, and more.
- HTTP Service Interface— Override the Business SDKs default HTTP service and implement your own custom service with your preferred method or library.
## Integration as a Platform
The following instructions are for partners offering the Conversions API as a service to advertisers.
### Step 1: Set Up Requirements
Your app should get the following features and permissions:
- Access Level: advanced access
- Feature: Marketing API Access Tier
- Permissions: ads_management or business_management and pages_read_engagement and ads_read.
### Step 2: Send Events on Behalf of Clients
#### 1. Facebook Login for Business (Recommended for partners)
Facebook Login for Business is the preferred authentication and authorization solution for Tech Providers and business app developers who need access to their business clients assets. It allows you to specify the access token type, types of assets, and permissions your app needs, and save it as a set (configuration). You can then present the set to your business clients who can complete the flow and grant your app access to their business assets.
#### 2. Meta Business Extension
Meta Business Extension returns all the necessary information needed to send events on behalf of the client via the following process. Meta Business Extension provides an endpoint to retrieve system user access tokens created in the clients Business Manager. This process includes permissions to send server events and is done automatically and in a secured way.
The endpoint requires the user access token as input parameter. For new Meta Business Extension users, call this endpoint the endpoint to fetch the system user access token after you finish setting up Meta Business Extension. Existing users need to ask for re-authentication before calling the new API endpoint.
Facebook Business Extension is currently only available to approved partners. If you are interested in becoming a partner, contact your Meta representative for access.
#### 3. Business On behalf Of: Client shares dataset to the partners Business Manager
The client shares their dataset to the partner via Business Manager settings, see Client system users access token section or via API through the On Behalf Of onboarding method. You can assign the partner system user to the client pixel and generate an access token to send server events by manually creating a System User Access Token. This can be done via the Conversions API inside the pixel settings above. On the API side, you need to request access to the clients ad account managing the dataset and proceed sharing pixels via API.
#### 4. Client system users access token
This is the similar onboarding flow for direct integration. You will have your client manually create a System User Access Token via the Conversions API inside the dataset settings. Then, you can send events to the advertisers dataset with that token. A system user or an admin system user must install the app that will be used to generate the access token. With this setup, your app is allowed to call APIs on behalf of this system user or admin system user.
Note: If the partner system leverages this method, their token will be limited to sending data only to Meta. The token cant be used to run API GET data requests.
### Step 3: Attribute Events to Your Platform
To attribute Conversions API events to your platform, use the`partner_agent` field. This allows you to set your own platform identifier when sending events on behalf of a client. If you are a managed partner, work with your Meta Representative to agree on an identifier for your platform. This value should be in a format that is less than 23 characters and includes at least two alphabetical characters. Then, send it with each server event.
Always provide an up-to-date setup guide for advertisers looking to activate the integration on your platform.
## Support
### For All Partners
See information about debugging and Business Help Center articles.
### For Managed Partners
Provide the following information to your Meta Representative, so they can help with testing integrations and troubleshooting: Business Manager ID, App ID, Pixel IDs.
## API Documentation
- Get started- Test the API from your own Business Manager
- Using the API
- Best Practices - Conversions API
- Set Up Conversions API as a Platform
- Standard Meta Events
- Custom Meta Events
- Parameters
- Payload Helper
- Data Processing Options for Conversions API and Offline Conversions API
- If you want to optimize for app events, use App Event API
---