How To Create An Ads.txt File?

Updated on: January 3, 2024
Creating an Ads.txt file? Here's what you need to know.

In the previous post, we explained what ads.txt is and why you should be concerned about it as a publisher. Now, we are going to explain how to create ads.txt and how to verify if your ads.txt file follows the right syntax or in other words, errorless.

Knowing the significance of ads.txt isn’t enough. You should learn to create and verify it without any tool.

How to create an ads.txt file?

The HTTP Content-type should be ‘text/plain’, any other Content-type will be treated as an error or will be ignored.

You need to include a separate line in the file for each authorized seller.

You can add comments or variables, however, these values will not be processed.

Each line in a publisher’s ads.txt list requires three pieces of data (plus a fourth optional field) separated by a comma.

The following is the syntax for the ads.txt file:

<SSP/Exchange domain name>,<Publisher id>,<Account relationship (Direct /Reseller)> ,<Certification id (optional)>

Example:, pub-XXXXXXXXXXXXXX, Direct, 7de89dXXXXXXXX

The following explains each parameter in the field:

Parameter What it means
SSP/ Exchange domain name Here you need to update the domain name of the SSP or the exchange ( For example if Google is your ad exchange, then you need to update the value as and let’s say if you are working with the SSP rubicon, you need to update the value as
Publisher id This is an alphanumeric value that your exchange provides you. For example, if you are using DFP, your value will be of the following format “pub-XXXXXXXXXXXXXX” Similarly, you will find this information in the Account settings of each SSP.
Account relationship Currently, there are only two values that will be processed – Direct/Reseller. Any value apart from this will result in an error.

Direct: This is a direct business contract between the publisher and the advertising system, that is you as a publisher have direct control over the account for the mentioned SSP

Reseller: This indicates that you have authorized another entity to control the account and resell your ad space via the system.

For example, if you control your ssp/google account, you need to update the value as Direct.
If a third party controls you SSP/google account, you need to update the value as Reseller.

Certification id This is a Certification authority id that your exchange/SSP provides you if they have registered with TAG. This value is alphanumeric and is optional.For example for google accounts tag id is f08c47fec0942fa0.

How to Verify Your Ads.txt?

Obviously, it’s a simple format which could be replicated by a publisher. All you need to do is chain the data as per the syntax.

But it isn’t easy as it looks. Imagine creating ads.txt for a publisher with a lot of resellers and direct partnerships. The file would be longer and more often than not, you’ll make an error.

AdAuth, an ads.txt analysis tool shows 72,875 mistakes for a single Ad exchange ( The more the mistakes, the higher the ad revenue loss.

Google ads.txt error

We work with hundreds of publishers and generally, have to update ads.txt files every day. It’s a part of our job. To make things easier, we’ve launched ads.txt validator.

It’s a tool to help the publishers identify the errors easily and validate their ads.txt file. The ads.txt file helps you protect your brand from counterfeit inventory that is intentionally mislabelled as originating from a specific domain, app, or video. Declaring authorized sellers can help you receive more advertiser spend that might have otherwise gone toward counterfeit inventory.

Ads.txt in Google Ad Manager (Google DFP)

As Google Ad Manager is the most-used ad server, we will show you how to manage Ads.txt files in GAM.

First, you need to click on the admin menu (side-bar) to see the ads.txt management item.

Ads.txt in Google Ad Manager

Once you click on it, you’ll be taken to the page where you could see your domains (let’s say you’re a media company with 5 websites) you’ll see the list of the domain and ads.txt status. You can also view your ads.txt files and make edits right on the Google Ad Manager.

Ads.txt Management in Google DFP

What’s Next?

Feel free to explore our free tool online. By creating the ads.txt, you have already taken the first step towards building a better and safe internet experience.

Want to know more about programmatic, subscribe to our free decode series.

News and Tips for Publishers

Get the inside scoop on publishing and programmatic with our 5-minute newsletter.