The server-side API (for web) allows advertisers to send web events from their servers directly to Facebook. Server-side events are linked to a pixel and are processed like browser pixel events. This means that server-side events are used in measurement, reporting, and optimization in the same way as browser pixel events.
POSTrequests and learn more about dropped events, batch requests, and event transaction time.
Required and optional parameters you can use to improve ads attribution and delivery optimization.
See how your payload should be structured when it is sent to Facebook from your server.
Learn how to handle error codes returned by the API.
For subscription advertisers. Prerequisites, required parameters, and reporting metrics for subscription events.
Facebook Pixel Events
Ads Help Center
This API is under limited availability. Please contact your Facebook Representative to access it.
To use this API, you need:
You need to have a Business Manager to use the Server-Side API. Business Manager helps advertisers integrate Facebook marketing efforts across their business and with external partners.
If you don't have a Business Manager yet, see the Help Center article on how to Create a Business Manager.Help Center: About Business Manager
The Server-Side API uses Facebook Marketing API endpoints. To interact with the Marketing API, you need to register a Facebook app. For detailed information about creating a developer account, registering your app, roles, development mode or live mode, see the App Development documentation.
The newly created app should be managed by the business you just created, so you can obtain an access token.
When you initially register your app, it is set to Development mode. Development mode apps are automatically approved for all login permissions, features, and product-specific features for testing purposes. However, these permissions are limited. The app can only use those permissions to access data of users with roles in your app, like admins or developers.
In order to switch your Facebook app from Development mode to Live mode, it must go through App Review. To use the Server-Side API, request the
ads_read permission during App Review.
You need a Facebook pixel to track events on your site. To create one, see Ads Help, Use Facebook Pixel. We recommend that you use the same Facebook pixel for your website and your server-side events.Help Center: About Facebook Pixel
To create a server-side connection you must be an admin on the Business Manager. Ensure a secure connection by creating an Access Token.
Both Graph API and Marketing API calls require an access token to be passed as a parameter in each API call. You need a system user to create your access token.
A System User is a Facebook account that can only interact with the system by using API calls. It can have the same permissions as a user within a Business Manager. If you do not have one, learn how to create a System User.
For Server-Side API, we recommend that you create your token using the Business Manager:
Business Manager > Events Manager > Pixels
Data Sourcespanel, click
Manual > Create Access Token