Skip to content
  1. LuzineDebug
  2. Web, HTML & CSS
  3. GET https://www.googletagmanager.com/gtag/js?id=…
Web, HTML & CSS Beginner ≈ 5 min to fix

Fix net::ERR_BLOCKED_BY_CLIENT (ad blocker, analytics, "ads" files)

Error message
GET https://www.googletagmanager.com/gtag/js?id=G-XXXXXXX net::ERR_BLOCKED_BY_CLIENT
  • Failed to load resource: net::ERR_BLOCKED_BY_CLIENT
  • POST https://example.com/api/ads/stats net::ERR_BLOCKED_BY_CLIENT
  • GET https://example.com/js/advert.js net::ERR_BLOCKED_BY_CLIENT
  • The resource at “https://connect.facebook.net/en_US/fbevents.js” was blocked because content blocking is enabled.
  • net::ERR_BLOCKED_BY_CLIENT.Inspector
In short

The request never left: a browser extension (uBlock Origin, AdBlock, Privacy Badger) or Brave Shields blocked it because its URL looks like advertising or tracking. Check in a private window without extensions, rename your own files and routes containing ads, banner or track, and make your site resilient to missing analytics scripts.

Be the first to confirm this fix

What this error means

"Client" here means the browser itself, not your server. Content blockers compare every URL against filter lists (EasyList, EasyPrivacy…) and cancel the request before it is sent. Chrome then shows it in red in the console, with a (blocked:other) status in the Network tab. The server receives nothing and shows up in no log. It is not a bug in your code, but it becomes one if your application depends on a blocked script (a gtag() call that crashes) or if one of your own URLs happens to contain a filtered word, such as /api/ads or banner-ad.png.

Common causes

  1. Ad or tracker blocker: uBlock Origin, AdBlock Plus, Ghostery, Privacy Badger, or the built-in protection of Brave, Opera, Firefox.
  2. Analytics or ad script: Google Analytics, Tag Manager, Meta pixel, Hotjar, AdSense are blocked by design.
  3. Unlucky file or route name: ads.js, /advertisement/, /banner/, /track, /analytics, social-share.js, CSS classes like .ad-banner hidden by cosmetic filtering.
  4. Security or corporate extension: antivirus, parental control extension or browser policy filtering some domains.

Step-by-step fix

  1. Confirm it is an extension

    Open the page in a private window (extensions are disabled there by default) or turn off blockers for this site. If the error disappears, it is confirmed.

  2. Find the blocking rule

    In uBlock Origin, open the panel > "More" > the logger: it shows every blocked request and the responsible filter. You then know which word of the URL is the problem.

  3. Rename your own files and routes

    For your legitimate resources, avoid filtered words in paths, file names and CSS classes. For example /api/ads becomes /api/campaigns and banner-ad.png becomes hero-promo.png.

    bash
    grep -rniE "(/|\b)(ads?|advert|banner|track(ing)?|analytics)[/._-]" src/ public/ --include=*.{js,ts,vue,jsx,tsx,html,css}
  4. Make the site resilient to a blocked script

    Never make an essential feature (form, payment, navigation) depend on a third-party analytics script. Call it optionally and do not block the action if it is missing.

    javascript
    function track(event, params = {}) {
      try {
        window.gtag?.('event', event, params);
      } catch {
        // analytics unavailable: ignore
      }
    }
    
    form.addEventListener('submit', () => {
      track('sign_up');
      // the form keeps working even if gtag is blocked
    });
  5. For audience metrics: respect the choice

    Visitors who block tracking chose to: do not try to get around their blocker. If you need basic statistics, use your server logs or a self-hosted analytics solution on your domain, with the consent required by the GDPR.

Did this fix work for you?

Confirm it in one click: it will rise for the next developers stuck on the same error.

Keep it from coming back

  • Test your site with a blocker turned on (uBlock Origin) before each release.
  • Pick neutral names for files, API routes and CSS classes of promotional areas.
  • Load third-party scripts with async and isolate them: their absence must never break the rest of the page.

Frequently asked questions

Is my server down?

No. The request was cancelled in the browser before being sent: your server never received it. Visitors without a blocker do not have the problem.

What does ERR_BLOCKED_BY_CLIENT.Inspector mean?

An internal DevTools request (often to Google resources) blocked by an extension. It has nothing to do with your site and you can ignore it.

Why do only some users report a button that does not work?

They are probably the ones with a blocker, and your code waits for a blocked third-party script or calls a filtered URL. Reproduce with uBlock Origin on and make that code optional.

Useful tools for this error

More Web, HTML & CSS errors

All Web, HTML & CSS errors →