Recently, I was setting up AdSense for my blog.
If you see this in your AdSense
Earnings at risk - You need to fix some ads.txt file issues to avoid severe impact to your revenue.
Press 'Learn more' and you will get this information about how to create ads.txt file.
Create an ads.txt file for your site
AdSense provides a personalized ads.txt file that you can download from your account. The personalized ads.txt file includes your publisher ID. Your publisher ID must be included and formatted correctly for your ads.txt file to be verified.
1. Sign in to your AdSense account.
2. If there's an alert on your homepage, click Fix now. Otherwise, click Sites.
3. Click the Down arrow to open the "Create an ads.txt file for..." message.
4. Click Download. Your ads.txt file is automatically downloaded.
5. (Optional) If you’re using another ad network, remember to add that network to your ads.txt file. Contact your ad network for their ads.txt information.
6. Upload your ads.txt file to the root directory of your site. The root directory of a site is the directory or folder following the top level domain (example.com/ads.txt).
To verify that you published your file correctly, check that you successfully see your file's content when you access the ads.txt URL (https://example.com/ads.txt) in your web browser. If you can see the file in your web browser, it's likely that AdSense will successfully find it.
Press Download for the ads.txt file, and you're all good to start setting up !!!
Here's how to set up / upload ads.txt file for blogger (with steps and screenshot pictures)
1. Sign in to Blogger.
2. In the top left, choose the blog you want to set up.
3. From the menu on the left, click Settings.
4. Under "Monetization," turn on Enable custom ads. txt.
5. Click Custom ads. txt.
6. Copy the settings the downloaded ads.txt file and paste them in the text box.
7. Click Save.
And you're all good !! To check if you have successfully uploaded the ads.txt file, visit https://<yourwebsite.com>/ads.txt.