mixpanel-js icon indicating copy to clipboard operation
mixpanel-js copied to clipboard

Introduce header/data compression for sending events

Open JSmith01 opened this issue 6 months ago • 0 comments

The company I work in uses Mixpanel API for quite some time at a decent scale for their products. Some of them send a big amount of data for each event. Additionally, Mixpanel does batching, that leads to requests having huge payloads. The question: is it possible to add some data compression (gzip/etc)?

We've implemented this for our internal tracking tool, so it uses "Content-Encoding: gzip" header and compresses (our case) json payload using Compression Streams API. But our tracking backend supports this encoding. In the product we mostly support recent browsers, so this compression API is almost always present.

It is critical for some applications to have an ability to deliver events in a realtime still keeping them small despite the high amount of reported data. As an example, our company provides a WebRTC-based videoconferencing solution, that in some circumstances suffers from additional traffic we're producing by calling the Mixpanel API.

To sum up, please consider adding compression for sending event payloads.

JSmith01 avatar Aug 06 '24 20:08 JSmith01