Meta Ads: Change default event types
Conversion Bridge maps conversion events to Meta's standard event types automatically. For example, a form submission becomes Lead, a purchase becomes Purchase, and a registration becomes CompleteRegistration.
Sometimes you need different event names. Maybe you want form submissions sent as a custom event to separate them from other Lead events in your Meta reporting. Or you need to change Purchase to a custom event for a specific integration.
Starting in version 1.13.1, you can change event types and event data using WordPress filters. Add the code snippets below to your theme's functions.php file or a custom plugin.
Testing.
Change a Pixel Event Type
Use the conversion_bridge_meta_event_type filter to rename any event before the Meta Pixel fires it.
This example changes Lead events to a custom custom_form_submit event:
add_filter(
'conversion_bridge_meta_event_type',
function( $event_type, $event, $track_method ) {
if ( 'Lead' === $event_type ) {
return 'custom_form_submit';
}
return $event_type;
},
10,
3
);
The filter receives three parameters:
- $event_type (string) -- The Meta event name after Conversion Bridge's mapping. Common values:
Lead,Purchase,CompleteRegistration,ViewContent,AddToCart,InitiateCheckout,Donate,Subscribe - $event (array) -- The full event data array from Conversion Bridge
- $track_method (string) -- Either
standardorcustom, indicating the current tracking method
If you return a value that is not one of Meta's standard event names, it will automatically be sent as a custom event using fbq("trackCustom", ...) instead of fbq("track", ...).
Change a Conversions API Event Type
If you also use the Meta Conversions API (server-side tracking), you need a separate filter to change the event type there as well. This keeps both pixel and API 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
);
Important: If you use both the pixel and the Conversions API, change the event type in both filters so your events match. Mismatched event names between pixel and API can cause duplicate events in your Meta reporting.
Change Both Pixel and API Together
This example changes Purchase to CustomPurchase in both the pixel and the Conversions API with a single shared function:
function my_cb_meta_custom_purchase( $event_type ) {
if ( 'Purchase' === $event_type ) {
return 'CustomPurchase';
}
return $event_type;
}
add_filter( 'conversion_bridge_meta_event_type', 'my_cb_meta_custom_purchase' );
add_filter( 'conversion_bridge_meta_api_event_type', 'my_cb_meta_custom_purchase' );
Change Event Type Based on Source
You can use the $event array to make decisions based on which integration triggered the event.
This example sends WooCommerce purchases as the standard Purchase event but sends all other purchase events (like memberships or donations) as a custom event:
add_filter(
'conversion_bridge_meta_event_type',
function( $event_type, $event, $track_method ) {
if ( 'Purchase' === $event_type && ! empty( $event['name'] ) && $event['name'] !== 'woocommerce_purchase' ) {
return 'CustomPurchase';
}
return $event_type;
},
10,
3
);
Add Custom Data to Events
Use the conversion_bridge_meta_event_data filter to add, remove, or change the data sent with pixel events:
add_filter(
'conversion_bridge_meta_event_data',
function( $event_data ) {
if ( ! empty( $event_data['content_type'] ) && 'product' === $event_data['content_type'] ) {
$event_data['content_category'] = 'Physical Products';
}
return $event_data;
}
);
For the Conversions API, use conversion_bridge_meta_api_event_data:
add_filter(
'conversion_bridge_meta_api_event_data',
function( $event_data ) {
$event_data['content_category'] = 'Physical Products';
return $event_data;
}
);
Default Event Mappings
Here's how Conversion Bridge maps internal event types to Meta event names by default:
| Internal Event Type | Meta Event Name | Pixel Method |
|---|---|---|
| form_submit | Lead | standard |
| view_search_results | Search | standard |
| register | CompleteRegistration | standard |
| view_item | ViewContent | standard |
| add_to_cart | AddToCart | standard |
| begin_checkout | InitiateCheckout | standard |
| purchase | Purchase | standard |
| donation | Donate | standard |
| subscribe | Subscribe | standard |
| booking (with value) | Purchase | standard |
Any event type not in this list is sent as a custom event using fbq("trackCustom", ...).
Related Filters
- conversion_bridge_meta_event_type -- Developer reference for the pixel event type filter
- conversion_bridge_meta_event_data -- Developer reference for the pixel event data filter
- conversion_bridge_meta_api_event_type -- Developer reference for the Conversions API event type filter
- conversion_bridge_meta_api_event_data -- Developer reference for the Conversions API event data filter
- conversion_bridge_platform_event -- Modify event data before it reaches any platform
Still need help?
If you have not yet found your answer in the documentation articles, please contact support
Contact support