Issue
When sending events to a destination configured with a Destination Insert Function, the events fail to deliver and return an UNSUPPORTED_EVENT_TYPE error in the Segment Event Delivery tab. The error payload may also include a specific message indicating that the event type (such as identify, track, or group) is not supported.
Product
Segment
Environment
Segment Console
Cause
This error occurs because the Destination Insert Function code either does not implement a handler for the specific event type being sent, or the existing code explicitly threw an EventNotSupported error. If an event passes through the function and a handler (for example, onTrack()) is not supplied, Segment throws an EventNotSupported error by default and rejects the event.
Resolution
To resolve this issue, you must update the deployed function code to properly handle the rejected event type:
- Log in to the Segment Console and navigate to Connections, then Functions.
- Select the specific Destination Insert Function associated with your failing destination.
- Review the code to ensure there is a declared handler function for the failing event type (e.g., async function onIdentify(event, settings) { ... }).
- If the handler exists, check if the code contains a line that explicitly rejects the event, such as throw new EventNotSupported('event is not supported');.
- Update the code logic to ensure it successfully processes the data and ends by returning the event object (e.g., return event;).
- If the handler is completely missing, add the appropriate handler block for the event type and configure it to return the event.
- Click Deploy to push your changes to production.
Additional Information
Writing or pasting code into the function editor only creates a draft. Your changes will not affect live event traffic or resolve the errors until you explicitly deploy the updated function.