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
-
Select your Facebook Pixel or create a new one.
ā 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:
š Security Tip
-
Keep your token safe and donāt expose it in frontend code.
-
Regenerate if compromised.