Detailed Guide for Creating an Ads.txt File

Join InfoPhilic Community!

Let's build a community to help & encourage each other to grow!

Webmasters will need to post their Publisher ID for every exchange where they have an ad exchange account. Declaring it helps in identifying who is authorized to sell their inventory.

Purchasing platforms like DSP’s and Networks can crawl the overall web to get the list of Authorized Digital Sellers for every domain. The list then identifies whether the Exchange or SSP is authorized to be sold on or not. It also identifies Publisher ID on each exchange. In addition, the buyer can decide if the Publisher ID that they are purchasing the domain from is claimed and worked by the publisher or by the authorized seller.

It also identifies Publisher ID on each exchange. In addition, the buyer can decide if the Publisher ID that they are purchasing the domain from is claimed and worked by the publisher or by the authorized seller.

For this, Google highly recommends using a tool called ads.txt. Ads.txt enables the buyer to publicly declare the companies they authorize to sell their digital inventory. It also helps publishers to reclaim control of their media, brand, and rate card. Means, advertisers can give money through proper, authorized channels only.

The detailed information about Ads.txt:

Ads.txt is an IAB approved text file that intends to prevent unauthorized inventory sales. It basically stands for Authorized Digital Sellers. Declaration of ads.txt means creating a simple, flexible and secure method for publishers and distributors to declare who is authorized to sell their inventory.

Ads.txt can only be posted to a domain by publisher’s webmaster. This makes it more secure, valid and authentic. Ans as it is a text file, thus easy to update.

The main aim of this project is to prevent various types of counterfeit inventory across the ecosystem. Even, Google now recommends using this file essentially to protect your brand from counterfeit inventory.

Creating an ads.txt file even helps you in receiving more advertiser spend that might have otherwise gone toward counterfeit inventory.

It works by creating a publicly accessible record of authorized digital sellers for publisher inventory that programmatic buyers can index and reference while purchasing inventory from authorized sellers.

How to create an ads.txt file?

According to Google, your ads.txt file must be declared publicly for the account you have set to exchange or Supply-Side Platform (SSP). In addition, it must be authorized to sell your inventory.

Create an ads.txt file in text format and host it in the root of your domain, such as,

You have to insert a separate line in the file for each authorized seller with three pieces of data.

The data involves <Field #1>, <Field #2>, <Field #3>, and <Field #4> (optional).

Syntax: #< SSP/Exchange Domain >, < SellerAccountID >, < PaymentsType >, < TAGID>

Detailed Guide for Creating an Ads.txt File
Image: iab Tech lab

<Field #1>

It is essential and indicates the domain name of the advertising system. It facilitates WHOIS and reverses IP lookups to establish clear ownership of the delegate system.

<Field #2>

<Field #2> indicates the publisher’s account ID. It involves the same value used in transactions specified by SSP/exchange.

For Google publisher accounts, use the publisher ID displayed in each account. The ID will be as follows:

  • Adsense: 

Log in to your account. Go to Settings >> Account. Click on Account Information.

  • Doubleclick for Publisher:

Log in to your DFP account. Go to Admin, click All network settings and find your publisher ID.

  • Ad Exchange:

Log in to your Ad Exchange account. Go to Admin and click Account information.

Note: While declaration, only include pub-prefix and 16-digit-code.

<Field #3>:

It indicates the type of account/relationship. You may choose to indicate either ‘DIRECT’ value or ‘RESELLER’ value.

  • The ‘DIRECT’ value means, a publisher directly controls the account indicated in field #2. It usually establishes a direct business contract between the publisher and the advertising system.
  • The ‘RESELLER’ value indicates the publisher has authorized another entity to control the account. The field is case-insensitive when interpreting the data.

If you are a Google Publisher and you haven’t directly controlled the account, then you should declare the value as ‘RESELLER’.

<Field #4>:

It is an alternative field that indicates Certification authority ID. ID within this field identifies the advertising system within a certification authority. Google Publishers would involve Tag ID here.

Examples for ads.txt:

  • Consider the following example which involves Ads.txt files from publishers working with Google product.

The lines which I have described above will be in the following formats,, pub-0000000000000000, DIRECT, f08c47fec0942fa0, pub-0000000000000000, RESELLER, f08c47fec0942fa0
  • If you are not a Google Publisher and working with other SSPs/exchanges:

Such publishers will host the files with the following kind of lines,, 12345, DIRECT, AEC242, 9675, RESELLER

Benefits of using Ads.txt:

  • Gives straightforwardness into who is offering what promotion stock
  • Increases advertiser confidence
  • Making harder for bad actors to profit from selling counterfeit inventory across the ecosystem.

I hope, this detailed guide for creating an ads.txt helps you best in realizing the program is not so as hard as you thought. You can also read Google Instructions for this technology. Follow above step by step instructions and observe the change.

If you are already using ads.txt, share your review with me in the comment section below.

Subscribe to our newsletter

To be updated with all the latest news, offers and special announcements.

Comment Policy: Your words are your own, so be nice and helpful if you can. Please, only use your real name and limit the amount of links submitted in your comment. We accept clean XHTML in comments, but don't overdo it please.


Please enter your comment!
Please enter your name here


Start WordPress Blog: Ultimate Guide For Beginners

Here is our step by step guide for beginners to start a WordPress blog.

Top 6 Best WordPress Theme Frameworks

There are many websites themes which are created by using a framework. Likewise, WordPress Theme frameworks also becoming so popular. The framework allows you...

The Most Essential WordPress Plugins

Here, I have listed some excellent plugins which will surely add more features and new functionality to your WordPress blog.

Tips to Speed Up WordPress Performance

Here, I am sharing some tips to speed up WordPress performance. All you need to modify .htaccess file on your server and add some plugins.

The Ultimate Guide to Harden WordPress Security

Learn how to improve WordPress security. Here are some basic security concepts that will help you to harden WordPress security.

How to Setup CloudFlare Free SSL for WordPress Blog

Google has announced that they will count HTTPS as a ranking factor which means if you using HTTPS you will get a higher position...


WPEngine Hosting



Get almost 100% PageSpeed on Newspaper theme

The newspaper theme is the most popular premium theme for a self-hosted WordPress blog. The theme is developed by team tagDiv. You...

How to Remove jQuery Migrate in WordPress?

jQuery Migrate greatly simplifies the process of moving older jQuery code to a higher jQuery version by identifying deprecated features. It then restores deprecated...

Tips to Speed Up WordPress Performance

Here, I am sharing some tips to speed up WordPress performance. All you need to modify .htaccess file on your server and add some plugins.

How to Properly Delete a WordPress Post or Page?

You sometimes want to delete a page from your site for many reasons. When you taking a step forward, you are going to remove...

How to create News Sitemap for WordPress site?

Learn how to create special news sitemap for your WordPress blog/ website using Yoast News SEO plugin and Jetpack plugin.

How to Prevent Invalid Activity

Publishers expect that their content should be viewed by legitimate consumers. However, criminal organizations have attacked the digital ad ecosystem with malware and other methods that...