InfoPhilic How to Detailed Guide for Creating an Ads.txt File

Detailed Guide for Creating an Ads.txt File

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.

Amit Malewar
Amit Malewar has been the tutorial writer since 2013. His passion for helping people in all aspects of technology flow through the expert coverage he provides. In addition to writing for InfoPhilic, Amit loves to read and try new things.

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



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 can buy...

How to Remove jQuery Migrate in WordPress?

Learn how to remove jQuery Migrate from your WordPress site.

WP Super Cache Plugin: Best Settings & Configuration Guide

A cache plugin serves static contents to the visitor, which improves page load speed. There are so many cache plugins available in the WordPress plugin...

How to Delete Multiple Images in WordPress Media Gallery

Hey, guys, today, one of my friends asked me a question, How can I delete Multiple Images in WordPress? I replied, "It's very simple." Yeah,...

How To Reduce Admin-Ajax Server Load In WordPress

To increase better user experience, we always end up by increasing site speed. After clicking a website link seems like a simple thing. But...


Dreamhost Hosting

DreamPress comes pre-installed and pre-configured with WordPress making it easy to get up and running. It provides simple management to save you time.