What Is ads.txt? How Publishers Create, Set Up, and Maintain It
If you monetize a website with programmatic advertising, one small text file quietly influences how much demand can reach your inventory: ads.txt. It takes minutes to set up, but a missing, outdated, or incorrectly formatted file is one of the most common reasons publishers lose programmatic revenue without ever seeing an obvious error.
This guide covers what ads.txt is, how to read and write one, and how to keep it in good shape.
What ads.txt Actually Is
ads.txt stands for Authorized Digital Sellers. It's a plain text file, created by the IAB Tech Lab, that a publisher hosts on their own domain to publicly declare which companies are authorized to sell their ad inventory. Buyers and their platforms can check this file to confirm that an impression being offered for a publisher's site is actually coming from a seller that publisher has approved.
The original purpose was fighting domain spoofing, where fraudsters pretend to sell inventory from a legitimate, well known site while actually serving ads somewhere else entirely. By publishing an authorized seller list, publishers make that kind of impersonation much easier for buyers to detect and avoid.
Why It Matters for Revenue
Many buyers only bid on verified supply. A growing share of advertisers and DSPs filter out inventory that can't be validated against an ads.txt file, which means a missing or incomplete file can quietly reduce the number of bidders competing for your impressions.
New demand partners often require it. When you add a new SSP, exchange, or network, it will typically give you a line to add to your file. If that line never gets added, that partner's buyers may not be able to bid on your inventory at all.
It supports trust and transparency. A clean, current file signals a well maintained, legitimate site, which supports the supply path transparency that buyers increasingly prioritize.
How an ads.txt File Is Structured
Each line in the file represents one authorized seller relationship and contains comma separated fields:
google.com, pub-1234567890123456, DIRECT, f08c47fec0942fa0 exampleexchange.com, 98765, RESELLER, abc123def456
Field 1: Ad system domain. The domain of the advertising system, such as an exchange or SSP, where bids are placed.
Field 2: Publisher account ID. Your unique account ID within that system, provided by the partner.
Field 3: Relationship type. DIRECT means you directly control the account in that system. RESELLER means you've authorized another party to sell your inventory through that system.
Field 4: Certification authority ID (optional). An identifier for the system's registration with a trade body, which helps buyers verify the system. Partners usually supply this value along with your line.
Lines beginning with a hash symbol are comments and are ignored, which is useful for keeping notes about which partner each line belongs to.
How to Set It Up, Step by Step
Step 1: Collect the lines from each partner. Every demand partner you work with, networks, SSPs, exchanges, publishes or provides the exact ads.txt line you need. Copy them exactly as provided.
Step 2: Create a plain text file named ads.txt. Use a basic text editor, not a word processor, so no hidden formatting gets added.
Step 3: Paste in all of your authorized lines. One seller relationship per line, no blank or malformed entries.
Step 4: Upload it to the root of your domain. The file must be reachable at yourdomain.com/ads.txt. Placing it in a subfolder will not work.
Step 5: Verify it loads. Open yourdomain.com/ads.txt in a browser and confirm the content appears as plain text with no errors or redirects.
Step 6: Check your partners' dashboards. Many platforms show a status for whether they can find the expected lines on your domain, which is a quick way to confirm the setup worked.
Common ads.txt Mistakes That Cost Revenue
Forgetting to add a new partner's line. The most frequent mistake. A partner is integrated on the ad server side, but its line never makes it into the file, so its buyers can't bid.
Typos and formatting errors. An extra space, a wrong account ID, or a mistyped domain can make a line invalid, and invalid lines don't authorize anything.
Leaving outdated lines in place. Lines for partners you no longer work with create unnecessary clutter and can authorize sellers you no longer actually use.
Hosting it in the wrong place. Subdomains and subfolders are handled differently from the main domain, and the file must be available at the right location for the domain being checked.
Redirect problems. Misconfigured redirects between versions of a domain can stop crawlers from reading the file correctly.
Never reviewing it. Partner relationships change over time. A file that was correct a year ago may now be missing lines or carrying stale ones.
ads.txt and sellers.json: How They Work Together
ads.txt is hosted by the publisher and says who is allowed to sell the inventory. Its companion, sellers.json, is hosted by the platforms themselves and identifies who each seller account actually is. Buyers can cross check the two to confirm a supply path is legitimate and see exactly who is involved in a transaction, which is a core piece of supply path transparency.
There's also a mobile app version of the file for app inventory, serving the same purpose for app publishers.
Why This Matters Even More for Remnant Inventory
Remnant inventory is routinely routed through fallback networks and resellers layered over time, which is exactly where authorization gaps tend to accumulate. If a fallback partner serving your unfilled impressions isn't properly listed, buyers who verify supply may simply skip that inventory, which quietly lowers fill rate on the layer that can least afford it. Reviewing your file whenever you change how remnant inventory is handled is a simple habit that protects that revenue.
Frequently Asked Questions
Is ads.txt mandatory?
It isn't legally required, but in practice many buyers and platforms treat it as a baseline requirement, and inventory without a valid file can be filtered out or deprioritized, so most publishers consider it essential.
How often should I update my ads.txt file?
Update it whenever you add or remove a demand partner, and review it at least a few times a year to catch outdated or incorrect lines.
Where do I get the correct lines to add?
From each demand partner. They typically provide their exact lines in their publisher dashboard or onboarding documentation, and you should copy them exactly as given.
Can I have too many lines in my file?
A long file isn't a problem on its own, but it should only contain partners you genuinely use. Unused or unknown entries add clutter and can undermine the clean, transparent supply path buyers prefer.
Key Takeaways
- ads.txt is a public text file on your domain listing the companies authorized to sell your ad inventory, designed to fight domain spoofing.
- Each line contains the ad system domain, your account ID, a DIRECT or RESELLER relationship, and an optional certification ID.
- Missing, mistyped, or outdated lines can quietly reduce demand and revenue, most often because a new partner's line was never added.
- Keeping the file current, especially when changing how remnant and fallback inventory is handled, is a quick, low effort way to protect programmatic revenue.