Open penfold45 opened 3 years ago
The API will accept either GET or POST. For importing a single event with mixpanel.import()
, the GET should work fine. If you want to send very large payloads or multiple events at once, you can use import_batch()
which uses POST under the hood.
Is this not bad from a data leakage point of view as posting data with a GET request will mean the data is more likely to end up in log files.
That's a concern if you run your own tracking proxy and log all query params and are worried about your event payloads ending up in your internal logs. For Mixpanel's official ingestion API (api.mixpanel.com), we don't do that kind of logging.
That said, at this point there's no downside to converting this whole lib to use POST, pull requests welcome.
I feel like I am missing something. It looks to me as though import() sends the request as a GET request when it should be a POST request according to the docs
The import function calls
send_event_request()
which is always a get request as it does thismetrics.send_request({ method: "GET", endpoint: endpoint, data: data }, callback);
Can someone point me in the right direct on what I am doing wrong?
Thanks