Issue
You are sending event calls from a source and receiving 200 OK success responses, but after deploying a Source Insert Function, you noticed specific event types are completely missing from the Segment debugger and are not being ingested into your workspace.
Product
Twilio Segment
Environment
Segment Console
Cause
This issue can occur when a custom Source Insert Function is deployed on the source but does not contain a handler for every incoming event type.
Segment Insert Functions require explicit handlers for each event type you want to process and pass through. If an event handler (such as onTrack) is not implemented, events of that type will be dropped and not processed, even if the function returns a success response.
The default template includes handlers for all event types, but you must implement and return the event in each handler for it to be processed.
Resolution
- Navigate to the affected source in your Segment workspace.
- Open and edit the Source Insert Function code.
- Make sure you implement all handlers required to the function code. If you do not need to modify the event payload, you can simply return the event as-is to let it pass through. For example:
async function onTrack(event, settings) {
return event;
}
async function onIdentify(event, settings) {
return event;
}
...- Save and deploy the updated function.
- Confirm that all event calls now appear in the source debugger and downstream destinations.
Note: Alternatively, if the Source Insert Function is no longer needed, removing or disabling it from the source will immediately restore standard ingestion for all incoming event types.
Additional Information
For more details, see Source Insert Functions documentation.
- You must implement and return every event type you wish to pass through, even if you do not modify the event.
- The default source code template includes handlers for all event types; customize as needed for your use case.
-
This requirement applies to all event types:
onIdentify,onTrack,onPage,onScreen,onGroup,onAlias,onDelete.