is there any possible way that can stop mixpanel from tracking user on web app, I've use the Client-Side Tracking via a Proxy currently I've met this issue some users cannot be tracked but others are tracked normally (including me, therefore I can not reproduce the issue)
Hi Lezavi D., Please stand by as I search the Mixpanel knowledge base for an AI-powered answer. I normally take about 15 seconds or so. In case AI cannot answer your question, feel free to reach out to Mixpanel support at mixpanel.com/get-support. If you have follow-up questions for this thread, please tag me again with your question: @kapa.ai <follow-up question> 👋
Feel free to ask a follow-up question once I've answered by mentioning me with @kapa.ai
Yes. There are several supported ways Mixpanel can stop tracking a user on a web app—even if you’re using the JS SDK via a proxy—and any of these being triggered (intentionally or by a bug/config) could explain why some users are not tracked.Key mechanisms that can fully or partially stop tracking: 1. Opt-out flags (most likely)
- Calling mixpanel.opt_out_tracking() will prevent any further data from being sent for that browser; the SDK will ignore subsequent track calls. [JS privacy tracking; Protecting user data]
- If you initialized with opt_out_tracking_by_default: true, users will not be tracked until mixpanel.opt_in_tracking() is called. [JS privacy tracking; Protecting user data]
- This opt-out state is stored in cookie/localStorage and persists across sessions, so a single past call can make a specific user “untrackable” until they opt in again. [Protecting user data]2. Proxy configuration / ad-blockers
- Client-side tracking is “unreliable, due to ad-blockers”—30–50% of users can be affected. A proxy reduces this but doesn’t guarantee 100% success. [Choosing method; Sending data FAQ]
- If the proxy (api_host) is misconfigured or intermittently failing for some regions/browsers, those users will not be tracked. [JS via proxy]3. Bot filtering / $ignore usage
- The JS SDK automatically filters some known crawlers. [Bot traffic]
- If you have custom logic that sets "$ignore": true based on user agent patterns, affected users’ events will be discarded. [Bot traffic; Sending data FAQ]4. Autocapture / Session Replay vs manual tracking
- If you rely on Autocapture, it can be disabled (autocapture: false) or selectively blocked via block_selectors / block_url_regexes, which would cause “no events” on certain pages or for certain elements. [JS autocapture]
- Note: disabling Autocapture does not disable Session Replay and vice versa. [JS autocapture; Session replay privacy]5. Other privacy configs
- property_blacklist, ip: false, etc., only affect properties, not whether the event is sent, so these alone won’t fully stop tracking. [JS privacy tracking; Blacklisting default properties]Given that some users are not tracked and you can’t reproduce it yourself, I’d specifically check: 1. Whether those browsers have an opt-out flag set
- Check if your code ever calls mixpanel.opt_out_tracking() or uses opt_out_tracking_by_default: true and whether opt_in_tracking() is guaranteed to run. [JS privacy tracking; Protecting user data]2. Proxy + ad-block / network behavior on affected machines
- Ensure api_host in mixpanel.init points to your proxy and the proxy itself forwards correctly to Mixpanel for all users. [JS via proxy]
- On an affected user’s browser, enable debug mode and look for failed Mixpanel network calls. [Sending data FAQ]3. Any custom $ignore or user-agent–based filters
- Confirm you’re not accidentally treating some real users as bots. [Bot traffic]If you can share your mixpanel.init snippet and any calls to opt_out_tracking / opt_in_tracking / $ignore, I can help you narrow down which of these is most likely causing the gap.
kapa.ai is still learning and improving, please let me know how I did by reacting below.
ℹ️ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help.
It is about 30% users cannot be tracked (no event even I have caught their user ID and set as distinct ID) Here is my tracking config: mixpanel.init(MIXPANEL_TOKEN, { api_host: API_HOST, secure_cookie: true, autocapture: { click: true, input: true, dead_click: true, rage_click: true, scroll: false, submit: true, capture_text_content: true, }, record_sessions_percent: RECORD_SESSIONS_PERCENT, record_idle_timeout_ms: RECORD_IDLE_TIMEOUT_MS, track_pageview: true, persistence: "cookie", });
This looks fine. I don't think this is an issue. If you're using the Proxy correctly, 30% of users shouldn't be missing. There's something else that's off. Are you setting distinct ID via client side or server side? And have you noticed something else for these missing users?
I have set the distinct ID via mixpanel.identify(user.id); in client side After analyzing the untracked users, I see that they all not be captured the geolocation info (Country Code, Region, City) undefined, while these info were captured in tracked users Also here is my proxy config (written in Caddy) <my-tracking-domain> { handle /lib.min.js { reverse_proxy https://cdn.mxpnl.com { header_up Host cdn.mxpnl.com header_up X-Real-IP {http.request.header.X-Forwarded-For} header_up X-Forwarded-For {http.request.remote} header_up X-Forwarded-Host {http.request.host} rewrite /libs/mixpanel-2-latest.min.js } } handle /lib.js { reverse_proxy https://cdn.mxpnl.com { header_up Host cdn.mxpnl.com header_up X-Real-IP {http.request.header.X-Forwarded-For} header_up X-Forwarded-For {http.request.remote} header_up X-Forwarded-Host {http.request.host} rewrite /libs/mixpanel-2-latest.js } } handle /decide { reverse_proxy https://decide.mixpanel.com { header_up Host decide.mixpanel.com header_up X-Real-IP {http.request.header.X-Forwarded-For} header_up X-Forwarded-For {http.request.remote} header_up X-Forwarded-Host {http.request.host} rewrite /decide } } handle { reverse_proxy https://api.mixpanel.com { header_up Host api.mixpanel.com header_up X-Real-IP {http.request.header.X-Forwarded-For} header_up X-Forwarded-For {http.request.remote} header_up X-Forwarded-Host {http.request.host} } } }
Does the untracked user related with the setting opt_out_tracking in mixpanel, due to I did not set this may be it is set to true by default ?
events dont appear for that users who have the geolocation info undefined
Can you show me a screenshot of such a profile?
as u can see mixpanel detect the location in tracked user but it is undefined in untracked user
Got it. Something wrong in your code, that's unnecessarily creating profiles. Can you look into where all you're calling identify from? Maybe there's a plce where you're calling identify, and there's no events from there, or events go to a separate profile.
I have init the mixpanel with config autocapture and set profile in client side, but to let some sensitive info appear on mixpanel I need to init in backend in order to send these infos to mixpanel (init with token only then use mp.people.set() to send) the flow for tracking user is: user access to app then login -> authen process -> server send userID to client (query user in database then insert sensitive to mixpanel via mp.people.set() in server side only) -> client get userID -> init mixpanel and set user ID as distinctID in client side
