How to Get Facebook Pixel ID and Generate Access Token
Follow this guide to get your Facebook Pixel ID and generate an access token for Conversions API. This setup lets you send server-side events to Facebook for better tracking and ad optimization.
Note: You need admin access to your Facebook Business Manager to get your Pixel ID and generate an access token. Conversions API works with your Pixel to optimize ads by sending events directly from your server to Facebook.
First, log in to Facebook Events Manager (business.facebook.com/events_manager). You must have admin access to Facebook Business Manager to generate access tokens and get your Pixel ID.
https://business.facebook.com/events_managerSelect the Pixel you want to set up Conversions API for. If you don’t have one yet, create it in Events Manager.
After selecting your Pixel, go to the 'Settings' tab. This is where you'll find Conversions API options and your Pixel ID.
In the 'Conversions API' section, click 'Generate Access Token'. Facebook will create a unique token for server-side event tracking.
Copy the generated access token immediately and store it securely. Facebook won't save it for you. This token allows your server to send events directly to Facebook.
While you're in the Settings tab, copy your Pixel ID. You’ll need this ID and the access token when you configure the Conversions API in your store or app.
Best Practices
- Keep your access token and Pixel ID secure — never expose them in client-side code.
- Use system user tokens for server-to-server integrations where possible.
- Rotate tokens periodically and monitor for expiration.
- Implement robust error handling for API calls using your token.
- Grant only necessary permissions for security and compliance.