The short version of ads.txt for game websites: it is a plain text file at /ads.txt on your root domain. Each line names one company that may sell ad space on your pages, and the account it sells through. Buyers and ad networks read it before they trust a request that claims to come from your site. If your games play in a browser, this is the file you need. Most of what comes up when you search for ads.txt and games is about app-ads.txt, which is a different file for a different kind of publisher.
Everything below comes from the IAB Tech Lab's ads.txt 1.1 specification, the final version released in July 2022, plus what PuzzleMoss does with it. Where a network has its own rules, it says so.
ads.txt or app-ads.txt?
The search results for this question are crowded with mobile game documentation from companies such as Unity and Yodo1. That advice is correct for apps. A mobile game is sold through an app store, so the store listing names a developer website, and the app-ads.txt file sits at the root of that site. The specification itself draws the line: ads.txt protects inventory on the website that publishes the file, and anything distributed through app stores, including connected TV stores, should use the companion app-ads.txt standard.
A site of embedded HTML5 games has no store listing. Visitors arrive at your domain, the page they read is yours, and any ad slot you add to that page is web inventory. You need ads.txt. You would need app-ads.txt only if you also published your own game in an app store.
What one line means
The specification's simplest example is a single line:
greenadexchange.com, XF7342, DIRECT, 5jyxf8k54
Field one is the domain of the advertising system, the exchange or network that bidders connect to. Field two is your account ID inside that system. It must match the ID the system puts in its bid requests, which is why you copy it rather than type it. Field three is the relationship. DIRECT means you control that account yourself, usually through a contract with the network. RESELLER means you have let someone else sell your space through their own account on that system. Field four is optional: an ID with the Trustworthy Accountability Group, which the specification says may be dropped in a future version.
Anything after a # is a comment. Whitespace between fields is ignored, so neat alignment is fine. Lines of the form NAME=value are variables, and five are official. CONTACT is a way to reach whoever runs the file. OWNERDOMAIN names the business that owns the site, and the specification recommends including it even when it is the same domain as the site itself. MANAGERDOMAIN is for a publisher who hands all its ad sales to one outside company. SUBDOMAIN and INVENTORYPARTNERDOMAIN cover arrangements a small game site is unlikely to have.
Do not write account lines from memory or from a blog post, this one included. The specification tells publishers to take the domain and ID from each network's own documentation, and in practice every network shows the exact lines in its dashboard. Paste them as they are.
Where the file has to live
The file goes at https://yourdomain.com/ads.txt, on the root domain. The specification defines that as the public suffix plus one label, so for games.example.co.uk the root is example.co.uk. Crawlers strip subdomains before they fetch the file. A subdomain can have its own file, but only if the root domain's file points to it with a SUBDOMAIN line.
That rule has a practical consequence for game sites. GameMonetize's guide for publishers seeing zero ad impressions says the file must be on the root domain, and that it does not accept sites on subdomains, including free ones on blogspot.com or wordpress.com. If your game site lives on someone else's domain, you cannot place a file at their root, and the review stops there. A domain of your own is the entry fee.
Redirects are allowed within limits. A crawler should follow a 301, 302 or 307 as long as it stays inside the same root domain, so an HTTP to HTTPS hop is fine, and so is the one PuzzleMoss uses from www.puzzlemoss.com to the bare domain. One hop to a different domain is also allowed, to let a third party host the file. A second hop after that is treated as an error.
The static hosting traps
Most game sites built today are static: a build step writes HTML files and a host serves them. That makes ads.txt easy to publish and easy to get subtly wrong. The specification requires the response to be sent as text/plain and says any other content type should be treated as an error, with the contents ignored. Three things go wrong on static hosts.
The first is a single-page-app fallback. Some hosts can be set to answer any unknown path with the home page and a 200 status, so a missing /ads.txt comes back as your homepage in HTML. To a person checking in a browser, something loaded. To a crawler, the file is broken. PuzzleMoss's host is set to return its 404 page for unknown paths, so a missing file shows up as missing.
The second is a trailing-slash rule. PuzzleMoss uses trailing slashes on every page, and a rule that adds one to every path would send crawlers to /ads.txt/. Check whether your host's rule touches files that are not HTML.
The third is the file never reaching the build output. In a Next.js static export, anything in public/ is copied to the root of the build, so public/ads.txt works. PuzzleMoss does it differently: the lines live in its site config, and a script writes out/ads.txt after next build, only when an ad stack is switched on. The same script fails the build if an ads.txt turns up while ads are off, so the site cannot claim sellers it does not have.
One command checks all three:
curl -sI https://yourdomain.com/ads.txt
You want a 200 status, a content-type starting with text/plain, and no redirect to a path ending in a slash. Then fetch it without -I and read the lines against your dashboard.
What embedded games do not change
A game embedded from a distributor plays inside an iframe served from the distributor's own domain. On PuzzleMoss every game's embed URL points at html5.gamemonetize.co, and the games carry their developers' own ads, which should never be stripped out. Your ads.txt does not describe those frames. It describes inventory on your domain: the ad slots on your own pages, plus any lines your distributor's dashboard asks you to add. GameMonetize's guide ties missing impressions to a missing or misplaced file, so if you earn from the games, treat the file as part of the setup rather than an extra.
So a page for a sorting game such as Fruit Shelf Sort can involve two sets of ads with different rules: the in-game ads inside the frame, and any slots around it that your own file has to cover. The guide to adding GameMonetize games to your website covers the embed side, including loading the frame only on click.
If you run no ads yet
The specification is blunt about a missing file. If /ads.txt returns a 404, a crawler can assume there are no declarations and that no advertising system is unauthorised. In other words, anyone may claim to sell your space. If you want to say that nobody is authorised, the specification has a placeholder record for exactly that:
placeholder.example.com, placeholder, DIRECT, placeholder
An empty file used to mean the same thing, but that method was deprecated, and consuming systems were told to ignore it after 1 March 2020. Use the placeholder line or nothing.
PuzzleMoss runs no ads at launch and currently publishes no ads.txt, which is the 404 case above. That is a fair trade for a site whose pages have no ad slots to spoof, but it is a choice, not a default to copy without thinking.
Give it a week
Crawlers cache the file. The specification says they should honour normal HTTP cache headers, and that without any they should treat a copy as fresh for 7 days. A fix you make today may not be seen for a week, and a network can review your site against the old version in the meantime. Put the file up, check it with curl, and then submit the site, not the other way round.
The file is the smallest part of getting a site approved. Networks also judge the pages themselves, and whether each one says something of its own. On PuzzleMoss that means 250 words written about each game, from a mahjong solitaire page to a sudoku or number puzzle. The story of how the site was built explains where that rule came from. ads.txt is the ten-minute job that stops the rest of the work being wasted.