How to Correctly Implement Ads.txt and Fix Adsense Earnings at risk warning ?

In this article, we will cover how to fix errors in your Ads.txt file to allow Adsense to generate revenue for you.

Background

This actually, happened to me when I happen to implement Ads.txt file on recommendation from Media.net, when I signed up with them. The day I implemented couple of Media.net ad units and Ads.txt file at the root of my domain.

The next morning, upon checking saw my Adsense revenue was zero for the day, which is bad since as a publisher each lost impression costs your hard work. And their was a warning saying –

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.

Upon investigating my website, I could see all the Adsense Ad Units stopped serving and ad positions happen to be blank or serving Media.net ads through the backups set in my Adsense account.

At this point, I decided to actually dig a bit more to understand what’s an Ads.txt file and what its used for ?

What is Ads.txt ?

Ads.txt stands for Authorised Digital Sellers and is an IAB (Internet Advertising Bureau) standard used by the advertising community.

Ads.txt specifies a mechanism for publishers to list their authorised digital sellers, in order to fight against fraud and misrepresented domains.

In a nutshell, it’s a way for website owners and publishers to whitelist who can put ads on their website.

Do I need Ads.txt for Adsense to work or not ?

No, if your website has not implemented Ads.txt file you do not have to do it. As, Google Adsense currently allows ad serving without Ads.txt

Where is Ads.txt implemented ?

Ads.txt lives at the root of your domain to add/edit/delete the file you will need to open your cPanel file manager or ftp client you may be using, if you have specific questions leave them in the comments below.

Example: mrvirk.com/ads.txt (correct)

mrvirk.com/folder/ads.txt (incorrect)

When do I need to whitelist Adsense in Ads.txt ?

If Ads.txt file exist under your root domain, your Adsense publisher will need to be whitelisted in order to serve ads. If that’s the case your will receive a warning in your Adsense dashboard and ads will stop serving on your website.

Publisher ID missing from Ads.txt File

How to Fix Adsense Ads.txt error and correctly implement Ads.txt for your website ?

Step 1: Click the notification icon and Select Action Button

adsense ads.txt issue notification
adsense ads.txt issue notification

This will open the Sites Overview section with instructions and your publisher ID

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.
adsense ads.txt file implementation

Step 2: Open your Adx.txt file in a Text Editor, add this one line.

Example: google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0

Note: Don’t forget to change zero’s in pub-0000000000000000 to your publisher id, best practice is to copy the code/line provided by Google.

adsense publisher ID
adsense publisher ID

Step 3: Save the file

Here, is an example of this websites Ads.txt file

ads.txt example
ads.txt example

It may take 24 hours to reflect the changes and things to get normal, for me it took about 5-6 hours when Adsense confirmed the issue got resolved.

Earnings at risk - One or more of your ads.txt files doesn't contain your AdSense publisher ID resolved
Issue Resolved

At this point things will go back to normal, meaning you will see Adsense ads serving on your website at this point and start making money again.

adsense ad serving on mr virk media page after ads.txt fix
Adsense Ad serving on Mr. Virk Media page after ads.txt fix
Default image
Navjot Singh Virk
Navjot is a Hobby Blogger from Ireland and loves to create content to help people. He makes time on weekends to work on this blog. And has a full time position at Workday as Technical Product Manager, which he loves and thrives at. His Skills include in-depth knowledge of SEO, Javascript, Advertising, HTML, Java and Product Management. And his other hobbies include Investing, Gardening and playing Table Tennis.