Başar BallıözProduct Engineer
← All posts

What is app-ads.txt, and how do you set it up for AdMob?

If your app shows AdMob ads, sooner or later the dashboard will warn you about app-ads.txt. It is a one-line file, but in the wrong place it puts your revenue at risk. Here is what I learned preparing it on ballioz.com for Tibblo.

By Başar Ballıöz · · 3 min read

What app-ads.txt is

app-ads.txt (Authorized Sellers for Apps) is an initiative of the IAB Tech Lab, the ad industry's standards body. It is the app version of the ads.txt file websites use. The goal is simple: make sure your app's ad inventory is only sold through channels you have authorized, and make it harder to sell counterfeit inventory to advertisers.

It is a plain text file at the root of your developer website, with lines that say "this ad network may sell my app's ads, under this publisher account".

Why it matters

When AdMob cannot find the file, or finds a problem in it, it flags the app; for a file with issues the dashboard says your revenue is at risk. Your app keeps working without it, but you may lose ad revenue. Setup takes five minutes, so it is not worth skipping.

Where exactly the file goes

This is where most mistakes happen. AdMob does not find the file from your app; it finds it from the developer website in your store listing:

  • Google Play: the website in your store listing contact details in Play Console.
  • App Store: the app's marketing URL.

AdMob only looks at the host name of that address and expects the file at the root. For example:

  • If the listing says https://example.com/game, AdMob checks https://example.com/app-ads.txt, then http://example.com/app-ads.txt.
  • If it says http://help.example.com/game, it tries help.example.com first, then example.com. It goes only one subdomain level deep, and www. and m. are treated separately.
  • Redirects are fine: the root may redirect to www, a CDN or another path.

Tibblo's pages live on ballioz.com, so its file sits at ballioz.com/app-ads.txt.

How to write the line

For AdMob one line is enough. It looks like this:

google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0

  • google.com: the ad system's domain. Writing admob.com is a common mistake.
  • pub-…: your AdMob publisher ID. Replace the zeros with your own.
  • DIRECT: you control the account directly.
  • The last field: Google's certification authority ID.

The safest route is not to type it at all: in AdMob, go to Apps → View all apps → app-ads.txt and copy the line made for your account from "How to set up app-ads.txt". If you use other ad networks or mediation, add their lines below it.

Setup, step by step

  1. Make sure your store listing has a developer website.
  2. Copy your personal line from AdMob.
  3. Put a file called app-ads.txt at the root of the site and paste the line.
  4. Check that it opens as plain text in a browser. ballioz.com runs on Vercel, so I gave the file a text/plain; charset=utf-8 header in vercel.json.
  5. Make sure robots.txt does not block it. AdMob's crawler follows the Google-adstxt, Mediapartners-Google and Googlebot rules.
  6. In AdMob's app-ads.txt page, expand the app's row and use "Check for updates" to ask for a new crawl.

According to AdMob, crawling and verifying the file can take up to 24 hours, and so can noticing a changed website in the store listing. A green mark means found and verified, grey means no file was found, and red means there is an issue with the file.

The most common mistakes

  • No website in the store listing, or an invalid one.
  • File in the wrong place: in a subfolder instead of the root, or on an unsupported subdomain.
  • Missing or wrong publisher ID, or a typo in it.
  • Writing admob.com instead of google.com.
  • robots.txt blocking the crawler. If needed, add User-agent: Google-adstxt followed by an empty Disallow:.
  • Shipping the placeholder. A file with an example ID full of zeros does nothing. The job is not done until the real ID is in.

A short checklist

  1. The store listing has a developer website.
  2. https://yourdomain/app-ads.txt opens as plain text.
  3. The line was copied from AdMob and contains your real publisher ID.
  4. robots.txt does not block it.
  5. You asked AdMob for a new crawl and the status turned green within 24 hours.

Official source: AdMob Help – Set up an app-ads.txt file. Menu names change over time; if you get stuck, follow the current steps there.

More posts

Godot on iOS: from an uneven 60 fps to 120 Hz with MetalA Godot 4 game stuck near 60 fps on an iPhone 14 Pro with a main thread busy only 4 ms a frame. How a phone bench and Instruments found the cause, and how switching iOS to Metal gave 119 fps. Quest pacing: measuring where a 150-level game goes flatHow I measured the story pacing of Tibblo's 763-day road from level 1 to 150, found where it went flat after level 40, and fixed it with three-step arcs, a daily limit and a 'Last time…' card.