Reputation: 215
It's been a couple of weeks since I started integrating AdSense on my NextJS and Vercel project, however AdSense keeps saying "Ads.txt not found" along with "Earnings at risk - You need to fix some ads.txt file issues to avoid severe impact to your revenue.".
The approval status on my website on AdSense is "Ready".
When I visit non www website, I'm redirected to www website and the ads.txt shows correctly. When I visit HTTP version of the website, I'm redirected to HTTPS and the ads.txt shows correctly.
Eg when I visit http://mywebsite.com/ads.txt, I'm redirected to https://www.mywebsite.com/ads.txt and the ads.txt shows correctly.
The ads.txt file is placed into /public/ads.txt
in the project structure.
The https://www.mywebsite.com/ads.txt is indexed on Google. I've checked this on Google Search Console.
Do you have any idea how to resolve this issue?
I would expect the error message to disappear.
Upvotes: 7
Views: 1323
Reputation: 41
If you are using vercel as your website distribution tool, choose the option that is not the www.yourdomain.com redirect method, because this is also related to
To strengthen it, you can also set it in robots.txt so that /ads.txt is allowed to be accessed and indexed by Google crawl.
Here is the syntax in robots.ts
export default function robots() {
return {
rules: [
{
userAgent: '*',
allow: ['/', '/ads.txt'],
disallow: ['/privacy-policy'],
},
],
sitemap: `${process.env.NEXT_PUBLIC_BASE_URL}/sitemap.xml`,
};
}
Upvotes: 0