Put your developer hat on - it's time to create your very own ads.txt file.

The process is relatively straightforward as far as ad tech goes, but it's important to get it right. The tiniest mistakes with ads.txt can slow down or even completely stop ad revenue from flowing through the programmatic advertising ecosystem and landing in your pockets.

But with this quick and simple guide to writing your ads.txt file, you won’t have to worry about that too much. Let’s dive in.

Wouldn’t it be great if there was a simple, one-step solution to creating and implementing your ads.txt file? There is — it’s Playwire. Contact us to learn more about how we can help.

-- Article Continues Below --

Ads.txt Pillar

Read the Complete Ads.txt Guide

What is an Ads.txt File?

Ads.txt, which stands for "Authorized Digital Sellers," is a simple text file that publishers and website owners create to publicly declare the companies authorized to sell their digital advertising inventory. Its aim is to increase transparency in the programmatic advertising ecosystem and combat ad fraud. 

Your ads.txt file must be hosted on the root domain of your website (e.g., https://example.com/ads.txt). This specific location is crucial for proper implementation and discoverability. It's an essential part of the IAB (Interactive Advertising Bureau) Tech Lab’s ads.txt initiative because it tells programmatic advertising buyers which authorized sellers you have authorized to sell your ad inventory.

In its simplest form, your ads.txt file is a list of every authorized digital seller you have. And if you want to participate in ads.txt — which helps prevent ad fraud and shows programmatic buyers that your inventory is high-quality and is not counterfeit inventory — you have to have one.

Think of ads.txt like a guest list for a private party at your house. Just as you wouldn't want uninvited strangers showing up and claiming they're supposed to be there, you don't want unauthorized entities selling your ad space. The ads.txt file is your way of telling potential ad buyers exactly who's on the guest list – who has the right to sell ads on your site. Understanding this purpose is crucial before you start creating your own ads.txt file.

Creating an Ads.txt File

To get an ads.txt file onto your website, you will have to create one. You can get really fancy with these files, including items like comments and variables, as well as dynamic updating. But you don't have to. For an ads.txt file to work, it has to include just a few pieces of information for each digital seller you want to authorize. Below, we'll cover what you need to know to create a simple ads.txt file.

Understanding the Ads.txt Fields

To actually authorize a seller to sell your ad inventory, you need to include specific bits of information in your ads.txt file. Through automation or manual review, programmatic buyers can check these pieces of information in your ads.txt file to make sure the seller is legitimate. 

Here are the four key fields to include for each seller:

  1. Name. This is either the business name or domain name of the seller you are authorizing.
  2. Your ID. Inside the supply-side platform (SSP), ad exchange, or ad network you are authorizing, you will have a unique publisher ID, which you will include in this field.
  3. Relationship. This field defines the relationship between your inventory and the seller you are authorizing. Options here include DIRECT and RESELLER:
  • DIRECT: Use this when you have a direct business relationship with the advertising system and are directly responsible for the ad inventory.
  • RESELLER: Use this when the advertising system is authorized to resell your inventory but doesn't have a direct relationship with you.
  1. TAG ID. If the seller you are authorizing is certified with the Trustworthy Accountability Group (TAG), you can include their TAG ID to show this certification to buyers. This field is optional.

-- Article Continues Below --


Ads.txt Resource Center

The Complete Ads.txt Resource Center

How to Write Your Ads.txt File

With the required information in hand, you're ready to write the first line of your ads.txt file. Begin by opening a blank text file in a program like Notepad (PC) or TextEdit (Mac). Then, put each of the four pieces of information described above on a single line. Separate each with a comma. 

Here’s what it might look like:

example.com, 1234, DIRECT, abc123

That's it — you've added an authorized seller to your ads.txt file. Adding more sellers is a simple matter of lather, rinse, and repeat. Starting on a new line of the file, add the four pieces of information for the next seller. Repeat that until you've added all your sellers. 

It's crucial to maintain a consistent format throughout the file. Each authorized seller should be on a new line, and the fields should be separated by commas. Avoid unnecessary spaces or punctuation within the data records. 

What makes it even simpler: every demand partner should be able to simply provide you with the complete line you need to add to your ads.txt entry if you ask.

Building an Ads.txt File with Google AdSense

Because Google has been pro-ads.txt since the project's inception, Google AdSense has made it easy to get your ads.txt file started. You can download an ads.txt file — with Google listed as an authorized seller — from your AdSense account.

Inside your AdSense dashboard, find Sites. Click the down arrow and find "Create an ads.txt file for..." You will see an ads.txt file when you click this, but keep in mind that, if you would like to authorize sellers in addition to Google, this won't be a complete file. You will have to manually add your other sellers. When you're done, click download.

Maintaining Your Ads.txt File

Once you've created your ads.txt file, it's important to remember that this isn't a one-time task. You should regularly update your ads.txt file as your advertising partnerships change. This ongoing maintenance is crucial to ensure your file remains accurate and effective in the programmatic advertising ecosystem. 

After creating and implementing your ads.txt file, it's also important to validate it. You can use tools like Google's ads.txt validator to check if your file is correctly formatted and accessible. This step helps prevent potential issues that could affect your ad revenue.

Never Worry About Your Ads.txt File Again with Playwire

While creating an ads.txt file is a fairly simple task in the world of coding and web development, it's not something that your average web or mobile app publisher can just sit down and do well in an afternoon. The problem, though, is that you don't have to just do it well — you have to do it perfectly. Otherwise, you risk breaking the authorization of those who sell your inventory, which means your ad revenue tanks. 

That's enough to get top billing in most publishers' nightmares. The good news is that you don't have to worry about it at all. You just have to let Playwire handle it. 

 

Apply Now

Frequently Asked Questions About Ads.txt Files

Here are some answers to frequently asked questions.

What exactly is an ads.txt file and why do I need one?

An ads.txt file is a text file that serves as your digital authorization list for online advertising. It tells advertisers and programmatic advertising platforms exactly which companies are authorized to sell ads on your site. Think of it as your official guest list - without it, unauthorized parties might try to sell your ad inventory, leading to ad fraud and lost revenue. Every website owner who wants to sell ads through programmatic advertising should have one in their root directory.

Where should I place my ads.txt file on my website?

Your ads.txt file must be uploaded to your website's root domain - that's the main directory of your site (like yoursite.com/ads.txt). This specific location in the root directory is crucial because that's where buyers and advertising platforms automatically look to verify your authorized sellers. If it's anywhere else, the advertising system won't be able to find it, and your authorized digital sellers won't be recognized.

How do I get my publisher ID for the ads.txt file?

Your publisher ID is a unique identifier assigned to you by each ad network or ad exchange you work with. For your Google AdSense account, you can find this ID in your AdSense dashboard - just look for your account ID in the account settings. Each advertising platform will have a different publisher ID for you, so you'll need to collect these from all your authorized parties before you create your ads.txt file.

What's the difference between DIRECT and RESELLER in the relationship type field?

The relationship type tells buyers about your connection to each advertising platform. Use "DIRECT" when you have a direct business relationship with the ad network - meaning you work directly with them to sell your ad inventory. Use "RESELLER" when the platform is authorized to sell your ad space but doesn't have a direct relationship with you (they're reselling through another platform). Getting this right helps prevent domain spoofing and ensures buyers can properly verify your authorized sellers.

Can I automatically download my ads.txt file from Google AdSense?

Yes! Google AdSense makes it easy to get started. In your AdSense dashboard, navigate to Sites, click the down arrow, and look for "Create an ads.txt file for..." option. You can then click download to get a basic ads.txt file with Google already listed as an authorized seller. However, if you work with other ad networks beyond Google, you'll need to manually create additional entries for those authorized digital sellers.

How often should I update my ads.txt file to keep it up to date?

You should review and update your ads.txt file whenever you add or remove advertising partners. This means checking it quarterly at minimum, though we recommend monthly reviews to ensure it's properly formatted and includes all your current authorized sellers. An outdated file can prevent legitimate buyers from bidding on your ad inventory, directly impacting your ad revenue.

What happens if my ads.txt file isn't formatted correctly?

If your txt file has formatting errors, advertising systems might not be able to read it properly, which means they'll avoid bidding on your inventory to prevent potential ad fraud. Common formatting issues include extra spaces, missing commas, or incorrect domain names. Always validate your file after making changes to ensure your authorized parties are properly listed and buyers can access the relevant information they need.

Do I need to include every single ad network I work with?

Yes, you should include every advertising platform and ad exchange that you want to authorize to sell your ads. This includes direct partnerships, programmatic platforms, and any reseller relationships. Missing even one authorized seller from your file means buyers might not bid on inventory sold through that platform, potentially reducing your overall ad revenue.

Can I add comments or notes to my ads.txt file?

While the basic ads.txt format is just comma-separated values, you can add comments using the # symbol at the beginning of a line. However, keep it simple - the file should primarily contain your authorized sellers list. Each line should either be a valid seller entry or a comment, and make sure any comments don't interfere with the proper implementation of seller authorizations.

What should I do if I'm getting ads.txt errors in my advertising accounts?

First, check that your file is accessible at your root domain (yoursite.com/ads.txt). Then verify that each line is formatted correctly with the right domain, account ID, relationship type (DIRECT or RESELLER), and optional TAG ID. Use online validators to check your file, and don't hesitate to contact your advertising partners - they can often provide you with the exact line you need to paste into your file.

How does ads.txt help prevent counterfeit inventory and domain spoofing?

Ads.txt creates transparency in the programmatic advertising ecosystem by allowing buyers to verify that they're purchasing legitimate ad inventory from authorized sellers. When someone tries to create counterfeit inventory using your domain, buyers can check your ads.txt file and see that the unauthorized seller isn't listed, helping them avoid bidding on fake inventory and protecting your site's reputation.

Should I work with a partner to manage my ads.txt file?

Managing ads.txt files might seem straightforward, but getting every detail right is crucial for maintaining your ad revenue flow. Many publishers find it beneficial to work with ad tech partners who can handle the technical details, ensure proper implementation, and keep files updated as advertising relationships change. This is especially valuable if you work with multiple advertising platforms or don't have dedicated web development resources on your team.