Closed dawsbot closed 5 years ago
Hi @zakj @smcoll @joeymalysz (most-recent contributors)
Do you know how I can get attention to this better from the mixpanel team? Thanks
I've sent in an official support email to @mixpanel now. Will respond here with examples if we can get them 🙌
Hi @dawsbot, I have been doing a little research on how to answer your question. Proxying the Mixpanel API isn't something that's super well documented - partly because of how custom it'd need to be from customer to customer. The most simplistic solution would be to write Flask URL handlers for /track
and /engage
that take the given query string and base64-encoded payload and constructs another request to https://api.mixpanel.com/track or /engage. You'd need to include the X-Forwarded-For
header so our IP-based geolocation continues to work properly.
David
P.S. if you are an nginx user, you should talk to support about a new program we're trying out.
Aha, so no documentation will come on this? I guess that's because there's not a standard payload that could be proxied through for a given event?
Re-open this if you think others could benefit from seeing this
This would be nice to have - we want to proxy but it's far from straightforward & a simple tutorial would save us a lot of time debugging.
An official document from Mixpanel Support recommends a backend proxy to avoid ad-blockers. This involves setting the
api_host
when initializing the frontend JS library. But I cannot seem to find anywhere that says how the backend should be configured to proxy.Here is the help article, method number four here is what I'm speaking about: https://help.mixpanel.com/hc/en-us/articles/115004499463-Ad-Blockers-Affect-Mixpanel
Our backend is a flask-python application, and we already have a BE integration of Mixpanel for server-side events.
Self-Research
/track/
,/decide/
, and/engage/
(https://github.com/mixpanel/mixpanel-js/blob/8b2e1f7b/src/mixpanel-core.js#L87-L110)