How to fix Ads.txt Not Found Issue – Cloudflare

Ads.txt Not Found Issue

I recently encountered a problem on the Google AdSense portal. It showed that my master2teach.com site’s Ads.txt status was Not found. I confirmed that I had placed the ads.txt file correctly at my website’s root.

However, when I tried to access this file using a web browser via https://master2teach.com/ads.txt, it displayed the Google Adsense provided code.

Check out the quick video for the solution

Ads.txt Not Found Issue fixed.
async function handleRequest(request) {
  const init = {
    headers: {
      'content-type': 'text/plain',
    },
  }
  return new Response(adstxt, init)
}
addEventListener('fetch', event => {
  return event.respondWith(handleRequest(event.request))
})
const adstxt =  `Add your google adsense / third party Publisher ID info`;

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *