Facebook CAPI Integration

1. Set Up Dataset on AhaChat

In the Settings menu → Integrations → click on Set Up Dataset.

Select the BM containing the Fanpage you want to connect, then click Continue.

Select the Page you want to set up events for. You can create only one Dataset per Fanpage. Choose the correct Fanpage connected to this bot if you want events to be sent from this Fanpage to the Dataset, then click Continue.

Enter the dataset name, then click Create.

Confirm the information you just created.

Finally, click Save.

The connected Dataset ID will be displayed in the integration section.

After creation, you will see the Dataset you just created appear in the Business Manager.

Note: The dataset must be created from AhaChat for AhaChat to have access to it and send events from the chatbot.

After setting up the Dataset, follow this guide to send events to Meta.

2. Automatically Sync CAPI Events

In the SettingsGeneral menu, you can enable/disable CAPI event synchronization.

  • Lead: Syncs leads when a phone number is detected.

  • Purchase: Syncs purchases when a new order is created.

This feature only works after you have set up the Dataset.

3. Call CAPI from the Chatbot Flow

In addition to automatic synchronization, you can use CAPI through chatbot flow settings with the Facebook CAPI Block.

Depending on your campaign objectives, you can choose:

Facebook CAPI - Purchase Optimize: If your main goal is to increase sales, helping Meta focus on users with the highest purchase intent. View details at

Facebook CAPI - Lead Optimize: If you want to optimize conversions such as email collection, registrations, or form submissions. View details at

Facebook CAPI - Qualified Lead Optimize: If you want to optimize conversions such as email collection, registrations, or form submissions. View details at