How to generate Dataset id with CAPI Token

To generate a Dataset ID with a CAPI (Conversions API) token for Facebook (Meta) integration, you need to set it up from Meta Events Manager. This is typically used to send server-side events (like purchase, registration) from your backend to Facebook for better tracking and campaign optimization.


šŸ”§ Steps to Generate Dataset ID and CAPI Token

āœ… Step 1: Go to Events Manager


āœ… Step 2: Choose ā€˜Add Events’ > ā€˜From a Server’

  • Click on your Pixel.

  • Then click on ā€œSettingsā€ tab.

  • Scroll to ā€œConversions APIā€ section.

  • Click ā€œGenerate Access Tokenā€ – This gives you the CAPI token.


āœ… Step 3: Copy the Dataset ID

  • Still on the Pixel Settings tab, scroll to:

    • Pixel ID = Dataset ID (also called Data Set ID or Pixel ID)

    • It’s a 16-digit number (e.g. 1234567890123456)

šŸ“ Important: Save the Access Token securely. It won’t be shown again.


šŸ“© Example: What You’ll Get

  • Dataset ID: 1234567890123456

  • Access Token: EAAGxxxx... (long alphanumeric token)


āœ… Use Case in Backend CAPI Integration

When making POST requests to Facebook’s CAPI, you’ll send this:

bash
POST https://graph.facebook.com/v18.0/1234567890123456/events?access_token=EAAGxxxx...

šŸ”’ Security Tip

  • Keep your token safe and don’t expose it in frontend code.

  • Regenerate if compromised.

Leave a Reply

Your email address will not be published. Required fields are marked *