3 ms·
It's actually not that easy, since the client has full control over what the server sends out.
by manigandham 11y ago
It's actually not that easy, since the client has full control over what the server sends out.
- derefr 11y agoYeah, it's theoretically impossible to stop a determined extension-writer from perfectly blocking ads in a way that leaks no information. But current implementations are sloppy and leak all sorts of information. Usually you can just run some (inline!) Javascript to inspect the DOM and then do something. Or, if the client won't run Javascript at all (and you might consider making your site require Javascript to render anything, just to stymie these users, if you're on this path already), you can still set a background-image property as a "default" for a banner div, in a way that it will never get requested if the ad does get rendered, but will get requested if it doesn't. (OKCupid uses this approach, if I recall.) You can then use that information just for analytics, or you can go further and change what the server serves that client from then on (i.e. make all further pages for that session return an error.)
- RogerL 11y agoThen you'll have to explain why I see "You seem to have an ad blocker running. Would you consider turning it off, or subscribing" on many sites.
- manigandham 11y agoThe usual way sites do it is have a script that checks for any loaded ads and displays that message. This script itself can easily be blocked if sites decide to do more with it, and it has because the list is maintained by groups that decide what goes on it. They're willing to let simple messages slide but blocking the content has already proven to not work.