conversion_bridge_meta_api_event_type
Description
The conversion_bridge_meta_api_event_type filter allows you to change the event type name sent to the Meta Conversions API (CAPI) before the server-side request is made. This runs after Conversion Bridge has mapped the internal event type to Meta's event name (e.g., form_submit → Lead, purchase → Purchase).
This is the server-side counterpart to conversion_bridge_meta_event_type. When you change event types, you typically want to apply the same change to both the Pixel and the Conversions API so they stay in sync for deduplicationDeduplication prevents the same conversion from being counted twice. It keeps your data accurate and is handled automatically by Conversion Bridge..
Usage
add_filter( 'conversion_bridge_meta_api_event_type', 'my_hook_function', 10, 2 );
add_filter( 'conversion_bridge_meta_api_event_type', 'my_hook_function', 10, 2 );
Parameters
$event_type(string) The Meta event type name after Conversion Bridge's mapping (e.g.,Lead,Purchase,ViewContent)$data(array) The original event data array from Conversion Bridge, includingevent_type,event_url,event_id, and other tracking fields
Example
Send form submissions as custom_form_submit instead of Meta's standard Lead event via the Conversions API. Use this alongside the conversion_bridge_meta_event_type filter to keep Pixel and CAPI events consistent:
add_filter(
'conversion_bridge_meta_api_event_type',
function( $event_type, $data ) {
if ( 'Lead' === $event_type ) {
return 'custom_form_submit';
}
return $event_type;
},
10,
2
);
add_filter(
'conversion_bridge_meta_api_event_type',
function( $event_type, $data ) {
if ( 'Lead' === $event_type ) {
return 'custom_form_submit';
}
return $event_type;
},
10,
2
);
Still need help?
If you have not yet found your answer in the documentation articles, please contact support
Contact support