TMOD LogoTMOD

ads.txt checker

Checks that /ads.txt exists, contains valid records, and authorizes google.com.

What TMOD checks

  • Fetches /ads.txt from your domain root and confirms it returns HTTP 200 with a non-empty body.
  • Rejects the common failure where a missing file is served as an HTML 404 page with a 200 status, we check the first 200 bytes for an <html> or <!doctype> marker and treat that as absent.
  • Parses the body line by line, stripping everything after a # comment, and counts a line as a valid record only if it has at least three comma-separated fields.
  • Looks for a record authorizing google.com with a publisher ID, matching a google.com field followed by a pub- prefixed number.
What TMOD looks for in ads.txt, one line at /ads.txt, read field by field. /ads.txt reachable, served as text: Required. google.com named as the ad system: Required. A publisher ID in the pub-0000000000000000 shape: Required. DIRECT or RESELLER on every record: Required. Served as HTML, or a 404: Fails.

Why it matters

ads.txt is how you tell the advertising ecosystem which companies are allowed to sell inventory on your domain. Without it, anyone can claim to represent your site in a programmatic auction, and buyers have no way to verify the claim. That fraud is the problem the standard exists to solve.

For a site applying to AdSense, ads.txt is not a requirement for approval, you do not need one to be accepted, and its absence is a warning here rather than a failure. It becomes important the moment you are approved: without the correct google.com line, Google will report that your inventory is unauthorized and your ads can stop serving.

The most common real-world failure is not a missing file but a broken one. A file served from the wrong path, a file with smart quotes pasted in from a document, or a file where every line lost its commas parses to zero valid records, which is functionally identical to having no file at all while looking fine in a browser.

How to fix it

01Put the file at the domain root

It must be served at https://yourdomain.com/ads.txt exactly. Not in a subdirectory, not on a subdomain, not behind a redirect chain. Subdomains need their own file if they serve ads independently.

02Use the exact record format

Each line is: domain, publisher ID, relationship, certification authority ID. For AdSense the line is `google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0` with your own publisher ID substituted. That last field is Google's certification authority ID and is the same for everyone.

03Serve it as plain text

Content-Type should be text/plain. Some CMSs will happily serve a page at that path wrapped in a full HTML template, which no parser accepts. Fetch it with curl rather than a browser to see what is actually returned.

04Add the line only once you have a publisher ID

Before approval you do not have one, and there is nothing useful to put in the file. This check reports its absence as a warning precisely because it is not something to fix before applying.

Where the file sits in the advertising supply chain

ads.txt is one half of a pair. You publish it to declare which companies may sell inventory on your domain. The ad platforms publish sellers.json to declare which publishers they represent. A buyer reads both, follows the supply chain attached to the bid, and confirms that the path from your domain to the seller offering the impression is one both ends agree on. Where the two do not agree, the bid is dropped.

This is why the states are asymmetric in a way that surprises people. No file at all leaves your inventory unverified, which most buyers still tolerate. A file that exists but omits a partner you genuinely work with actively blocks that partner, because you have now made a positive declaration and they are not in it. The second state is the one that costs money, and it is usually reached by adding a second network and forgetting the file.

It is checked in the technical audit for the same reason as robots.txt and the sitemap: a plain text file at a fixed path that any machine can read and that quietly stops working when nobody is watching it. Search engines do not read it and it has no bearing on rankings.

How to read a line of ads.txt. One record, four comma-separated fields. google.com,: The ad system's domain. pub-0000000000000000,: Your publisher ID. DIRECT,: You hold the account. RESELLER,: A third party sells on your behalf. f08c47fec0942fa0: Certification authority ID.

After approval, when the file starts to matter

Once you are serving ads, the failure announces itself in your AdSense account rather than on your site. The wording is an earnings-at-risk or unauthorized-inventory notice, and it means Google fetched your file and did not find a line naming itself with your publisher ID. Pages keep loading, the ads simply stop filling.

Changes are not instant. Crawlers re-fetch the file on their own schedule, so allow a day or two after an edit before deciding it did not work, and confirm the new file is actually being served rather than a cached copy from a CDN that still has the old one.

Keep it current when your setup changes. Adding a network means adding its line, leaving one means removing it, and working through an ad management partner usually means their lines rather than yours, with your own DIRECT line kept alongside. An old line for a company you no longer work with is not dangerous, it is just an authorisation you have left standing for no reason.

Debugging a file that looks fine in the browser

Here is a four-line file of the kind this check fails every day. Line one reads google.com, pub-4739284712047392, DIRECT, f08c47fec0942fa0 and is a valid record. Line two is the same record pasted from a word processor, where the quotes turned curly and the commas became a lookalike character from another alphabet. Line three reads partner-network.com pub-88231 RESELLER, with the commas simply missing. Line four is a comment starting with # that explains line three. In a browser all four look equally tidy. To a parser, line one is the only record that exists, so the partner on line three is not authorized and does not know it.

The way to see what a machine sees is to stop using the browser. Fetch the file with curl and read the raw response: the status code, the Content-Type header, and the first bytes of the body. A surprising number of sites return their 404 page at that path with a 200 status, or serve the file wrapped in the site template because the CMS treated /ads.txt as a pretty URL. Both count as no file, and neither is visible from the editor where the content was typed.

The organisational version of the failure is quieter. A site starts with AdSense, one line, correct. A year later it adds a video player that brings its own advertising demand, then joins an ad management service. Each of those partners publishes the exact lines they need, usually a dozen or more, and the moment they go live without those lines in your file, their auctions are the ones being dropped. The file was right on the day it was written and wrong by accretion, which is why it belongs on the same review-after-every-change list as robots.txt.

Two placement details finish the job. Subdomains that serve their own ads need their own file, because a buyer checking blog.example.com does not read example.com/ads.txt unless a subdomain declaration points there. And a CDN can cache the old copy long after you deployed the new one, so after any edit, fetch the live URL from outside and confirm you are reading the version you think you shipped, the same habit the technical audit applies to every plain-text file it checks.

Questions

Do I need ads.txt to get approved for AdSense?

No. Approval does not depend on it, which is why this check reports a missing file as a warning rather than a failure. It matters after approval: once you have a publisher ID, the google.com line is what authorizes Google to sell your inventory, and without it you will see unauthorized-inventory warnings in your AdSense account and reduced or halted ad serving.

What does DIRECT mean, and when would I use RESELLER?

DIRECT means you have a direct contractual relationship with that advertising system, which is the case for AdSense, since you contract with Google. RESELLER means the named company is authorized to resell your inventory on your behalf, which applies when you work through an ad management partner. If you only run AdSense, every line you need is DIRECT.

My ads.txt is there but the checker says it has no valid records.

That means the file returned content but no line survived parsing. Each record needs at least three comma-separated fields after comments are stripped. The usual causes are a file pasted from a word processor where commas or quotes were auto-formatted into different characters, a file where every entry ended up on one line, or a file that is actually an HTML error page.

Does having ads.txt help my SEO?

No. It has no effect on search rankings whatsoever, it is an advertising supply-chain file that only ad buyers read. It appears in this technical audit because it is machine-checkable from the outside and matters to the same people, not because search engines care about it.

What is app-ads.txt, and do I need that too?

The same standard extended to mobile and connected-TV apps: the developer publishes app-ads.txt on the domain listed in their app-store entry, and buyers verify app inventory against it. If you only run a website, it does not apply to you, and having a website ads.txt does nothing for an app. If you run both, each needs its own file, and they can happily live on the same domain.

Read more

This check also runs inside the technical SEO audit

Run it here on its own, or run the full audit to see this check scored alongside everything else that decides approval.

Open it