Ad Blocker Best Practices

Follow these best practices to avoid issues caused due to overzealous ad blockers

Best Practices

  1. Ensure content doesn't look like an ad

    • Review Acceptable ads guidelines to ensure that content isn't seen as an unacceptable ad (even if it's not!)
    • Make sure that elements, external assets, etc. don't have references like "ad1", "ad-banner", etc.
    • Don't use common ad banner sizes for content
  2. Code defensively

    • Blocked content can be detected the same way as any other network/loading failure. Add error handlers to your code that deal with uncertain loading conditions.
    • Some publishers are choosing to fight ad-blocking through the use of anti-ad-blocking tools/services like PageFair.
    • If you're depending on an external script, have an error callback. Avoid using callbacks from analytics calls, etc. to run critical code.

      // If the analytics script that fires analyticsCall is blocked, cartNextStep will never run!
      window.analyticsCall("myCoolAnalyticsEvent", cartNextStep);
  3. Review the site with common ad-blockers installed to see what content is being blocked on a regular basis. Unfortunately, the blacklist/algorithms of ad blockers are changing everyday, so there's no way to ensure that content that is displayed one day isn't blocked the next. Also use tools like Ghostery to audit a site to find out what external scripts end up on the page.

  4. If content is incorrectly flagged as an ad by an ad blocker, reach out to the developer to ensure that it is whitelisted! Here is the whitelist application request page for a coalition of ad-blockers including AdBlock Plus, Crystal App, etc.

Edit in GitHub