There is a file that decides whether advertisers trust your inventory, it takes five minutes to set up, and a large share of small publishers either have it configured wrong or have never heard of it. It is called ads.txt, AdSense nags you about it with an earnings at risk warning when it is missing, and its purpose is disarmingly simple: it is your public signature list for the ad industry.
This guide gets you from zero to correct without the jargon avalanche. We explain what problem the file solves, decode each field in the line AdSense asks you to publish, show where it must live, and walk through the mistakes that keep the file from doing its job. By the end, your inventory will be verifiable, and the warning in your AdSense account will be gone.
Quick answer:The Problem ads.txt Solves: Counterfeit Inventory
ads.txt specificationThe economics matter more than the definition. When your file is missing, buyers cannot confirm authenticity, so they either skip your inventory or price it defensively. Publishers who add the file often see bid behavior normalize within days, not because anything changed about the site, but because trust signals reached the buyers. It is the closest thing ad monetization has to a free lunch, and the lunch repeats every day the file stays correct.
The name stands for Authorized Digital Sellers, and the format is deliberately boring: one record per line, each a comma-separated set of fields, plus optional comment lines. Boring is the feature, since crawlers must parse millions of these files daily without ambiguity.
Context helps the definition land. The standard emerged because display advertising ran on handshake trust until fraud industrialized, and every major exchange adopted the file as a prerequisite rather than a suggestion. Today the file functions like a shipping manifest: cargo gets inspected against paperwork, and missing paperwork slows everything it touches. Publishers who internalize that framing stop seeing the file as technical homework and start seeing it as business infrastructure, which it plainly is.
The AdSense Line, Field by Field
ads.txt guidance| Field | AdSense value | What it means |
|---|---|---|
| Exchange domain | google.com | The SSP or exchange that sells your inventory |
| Publisher account ID | pub-0000000000000000 | Your unique ID; copy it from the Ads.txt card in AdSense |
| Relationship | DIRECT | Google sells directly for you; RESELLER means via a middleman |
| Certification ID | f08c47fec0942fa0 | Google's fixed trust identifier; keep it exactly as given |
Placement Rules and the Five-Minute Install
Placement is where good intentions die. The crawler requests the file at the root of the exact domain serving ads, so it must answer at example.com/ads.txt with HTTP 200 and a text body. Files in /wp-content, files behind login walls, and files that return a 404 page dressed in HTML all read as missing. The rule has no exceptions worth discovering, so place the file first and check the URL second.
The five-minute install on common stacks:
- Copy your personalized line from the Ads.txt card in AdSense.
- Create a plain text file named ads.txt containing that line.
- Upload it to the web root of your domain, the same folder that serves your homepage.
- Open example.com/ads.txt in a browser and confirm the line renders as plain text.
- Wait for the AdSense card to flip from warning to found, typically within days.
Subdomains and redirects deserve one honest paragraph. A file on www.example.com does not cover inventory declared under example.com unless redirects are configured correctly, and the spec allows subdomains to publish their own files. If your setup is unusual, verify what the crawler actually sees by fetching the URL yourself instead of assuming the platform handles it.
Multi-network files follow the same rules with more lines. Each partner contributes its own record, the file grows downward one seller per line, and order does not matter to parsers. Comment lines starting with a hash document which block belongs to which partner, a courtesy that costs nothing and saves an hour during the next audit. What matters is that every live monetization partner appears exactly once, with exactly the fields the partner published.
One related file completes the family picture: app-ads.txt serves the same purpose for app inventory, and publishers who later launch a mobile application add it at the developer domain. The syntax is identical, so the discipline learned here transfers. Web-first publishers can file the app variant away as a someday note, but the web file itself is today's task and admits no someday, because every day without it is a day of discounted or unverifiable bids.
Caching layers interact with the file in ways that surprise people. If a full-page cache or CDN serves your domain, make sure the ads.txt path itself is excluded from caching or purged on updates, so the crawler always reads the current version. A five-minute TTL is plenty, and the setting lives in every major cache plugin and CDN dashboard. Publishers have lost days to a crawler reading a week-old cached copy of a file they already fixed, and the debugging session always ends at this exact setting.
Mistakes That Keep Earnings at Risk
The file fails in predictable ways, and every failure looks identical from the buy side: your inventory reads as unauthorized. A wrong publisher ID, a truncated certification ID, trailing characters from a word processor, or an upload to the wrong directory all produce the same silent revenue leak.
| Mistake | What happens | The fix |
|---|---|---|
| File at wrong path | Crawler sees 404; earnings at risk stays | Move to domain root, verify the URL |
| Wrong or missing pub- ID | Records do not match your account | Copy the line from AdSense verbatim |
| Edited in Word or Docs | Hidden quotes and smart characters break parsing | Use a plain text editor, save as .txt |
| Stale lines after switching networks | Dead sellers linger, new ones missing | Audit the file whenever your stack changes |
| HTML error page at the URL | Crawler cannot parse content | Serve raw text with 200 status |
One audit habit closes most of these gaps: every time you add, remove, or replace a monetization partner, open your live ads.txt URL and read it. Thirty seconds of reading beats weeks of down-bids, and the habit pairs naturally with the placement reviews in our AdSense placements guide. Attach the check to something you already do monthly, such as the earnings review, and it stops being a task and becomes part of how the site runs.
Verification deserves its own step rather than hope. After publishing, fetch the live URL with curl or a browser in private mode so caches do not flatter you, confirm the exact line renders, and check the HTTP status is 200. If your stack serves the site through a caching layer, purge it after uploading, because a stale 404 can persist at the edge long after the origin is fixed. The AdSense card tells you when Google's crawler agrees, and it is the only opinion that matters.
Why Small Publishers Need It Too
Publishers sometimes ask whether the file matters at small scale, reasoning that counterfeit sellers target big brands. The math says otherwise: fraud tooling does not check your traffic rank before impersonating you, and buyers apply the same verification rules to every impression. A small site with an unverified file simply leaks a smaller absolute amount while losing the same percentage.
Google Auto ads guide best AdSense placements guide RPM vs CPC explainer AdSense approval checklist for new sitesHow buyers actually consume the file closes the loop. Automated bidding systems fetch ads.txt paths before auctions, build authorized-seller lists, and discard or downprice offers from sellers absent from those lists. That machinery runs at industry scale every day without announcing itself, which is why the file's effect feels invisible when correct and catastrophic when wrong. Visibility belongs to the absence: the warning card in AdSense, the softening bid curve, the revenue that never arrives.
The whole subject fits in a closing paragraph. ads.txt is a five-minute task with month-long consequences: publish the exact line your network gives you, at the domain root, in plain text, and reread the file whenever your ad stack changes. Buyers reward verified inventory with real bids, the warning in your dashboard disappears, and the one industry-standard signature you control starts working for every impression you sell.

