SUPPORT.TWILIO.COM END OF LIFE NOTICE: This site, support.twilio.com, is scheduled to go End of Life on February 27, 2024. All Twilio Support content has been migrated to help.twilio.com, where you can continue to find helpful Support articles, API docs, and Twilio blog content, and escalate your issues to our Support team. We encourage you to update your bookmarks and begin using the new site today for all your Twilio Support needs.

Resolving "Unsupported Event Type" Errors in Destination Functions

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:

  1. Log in to the Segment Console and navigate to Connections, then Functions.
  2. Select the specific Destination Insert Function associated with your failing destination.
  3. Review the code to ensure there is a declared handler function for the failing event type (e.g., async function onIdentify(event, settings) { ... }).
  4. 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');.
  5. Update the code logic to ensure it successfully processes the data and ends by returning the event object (e.g., return event;).
  6. If the handler is completely missing, add the appropriate handler block for the event type and configure it to return the event.
  7. 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.

Have more questions? Submit a request
Powered by Zendesk