An ads.txt file is a plain-text file you publish at the root of your domain that publicly declares which advertising systems and reseller partners are authorized to sell your ad inventory. Each line is one authorized-seller record made of exactly three required comma-separated fields — the advertising system's canonical domain, your publisher account identifier, and a DIRECT or RESELLER relationship — plus one optional certification authority identifier. The format is defined by the IAB Tech Lab in the Authorized Digital Sellers specification, and ad buyers crawl the public file at https://yourdomain.com/ads.txt before spending on your inventory, so a missing or malformed file can quietly cap your programmatic revenue or let unauthorized resellers profit from it. Because every field has a strict shape and an unverified value is worse than no value, most publishers copy each row directly from the setup instructions their ad platforms already provide. The Ads Txt Generator applies that strict shape for you: it accepts platform-supplied rows, trims and lowercases domains, prevents duplicate declarations, and ends the file with a newline so the result is ready to download and publish.

how to create ads txt file
how to create ads txt file

What Goes Into Each ads.txt Line

Every row in ads.txt is a small but rigid contract. A buyer reading your file expects exactly the field types defined by the IAB Tech Lab, and anything out of place — an extra scheme, a stray space, a typo in the domain — can cause that row to be ignored or misread. The four fields, in order, are:

PositionFieldRequiredExample valueCommon pitfalls
1Advertising system domainYesgoogle.comDo not paste https:// or a path; the field must be a bare lowercase host
2Publisher or seller account IDYespub-1234567890123456Copy the exact value from the platform; do not invent or convert formats
3RelationshipYesDIRECTOnly the two values DIRECT or RESELLER are accepted
4Certification authority IDNof08c47fec0942fa0Leave blank unless the ad platform supplies this exact value for the row

The first field is the canonical domain of the ad system that buyers connect to, not your own website. A value such as google.com is correct; pasting the full URL https://google.com/some/page is not. The second field is the seller or publisher identifier the ad platform assigned to you, and its exact spelling — including any pub- prefix for Google AdSense or a different prefix on another exchange — must match what the platform printed in its setup instructions. The third field is restricted to the two relationship values defined in the spec, and the fourth field is optional, referring to a certification authority like the Trustworthy Accountability Group (TAG). Google's published example includes f08c47fec0942fa0, but that identifier is not portable across exchanges, so leave the field empty unless your specific platform provides the exact string for that row.

Choosing DIRECT vs RESELLER Correctly

The third field decides who is accountable for the inventory. Picking the wrong value can make a perfectly formatted row legally and commercially inaccurate, and ad buyers treat that as a red flag.

RelationshipWhat it meansWhen to use it
DIRECTYou control the seller account listed in the row and contract directly with the ad systemUse when the publisher account is yours and you signed the agreement
RESELLERAnother authorized entity controls the account and is allowed to resell your inventory through that systemUse when a partner, network, or exchange is selling on your behalf

Selling through a header bidding partner or a managed ad network usually means that partner publishes its own row with RESELLER, so buyers see the chain of authorization. Stacking DIRECT for the same partner when the underlying account is theirs is one of the most common sources of inaccurate files. The Ads Txt Generator restricts the third field to these two values, so a stray word like "direct" (lowercase) or "PARTNER" is rejected at entry rather than silently corrupting your file. Remember that selecting the wrong relationship can make the declaration inaccurate even when every character is formatted correctly.

Building the ads.txt File from Authorized Sellers

Each authorized-seller record originates from a real ad platform account, so the goal here is to copy those values into a strict format and validate the result before uploading.

  1. Copy the advertising system domain, publisher account ID, relationship, and optional certification authority ID from the platform's own instructions. Open the setup page each ad network provides to publishers — AdSense, Ad Manager, Ezoic, Mediavine, or whichever exchanges you work with — and copy the exact row they recommend. Do not convert or "normalize" the identifier yourself.
  2. Paste each field into the Ads Txt Generator and add it to the list. Enter the bare domain (no https://, no trailing path), then the publisher ID, then DIRECT or RESELLER, then the optional certification ID if and only if the platform provided it. Submit the row and repeat for every authorized seller.
  3. Review every generated line and remove duplicates or obsolete entries. The generator rejects exact duplicate rows, but it cannot tell that a row is obsolete because a partnership ended. Cross-check each line against your current account list and delete any record that no longer reflects an active relationship.
  4. Download the finished ads.txt file. The output is newline-terminated plain text with one row per seller and no trailing characters that could trip up a crawler. Everything happens in your browser, so account identifiers do not leave your device.
  5. Publish the file at the root domain as /ads.txt. For example.com, the public location must be https://example.com/ads.txt, served as text/plain. Keep a backup of the previous file and compare the change before and after deployment.
  6. Open the public URL in your browser and compare each line with your verified account records. The crawler sees exactly what you see, so any mismatch between the deployed file and your actual accounts is the file's mismatch, not the crawler's.

Publish ads.txt at the Right Root URL

Where the file lives matters as much as what is in it. Buyers fetch ads.txt by appending /ads.txt to the root of the domain that owns the inventory, so for example.com the expected URL is https://example.com/ads.txt. Serving the file from /files/ads.txt, embedding it inside an HTML page, or placing it behind a login will simply mean the buyer finds nothing.

The hosting rules are short but unforgiving:

  • File name must be exactly ads.txt (lowercase).
  • Path must be the domain root, not a subdirectory.
  • MIME type should be text/plain so the file is not parsed as HTML.
  • HTTPS is preferred; mixed-content buyers ignore plain HTTP sources on HTTPS pages.
  • Permissions should allow anonymous GET; basic-auth will block every crawler.

If several advertising systems are authorized, add one verified record for each account rather than overwriting the file. Do not remove existing valid sellers merely to add a new one. The same root-level, plain-text rule applies to robots.txt, so a publisher configuring both files at once can follow a parallel walkthrough in this practical guide to creating a robots.txt file.

Common Pitfalls and How to Avoid Them

Most ads.txt problems are formatting problems. The list below covers the cases the generator is designed to catch, plus a few the generator cannot detect on its own.

  • Schemes and paths in the domain field. A row like https://google.com, pub-…, DIRECT is invalid because the first field must be a bare host. The generator lowercases and validates the domain rather than silently extracting a host from a pasted URL.
  • Trailing root dot or stray whitespace. Some copy-paste routines add a trailing period after the domain or invisible spaces at the end of a line. The generator trims surrounding whitespace and normalizes domain case so these artifacts do not slip through.
  • Commas inside a field. The spec uses commas as field separators, so a comma anywhere inside a field breaks parsing. The generator rejects commas inside any field.
  • Duplicate rows. Repeating the same seller row does not double your authority; it just adds noise. The generator blocks exact duplicate formatted rows.
  • Invented certification authority IDs. The fourth field is optional, and a wrong value is worse than no value. Leave it blank unless your ad platform explicitly provides the exact identifier for that row.
  • Stale resellers. The file format is correct but the partnership is over, so the row misrepresents your current supply chain. Keep a backup of the prior file, compare the change, and remove any seller that no longer matches an active account.
  • Oversized pastes. The generator supports up to 200 records so a mistaken oversized paste cannot produce an unwieldy browser result.

None of these checks replace account-level verification. A syntactically valid but unauthorized or incomplete file can still harm monetization, so review the output against current instructions from each partner before deployment.

Keeping ads.txt Accurate Over Time

An ads.txt file is not a set-and-forget asset. Account migrations, partner changes, and new exchange sign-ups all move the ground under your file, and the buyers reading it assume every row reflects a current, verified relationship.

After you publish the first version, treat it as a recurring checklist. Compare the deployed file with your verified account list on a quarterly cadence, and immediately after any change in your ad stack — adding a new header bidding partner, switching from RESELLER to DIRECT after an acquisition, or offboarding a network. The format is stable across updates and remains defined by the IAB Tech Lab specification, so the workflow does not change: collect the row from the platform, add it through the generator, redeploy to the same /ads.txt URL, and re-verify the public file as plain text. Account or network changes may require future updates, so the final sign-off is always yours against the platform's own instructions rather than against the tool's output alone.