- Content Blocker False Positives
Be careful when adding IDs, classes, or attributes in HTML that could be interpreted as paid content placement. Even if not actually advertisements or sponsored content, there is a good chance they’ll be blocked by content blockers and filters. This is something I’ve experienced firsthand. Trying to troubleshoot elements consistently hidden for only some users across a range of devices and browsers is hell. Even having them test without extensions doesn’t always work due to operating system or network-level filtering.
You don’t know pain until you figure out that the reason that some people can’t see the addition button on your tool is because you gave it the class add-btn and that triggered a selector looking for a class starting with ad. The regex is often very sloppy and vague in content blockers, as being too specific makes the blockers ineffective. It isn’t just advertising-related terms that cause issues, however. Tracking related names can be an issue too, as can references to pop-ups or paywalls. Likewise, so can elements referring to social media or newsletters.
One should also be careful with terms like ‘banner’ and using image sizes commonly used for adverts. Some filters will trigger just because of image resolutions, like 970px by 250px, which is the size of a ‘billboard’ advert, or 160px by 600px, which is the size of a ‘skyscraper’ advert. Even having terms related to advertising, like ‘billboard’ or ‘skyscraper’ in filenames, can trip content blockers.
The obvious question is how to avoid false positives. The most effective method is to reference popular filter lists and blocking systems to see if they’ll trigger on your site. Like testing across browsers, operating systems, and accessibility technologies, there is no better way to test than to actually test. One way that some sites bypass the problem is by creating a ‘namespace’ that is applied as a preprocessor step. For example, prefix every class with the name of your site so that a class such as add-btn becomes valerocks-add-btn. This isn’t a perfect approach but can work.
Though this is good to keep in mind for avoiding false-positives, you shouldn’t try to circumvent these filters if they’re accurate. Your users have made a conscious choice, and to disregard it is to disrespect them.