What is Ads.txt? How can I create one for my website?

Advertisement fraud has been on the rise over recent years with numerous organized fraud rings and sophisticated botnet schemes routinely uncovered.

Fighting back against ad fraud has become a top priority for the advertising industry and a new anti-fraud measure is one of the latest advancements that many advertisers and sites use to protect ad budget from criminals and ensure your digital ad inventory is only sold through authorized sellers.

Ads.txt has had a widespread effect on fraud rates and has saved advertisers and website owners a lot of money. We highly recommend that you implement the use of the ads.txt file on your own site.

In this tutorial, we discuss what the ads.txt file is, how it’s used, and how to create one for your own website.

What is ads.txt?

Introduced in June 2017, ads.txt is a file that aims to prevent numerous types of fraud including counterfeit inventory. The file contains a list of digital sellers (ADS) that have been authorized to resell a website’s ad inventory.

ads.txt file example

With the aid of ads.txt, it is said that this type of fraud could soon become extinct; However, there have also been contradicting reports of new bot networks that can commit fraud by evading ads.txt protections.

Ads.txt is beneficial to a website because it is an easy and safe method for businesses to fight against counterfeit inventory, domain name spoofing, and other fraud. The implementation of the file allows a website to list their authorized digital sellers. It’s simple to install, edit, and remove. It’s comparable to the robots.txt file.

How to use ads.txt

Any site can implement an ads.txt file if the correct information is included. The file must include:

  • Domain name of the advertising system or ad exchange
  • Publisher account ID
  • Type of relationship
  • Type of inventory

An example of this information would look like the following if was added to an ads.txt file:

advertising.com, 19623, RESELLER

As you can see in the example, the domain is advertising.com. It has been authorized to display ads from the website hosting the text file. The publisher ID is 19623 which typically means there is a direct relationship that doesn’t involve a 3rd party or intermediaries. The last part of the example is the advertisement type, reseller.

Google AdSense earnings at risk

Google AdSense currently shows a warning message if your site does not have an ads.txt file.

One or more of your sites does not have an ads.txt file

The warning will appear in your Google Analytics account information with a red-highlighted background. The message says:

Earnings at risk – One or more of your sites does not have an ads.txt file. Fix this now to avoid severe impact to your revenue.

Implementing an ads.txt file onto your website is not mandatory but if you want this message to go away, I suggest that you create an ads.txt file using the steps further below.

Ads.txt examples

Many substantial websites have started using an ads.txt file to protect themselves from online advertisement fraud. Click the links below to view examples of the file being used by a few recognizable websites.

How to create an ads.txt file for Google AdSense

1. Open Notepad or another word processor to create a new text file (.txt).

2. Copy and paste the following line into the text file:

google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0

Important: Replace pub-0000000000000000 with your publisher ID.

3. Save the file as ads or ads.txt.

4. Host the ads.txt file at the root level of your domain.

Sean Doyle

Sean Doyle is a tech author and engineer with over 20 years of experience in cybersecurity, privacy, malware, Google Analytics, online marketing, and other topics. Sean's content has been featured in numerous publications.