Hide Google AdSense error from the browser

27 views Asked by At

I've an AdSense error showing in my browser logs. This is badly affect my SEO as below

enter image description here

The ads are shwoing and I'm not blocked by AdSense, this issue from Google part and they don't fix it ( i don't know why)

Anyway, my issue is having these error logs are affecting my SEO becuase it shows error in the browser, and I want in some way to hide the errors and not shwoing. I do have a try catch and left the catch open but this doesn't work.

import React, { useEffect } from 'react';
const AdSense = (props) => {
  const { adSlot } = props;  
  useEffect(() => {
      try {
          (window.adsbygoogle = window.adsbygoogle || []).push({});
      }
      catch (e) {
      }
  },[]);
  return (
      <>
          <ins className="adsbygoogle"
              style={{ display: "block", height: '280px' }}
              data-ad-client="{my_id_here}"
              data-ad-slot={adSlot}
              data-ad-format="auto"
              data-full-width-responsive="true">
      </>
  );
};
export default AdSense;

I want to hide the errors.

0

There are 0 answers