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.
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
To use this API, you need:
If your business has a firewall for outbound requests, see Crawler IPs and User Agents to get Facebook's IP addresses. Be aware that the list of addresses changes often.
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.
Rules around app review and permissions depend on how you are implementing our API:
|Type Of Implementation||App Review And Permissions|
Advertisers Directly Implementing Server-Side
In this case, you are an advertiser looking to use server-side to directly send us your events.
If you are implementing server-side directly:
Partners Implementing Server-Side As A Platform
In this case, you are a third-party partner offering server-side functionalities for advertisers that use your services.
If you are implementing server-side as a platform:
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