How Ads.txt Works

Ads.txt creates a public record of authorized sellers. Publishers put a text file on their website listing every ad tech company allowed to sell their inventory. Buyers can check this file before purchasing to verify they're buying from legitimate sellers. Combined with IVT Detection, ads.txt helps prevent unauthorized inventory sales and domain spoofing.

The file lives at the root of your domain. If your site is example.com, the ads.txt file should be accessible at example.com/ads.txt. Anyone can view it. That's the point. Transparency prevents fraud.

Each line in the file represents one authorized relationship. You list the ad system domain, your account ID with them, whether they buy directly from you or through resale, and optionally a TAG ID for verification. Simple format, powerful impact.

The Problem Ads.txt Solves

Before ads.txt, fraudsters could easily impersonate legitimate publishers. They'd create fake sites or manipulate bid requests to make it look like they were selling inventory from premium publishers. Advertisers would think they were buying space on CNN or ESPN when they were actually buying from some sketchy domain.

This is called domain spoofing. The fraudster puts a recognizable domain in the bid request but the ad actually serves on their junk site. Advertisers pay premium prices for garbage inventory. The real publisher never sees a cent.

Ads.txt fixes this by giving publishers a way to say "here are the ONLY companies authorized to sell my inventory." If someone claims to sell your inventory but isn't on your ads.txt list, buyers know it's fraud.

Ads.txt File Format

The format is straightforward. Each line contains four fields separated by commas:

domain, publisher_account_id, account_type, tag_id

Field Breakdown

Domain: The ad system's domain. This is usually the SSP, exchange, or ad network domain. For Google AdX, it's google.com. For Pubmatic, it's pubmatic.com.

Publisher Account ID: Your specific account identifier with that ad system. This links you to that platform. Every platform assigns you a unique ID when you sign up.

Account Type: Either DIRECT or RESELLER. Use DIRECT if you have a direct business relationship with the ad system. Use RESELLER if they buy from another seller who has a direct relationship with you.

TAG ID: Optional. This is the ad system's unique identifier from the IAB's seller registry. It helps verify the seller's identity.

Example File

google.com, pub-1234567890123456, DIRECT, f08c47fec0942fa0
pubmatic.com, 123456, RESELLER, 5d62403b186f2ace
rubiconproject.com, 12345, RESELLER, 0bfd66d529a55807
openx.com, 123456789, RESELLER, 6a698e2ec38604c6

Comments start with #. You can add notes to organize your file:

# Direct relationships
google.com, pub-1234567890123456, DIRECT, f08c47fec0942fa0

# Reseller relationships
pubmatic.com, 123456, RESELLER, 5d62403b186f2ace

How to Implement Ads.txt

Implementation is simple but important to get right.

Step 1: Gather Your Relationships

Contact every ad tech partner you work with. Ask for their ads.txt entry. Most will have documentation or can send you the exact line to include. Don't guess. Get the official entry from each partner.

Step 2: Create the File

Open a text editor (not Word, just plain text). Create a new file. Name it ads.txt exactly. Add one line per authorized seller. Save as plain text with UTF-8 encoding.

Step 3: Upload to Root Domain

Upload the file to the root directory of your web server. It needs to be at yourdomain.com/ads.txt, not yourdomain.com/folder/ads.txt. Most publishers put it in their public_html or www directory.

Step 4: Verify

Open a browser and go to yourdomain.com/ads.txt. You should see your file contents. If you get a 404 error or don't see the file, check your upload location.

Step 5: Maintain

Update the file when you add or remove ad partners. If you stop working with an SSP, remove their line. If you add a new partner, get their entry and add it. Keep the file current.

Common Mistake

Many publishers create the file correctly but upload it to the wrong location. It must be at the absolute root of your domain. Not in a subdirectory. Not on a subdomain. Right at yourdomain.com/ads.txt where anyone can access it without navigating anywhere.

Why Publishers Need Ads.txt

Protects Your Brand

Without ads.txt, anyone can claim to sell your inventory. Fraudsters put your domain in bid requests and pocket the money. Your brand appears next to junk content on fake sites. Ads.txt stops this by creating an authoritative source of truth.

Increases Revenue

Many advertisers and DSPs filter out inventory from publishers without ads.txt. They don't want the risk. Having a proper ads.txt file means more buyers will bid on your inventory. More demand means higher prices.

Improves Buyer Confidence

Advertisers want transparency. They want to know they're buying from legitimate sources. Ads.txt provides verification. It shows you're a serious publisher taking fraud prevention seriously. This builds trust and attracts quality buyers.

Industry Standard

Ads.txt is an IAB standard. It's not optional anymore. The programmatic ecosystem expects it. Publishers without ads.txt look suspicious or unprofessional. It's table stakes for selling programmatic inventory.

Advanced Considerations

Subdomains

If you sell inventory on subdomains (like news.yoursite.com), you need ads.txt at the subdomain level too. Put the same file at news.yoursite.com/ads.txt. Or use a redirect from the subdomain to your main domain's ads.txt.

App-ads.txt

For mobile apps, use app-ads.txt. Same format, different filename. Put it on the developer website domain listed in your app store listing. This extends ads.txt protection to mobile app inventory.

Crawling and Updates

Crawlers check ads.txt files regularly (typically daily). Changes you make might take 24-48 hours to propagate through the ecosystem. Update your file before removing partners, not after.

Validation Tools

Several tools check ads.txt files for errors. IAB Tech Lab offers a validator. Google also provides validation in Ad Manager. Use these to catch formatting mistakes or incorrect entries.

🛡️ Beyond Ads.txt: Comprehensive Fraud Prevention

Ads.txt stops domain spoofing, but programmatic fraud goes deeper. Fraudlogix IVT Detection identifies bot traffic, ad stacking, and sophisticated invalid traffic that ads.txt can't catch. Protect your programmatic campaigns with multi-layered fraud prevention.

Frequently Asked Questions

Many advertisers and DSPs will avoid buying your inventory or pay lower prices. You're also vulnerable to domain spoofing where fraudsters impersonate your site. Your brand could appear on fake inventory without you earning any revenue. Most importantly, you miss out on demand from buyers who require ads.txt verification.

Use DIRECT if you signed up directly with the ad tech company and they buy inventory straight from you. Use RESELLER if they buy your inventory through another intermediary. When in doubt, ask the partner which designation to use. They'll tell you the correct one for your relationship.

Update whenever you add or remove ad partners. Review it quarterly to make sure all relationships are current. Remove entries for partners you no longer work with since leaving them in your file means they're still authorized to sell your inventory.

No. There should be exactly one ads.txt file per domain at the root level. If you have subdomains, each needs its own ads.txt file at that subdomain's root. But for any given domain or subdomain, there's only one authoritative ads.txt file.

Ads.txt is maintained by publishers and lists who can sell their inventory. Sellers.json is maintained by ad tech companies and lists all sellers on their platform. They work together to provide supply chain transparency from both sides of the transaction.