Solved

Providing custom endpoint for mixpanel js to sumbit events to

  • 7 February 2020
  • 1 reply
  • 74 views

Userlevel 1
Badge +2

Hi,

I would like to provide the mixpanel.js with a custom url endpoint to submit the events and metric to. I need to do that for two reasons;
1. users of my app can be behind a FW or a proxy, and I'd like the stats to be sent to the app backend instead. From the backend I can forward the stats to mixpanel.
2. I'd like to perfrom some filtering and enrichment on the backend side

icon

Best answer by raja 7 February 2020, 20:30

View original

1 reply

Userlevel 1
Badge

Hi, you can redefine the api_host to a custom value when you init() the Mixpanel JS SDK. See links below

https://github.com/mixpanel/mixpanel-js/blob/master/dist/mixpanel.globals.js#L5654

https://developer.mixpanel.com/docs/javascript-full-api-reference#section-mixpanel-init

Reply