What Is ads.txt and Why Every Publisher Needs It
An ads.txt file is a plain text document hosted at your root domain that lists every exchange, network, and reseller authorized to sell your ad inventory. DSPs check this file before submitting bids in RTB auctions, automatically filtering unauthorized sellers. This article covers what ads.txt does, how to format it correctly, the DIRECT vs RESELLER distinction, sellers.json integration, and the mistakes that silently kill revenue.
What Problem Does ads.txt Solve?
ads.txt prevents domain spoofing, a fraud scheme where bad actors impersonate your domain on ad exchanges and sell fake inventory that appears to come from your site. Advertisers pay for impressions they think run on your pages. The fraudsters pocket the money. You earn nothing.
Before ads.txt, DSPs had no reliable way to verify whether inventory claiming to be "yoursite.com" actually came from yoursite.com. IAB Tech Lab introduced the ads.txt specification in 2017 to close that gap. The concept is simple: you publish a machine-readable list of authorized sellers at yoursite.com/ads.txt. DSPs read it. If a bid request claims to be your inventory but the selling exchange isn't in your ads.txt file, the DSP refuses to bid.
What Is the Correct Format for an ads.txt Entry?
Each line in an ads.txt file contains one authorized seller record with four fields separated by commas. The format follows the IAB Tech Lab ads.txt specification v1.1.
The canonical domain of the SSP or exchange.
Your unique identifier on that exchange.
DIRECT or RESELLER.
Optional TAG Certification ID.
Field 1: Exchange domain. The canonical domain of the SSP or exchange authorized to sell your inventory. For Google AdSense and Ad Manager, this is google.com. For Magnite, it's magnite.com. Use the exact domain the exchange specifies in their documentation.
Field 2: Publisher account ID. Your unique identifier on that exchange. In Google's case, it's your publisher ID starting with pub-. This must match exactly what the exchange has in their system. A single character mismatch means the authorization fails silently.
Field 3: Relationship type. Either DIRECT or RESELLER. More on this below.
Field 4: Certification authority ID. Optional but recommended. This is the exchange's TAG (Trustworthy Accountability Group) ID. For Google, it's f08c47fec0942fa0. It adds a second verification layer. Not all exchanges have one.
A typical publisher's ads.txt file contains 20 to 200+ lines, one per authorized seller. Google AdSense publishers have 1 to 3 lines. Publishers running header bidding through Prebid.js with six SSP adapters might have 80+ lines once each SSP's reseller chain is included.
What Is the Difference Between DIRECT and RESELLER?
DIRECT means you hold a direct account with the exchange and they pay you directly. RESELLER means a third party holds the account and sells your inventory through their relationship with the exchange.
| Attribute | DIRECT | RESELLER |
|---|---|---|
| Account ownership | You hold the account on the exchange | A third party holds the account |
| Payment relationship | Exchange pays you directly | Intermediary pays you |
| Inventory source | Your site's inventory, sold by you | Your inventory, sold through a partner |
| Fraud risk | Lower (direct verification) | Higher (additional intermediary) |
| Typical use | Google AdSense, Google Ad Manager, direct SSPs | Ad networks reselling through exchanges, header bidding partners |
Most header bidding setups produce both types. You connect to Magnite directly (DIRECT). Magnite connects your inventory to exchanges you don't have a direct account with (RESELLER lines for those exchanges). The RESELLER entries authorize the downstream chain.
Mislabeling is common and dangerous. If you mark a reseller relationship as DIRECT, DSPs may flag the discrepancy when they cross-reference your ads.txt against the exchange's sellers.json file. The result: suppressed bids on those lines, reduced auction competition, lower eCPM.
How Do You Set Up ads.txt on Your Site?
Setting up ads.txt takes five minutes. Maintaining it is the part people skip.
Step 1: Collect your authorized seller records
Every ad network and SSP you work with provides their ads.txt lines. Google AdSense gives you yours at Settings > Access and Authorization > ads.txt. Mediavine, Raptive, and other managed networks supply a complete ads.txt block during onboarding. Prebid.js partners provide theirs individually.
Step 2: Create a plain text file
Name it exactly ads.txt. No capital letters. No .html extension. No BOM (byte order mark) encoding. Use UTF-8 encoding. Paste all your authorized seller lines, one per line.
Step 3: Upload to your root domain
The file must be accessible at https://yoursite.com/ads.txt. Not a subdirectory. Not a subdomain (unless you use a subdomain= declaration). WordPress publishers can use a plugin like Starter Sites or Advanced Ads, or upload directly via FTP to the web root.
Step 4: Validate
Use Google's Ads.txt Management tool in Ad Manager, the IAB Tech Lab ads.txt validator, or AdsTxtManager.com. These tools check for syntax errors, missing fields, duplicate entries, and format issues.
Step 5: Audit quarterly
Every time you add or remove an SSP or change ad networks, update your ads.txt. An outdated file with missing sellers silently blocks demand.
How Does ads.txt Work with sellers.json?
sellers.json is the exchange-side complement to ads.txt. Your ads.txt file says "these exchanges can sell my inventory." The exchange's sellers.json file says "these publishers are real accounts on our platform." DSPs cross-reference both to verify the full supply chain.
When a DSP receives a bid request, it checks: does the publisher's ads.txt authorize this exchange? Does the exchange's sellers.json list this publisher ID? Does the relationship type match across both? All three must align for the bid to proceed.
The Supply Chain Object (schain), defined in OpenRTB 2.6, extends this by embedding the full seller chain in the bid request itself. DSPs trace every intermediary without separate file lookups. schain doesn't replace ads.txt. It adds real-time verification on top.
What Mistakes Cost Publishers the Most Revenue?
Typos in publisher IDs
One wrong digit in a pub- ID and that entire demand source goes dark. You won't see an error message. Bids just stop arriving from that exchange. The only symptom is a slow decline in fill rate or eCPM that's easy to attribute to market fluctuation instead of a broken ads.txt entry.
Missing entries after switching networks
You move from AdSense to Mediavine. Mediavine provides a new ads.txt block. You replace the entire file. Mediavine's block doesn't include entries for exchanges you added separately for header bidding. Those demand sources go offline. Run the CPM calculator against your pre-switch and post-switch eCPM to catch drops quickly.
Using HTTP instead of HTTPS
Some crawlers and DSPs only check the HTTPS version of ads.txt. If your site serves ads.txt over HTTP but not HTTPS (or vice versa), certain DSPs may not see it. Ensure both resolve to the same file.
Never auditing
Most publishers set up ads.txt once during initial programmatic advertising setup and never touch it again. Exchanges change domains. You add partners. You drop SSPs. Every change needs an ads.txt update. Quarterly validation catches drift before it costs revenue.
Compare your current fill rate and eCPM against CPM benchmarks by format. If your numbers sit below benchmark despite decent traffic, ads.txt misconfiguration is a common culprit.
Frequently Asked Questions About ads.txt
How do you create and upload an ads.txt file?
Publishers create a plain text file named ads.txt containing authorized seller records provided by ad partners, then upload it directly to the root directory of their website domain (e.g., domain.com/ads.txt).
What is the correct syntax format for an ads.txt entry?
An ads.txt record follows a comma-separated 4-field format: Exchange Domain, Publisher Account ID, Account Type (DIRECT or RESELLER), and optional Certification Authority ID (e.g., google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0).
What happens to publisher revenue if ads.txt is missing or misconfigured?
Missing or misconfigured ads.txt files cause Demand-Side Platforms to automatically block bids on publisher inventory, leading to an immediate, dramatic drop in fill rate, CPMs, and total ad revenue.
What is the difference between ads.txt and sellers.json?
Ads.txt is hosted by publishers to verify who is authorized to sell their inventory, whereas sellers.json is hosted by SSPs and ad exchanges to publicly disclose the identities of all inventory sellers.
What is the difference between DIRECT and RESELLER in ads.txt?
DIRECT indicates that the publisher directly controls the account connected to the ad exchange, whereas RESELLER indicates that a third-party partner or ad network is authorized to manage and sell that inventory.