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.

Why Do Segment Mobile Library Events Have Timestamp vs sentAt Delays?

Question

Why is there a delay between the originalTimestamp and sentAt timestamp for events sent from Segment's mobile libraries?

 

Product

Segment

 

Environment

Segment Console

 

Answer

The delay between the originalTimestamp and sentAt timestamp occurs because Segment mobile libraries queue events on the device and send them in batches to optimize network usage and battery life. If a user closes their app before the queue is flushed, events remain stored and are sent the next time the app is opened. This batching behavior can result in events being delivered hours or days after they occur.

 

Additional Information

More information on how Segment calculates timestamps can be found here. Default batching occurs every 30 seconds or after 20 events have queued. There are several options that can be utilized to reduce these delays:

  • All mobile libraries have a flushAt and flushInterval configuration option available to change these defaults. 
  • You can call flush() manually anytime to ensure an event is sent downstream. 
  • Plugin architecture in the new mobile libraries allows for a background flush policy to be implemented to flush events when the app is being moved into the background. 
Have more questions? Submit a request
Powered by Zendesk