Skip to content
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

Assets are getting caught by ad blockers #20

Open
helen opened this issue Mar 2, 2018 · 3 comments
Open

Assets are getting caught by ad blockers #20

helen opened this issue Mar 2, 2018 · 3 comments
Labels
help wanted type:bug Something isn't working.

Comments

@helen
Copy link
Contributor

helen commented Mar 2, 2018

This is especially noticeable with the JS and CSS files, but also happens to the plugin icon from the .org repo. I'm not sure what can be done about this in the plugin itself vs. having to ask various ad blocker lists to whitelist. One would think somebody managing an ads.txt file wouldn't want to be blocking ads on their own site but who knows, and it's a silent non-blocking error so it just makes the plugin look less awesome than it actually is. Any ideas/experience with this?

@helen helen added type:bug Something isn't working. help wanted labels Mar 2, 2018
@jeffpaul jeffpaul added this to the Future Release milestone Aug 8, 2019
@dkotter dkotter mentioned this issue Apr 22, 2020
6 tasks
@adamsilverstein
Copy link

We have this issue in Site Kit as well, when WordPress admins have an Ad blocker enabled and try to set up AdSense it usually fails because our REST API endpoint is blocked.

To help here, we added ad blocker detection, then warn users to disable before they try to set up AdSense (or later if they are viewing AdSense data). Code: https://github.com/google/site-kit-wp/search?q=isAdBlockerActive&type=code

@helen
Copy link
Contributor Author

helen commented Nov 23, 2020

Thanks @adamsilverstein! I didn't quite trace it all the way, but am I reading right that it's related to canAdsRun?

An approach I had started thinking about was basically the way core does .no-js, having a message/notice in HTML that an ad blocker appears to be running that then gets hidden by the JS if it does manage to load. For this plugin that's probably a reasonably accurate lightweight route to take, just have to work on the messaging and what to tell users to do about it.

@adamsilverstein
Copy link

The approach you describe matching the way core works sounds good. It would be nice if implemented so that the notice was hidden until the page loaded, unhide if ads are blocked.

am I reading right that it's related to canAdsRun?

Yes exactly, the Site Kit code (which is admittedly obtuse) relies on an underlying mechanism where we load a file included in the plugin named "pagead2.js" which has a bit of code that sets a global canAdsRun. Ad blockers block that file from loading when active. Everything else relies on that global, and since our UI is mostly JS based we can respond accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted type:bug Something isn't working.
Projects
None yet
Development

No branches or pull requests

3 participants