-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with adblocker #91
Comments
I'm facing the same issue. seems like the cause for this issue as well. |
I'm running into the same issue. Unfortunately, it's not simply a case of nothing being tracked due to the script being blocked, but as you said it causes the entire app to fail to start with errors like I tried to treat Mixpanel as nullable using null checks everywhere to avoid the entire app failing, which did not work. A potential solution could be to allow us to specify a unique name for the asset so that we can name the script something random that will not likely be blocked. It's also vital that the code within this module never assumes Mixpanel is present, as it seems that's part of the issue here. My workaroundI have found a workaround that seems to work for me for now, if anyone else is interested. I've created a Cloudflare Worker which simply fetches the addEventListener("fetch", (event) => {
event.respondWith(
fetch("https://{YOUR_APP_URL}/assets/packages/mixpanel_flutter/assets/mixpanel.js")
);
}); Then added that to a Worker Route on my website in Cloudflare. Something like Then in my <script src="./assets/randomname.js"></script> So far it seems to be bypassing the adblocker plugin. This is a common practice some analytics tools use to bypass ad blockers in order to get more accurate analytics. If it helps anyone trying to do this, I followed the steps in this article to figure out how to do this. |
@rain2o's workaround didn't work for me. So after a couple hours of suffering, here is came up with:
Mixpanel is still blocked by the server, but at least the whole page does not break. @ Mixpanel Team: it would be great if using a proxy using dart would be possible. This could help solve this issue and avoid the blockers from messing up the stats :) |
The uBlock origin adblocker by default will prevent downloading of
./assets/packages/mixpanel_flutter/assets/mixpanel.js
which in turn will make the app not start.Is there any workaround for this?
The text was updated successfully, but these errors were encountered: