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.

Missing Event Types After Deploying Source Insert Function

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

To resolve this issue, you must update your Source Insert Function to include the missing event handler, or delete the function if it is no longer required.
 
To update the function to allow all events to pass through, follow these steps:
  1. Navigate to the affected source in your Segment workspace.
  2. Open and edit the Source Insert Function code.
  3. 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;
}

...
  1. Save and deploy the updated function.
  2. 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.

 

Have more questions? Submit a request
Powered by Zendesk