Did you get a red alert on your Google Adsense account which says “Earnings at risk – One or more of your ads.txt files doesn’t contain your AdSense publisher ID. Fix this now to avoid severe impact to your revenue.”
As most of us in Sri Lanka also use AdSense on various interesting blogs and website’s it’s import to make sure the revenue is not impacted.
You’re having a “Publisher ID missing from ads.txt files” issue which is an easy fix.
All you need is to declare who is authorized to sell your inventory with ads.txt
Here’s how to fix it
Create your own ads.txt file for AdSense
Here’s how to create an ads.txt file to publicly declare that Google is authorized to sell your ad inventory:
- Create a text (.txt) file.
- Include the following line:
google.com, pub-xxxxxxxxxxxxxxxxxx, DIRECT, f08c47fec0942fa0
Important: Make sure you replace pub-xxxxxxxxxxxxxxxxxx with your own publisher ID.
- Host your ads.txt on your root domain (for example, https://farhanonline.com/ads.txt).
Here, “root domain” is defined as one level down from the public suffix list. For example, “srilanka.com” would be considered a root domain as “.com” is on the public suffix list but “seo.srilanka.com” would not be considered a root domain.