Skip to content

Facebook Conversion API

Sesamy integrates with Facebook's Conversion API to send purchase events directly to your Facebook Event Manager, enabling you to track conversion values essential for optimizing your advertising campaigns.

Overview

The Facebook Conversion API allows you to send web events from your server directly to Facebook. This provides more reliable tracking compared to browser-based pixels alone, as it's not affected by browser privacy settings, ad blockers, or connection issues.

Benefits:

  • More accurate conversion tracking
  • Better attribution for your Facebook and Instagram ads
  • Improved campaign optimization with reliable data
  • Enhanced audience creation for retargeting
  • Measure Return on Ad Spend (ROAS) accurately

Learn more: Facebook's Conversion API Documentation

Getting Started

Prerequisites

  1. An active Facebook Business account
  2. A Facebook tracking pixel created in your Events Manager
  3. Conversion API enabled for your pixel

Setup Process

Step 1: Set Up Your Facebook Tracking Pixel

If you haven't already created a tracking pixel:

  1. Go to Facebook Events Manager
  2. Click Connect Data Sources and select Web
  3. Choose Facebook Pixel and click Connect
  4. Name your pixel and enter your website URL
  5. Complete the setup wizard

Step 2: Enable Conversion API

Follow Facebook's detailed setup guide: Using the Conversion API

Step 3: Obtain Required Credentials

You'll need to provide the following details to your Sesamy account manager:

Required Information:

  • Pixel ID: Your Facebook Pixel identifier
  • Access Token: API access token for the Conversion API

How to find your Pixel ID:

  1. Go to Facebook Events Manager
  2. Select your pixel from the data sources
  3. Click Settings
  4. Your Pixel ID will be displayed at the top

How to generate an Access Token:

  1. Go to Events Manager
  2. Select your pixel
  3. Click Settings > Conversions API
  4. Click Generate Access Token
  5. Copy the token and store it securely

For detailed instructions, see Facebook's Get Started guide.

Step 4: Provide Credentials to Sesamy

Send your Pixel ID and Access Token to your Sesamy account manager. They will configure the integration on your behalf.

Security Note

Never share your Access Token publicly or commit it to version control. Treat it like a password.

Events & Data

Purchase Event

Sesamy automatically sends a Purchase event to Facebook immediately after a transaction is completed on your platform.

Data Payload

The following data is included in each Purchase event:

FieldDescription
EmailThe email address associated with the user's account
CountryThe country from which the purchase was made
IP AddressThe user's IP address at the time of purchase
User-AgentBrowser details used during the purchase
FBC ParameterFacebook Click ID - captured automatically via sesamy.js
FBP ParameterFacebook Browser ID - captured automatically via sesamy.js
CurrencyThe currency used for the transaction
ValueThe total transaction value
Transaction IDUnique identifier for the purchase

Automatic Parameter Capture

FBC and FBP Parameters are captured automatically when using:

  • Sesamy.js library
  • Sesamy web components during checkout

These parameters help Facebook attribute conversions to specific ad clicks and improve tracking accuracy.

Custom Implementation Notes

If you're using a custom checkout implementation (not using Sesamy.js or web components), you must manually add the FBC and FBP parameters as query parameters to the checkout process.

Example:

https://checkout.sesamy.com/?fbclid=123&_fbc=fb.1.123&_fbp=fb.1.456

These parameters are typically available from the fbclid URL parameter (for FBC) and the _fbp cookie (for FBP).

Integration Features

Server-Side Tracking

All events are sent server-to-server from Sesamy's backend to Facebook, ensuring:

  • Reliable delivery even if the user closes the browser
  • Immunity to ad blockers
  • Better data accuracy
  • Compliance with privacy regulations

Event Deduplication

When using both Facebook Pixel (browser-side) and Conversion API (server-side), Facebook automatically deduplicates events to prevent counting the same conversion twice. Each event includes a unique event_id for this purpose.

Monitoring & Verification

Test Your Integration

After setup is complete:

  1. Make a test purchase on your platform
  2. Go to Facebook Events Manager
  3. Select your pixel
  4. Click on the Test Events tab
  5. Verify that the Purchase event appears with the correct data

Check Event Quality

Monitor your event quality score in Facebook Events Manager:

  1. Go to Events Manager
  2. Select your pixel
  3. Review the Event Quality section
  4. Aim for a high Event Match Quality (EMQ) score

Higher quality scores lead to better ad performance and attribution.

Troubleshooting

Events Not Appearing

If events aren't showing up in Facebook Events Manager:

  1. Verify your Pixel ID and Access Token are correct
  2. Check that purchases are being completed successfully
  3. Look for events in the Test Events tab (they appear there first)
  4. Allow up to 20 minutes for events to appear in reporting

Low Event Match Quality

To improve your Event Match Quality score:

  • Ensure FBC and FBP parameters are being captured
  • Verify that customer email addresses are accurate
  • Check that IP addresses and user-agent data are being sent

Custom Implementation Issues

If using a custom checkout:

  • Ensure fbclid, _fbc, and _fbp parameters are passed to the checkout URL
  • Verify these parameters are persisted throughout the checkout flow
  • Test with Facebook's Conversion API debugging tools

Best Practices

  1. Use Both Pixel and Conversion API: Implement browser-side tracking with Facebook Pixel alongside the Conversion API for maximum coverage
  2. Pass All Available Data: More data points improve attribution and audience quality
  3. Monitor Regularly: Check your Events Manager weekly to ensure events are tracking correctly
  4. Test After Changes: Verify tracking still works after making changes to your checkout process
  5. Respect Privacy: Ensure you have proper consent for tracking in compliance with GDPR and other regulations

Support

For assistance with Facebook Conversion API integration:

Released under the MIT License.