You are currently viewing Stop Ad Fraud in Your App: The Developer’s Guide to App-Ads.txt

Stop Ad Fraud in Your App: The Developer’s Guide to App-Ads.txt

You launch a free mobile game, integrate an ad network, and start seeing a small but steady revenue. A few months later, your fill rate is high but earnings are flat. You check the logs and find that an unauthorized third party is selling your ad inventory to low‑paying buyers and skimming a cut. That's the exact fraud the app‑ads.txt standard stops.

App‑ads.txt extends the ads.txt specification from the Interactive Advertising Bureau (IAB). Ads.txt protects web publishers by declaring authorized ad sellers; app‑ads.txt does the same for mobile apps. It's a plain‑text file hosted on your domain that lists every ad network and intermediary allowed to sell ads in your app. Without it, any ad exchange can claim your inventory, and you might never get paid fully.

Why App Ads.txt Matters for Security and Revenue

Ad fraud in mobile apps costs publishers billions each year. The most common attack is inventory spoofing: a malicious actor creates a fake version of your app or uses your bundle ID to sell ads that don't exist. Ad exchanges can't verify the seller's authority unless you publish a machine‑readable record of who you trust. App‑ads.txt provides that verification layer.

For cybersecurity, implementing app‑ads.txt is basic digital hygiene for any developer who monetizes with ads. No special tools needed — just a text file and a web server. Yet it can prevent the most common ad fraud that targets small and independent developers. If you're learning secure system configuration, this is one of the easiest and most impactful steps you can take.

How App Ads.txt Works

The file sits at the root of your developer domain (for example, ). Each line follows a strict format:

<Ad Network Domain>, <Publisher ID>, <Relationship>, <Certificate Authority ID>

The fields are:

  • Ad Network Domain — the domain of the ad exchange or network you work with (e.g., ads.example.com).
  • Publisher ID — your identifier within that network (often a numeric or alphanumeric string).
  • Relationship — either DIRECT (you have a direct contract with the network) or RESELLER (the network is authorized by a direct partner to resell).
  • Certificate Authority ID — an optional field for future cryptographic verification; most implementations leave it blank or use a dash (-).

When an ad exchange receives a bid request claiming to be from your app, it fetches your app-ads.txt file and checks whether the seller listed in the request matches an entry. If no match is found, the bid is rejected. This simple check eliminates the vast majority of spoofed inventory.

Step‑by‑Step Implementation for Beginners

Follow these steps to add app‑ads.txt to your own app:

  1. Collect your ad network details. Log in to each ad network you use (AdMob, Unity Ads, AppLovin, etc.) and locate your Publisher ID. Write down the network's domain and your ID.
  2. Create the file. Open a plain‑text editor and add one line per network. For example:
    admob.google.com, pub-1234567890123456, DIRECT, f08c47fec0942fa0
    applovin.com, 987654321, DIRECT, -
    The Certificate Authority ID for AdMob is a known value; for other networks you can usually leave it as a dash.
  3. Upload to your domain. Place the file in the root directory of your developer website (not on a subdirectory). Ensure the file is accessible over HTTPS. The URL must be exactly .
  4. Verify. Use a free online validator (such as the one provided by Google Ad Manager) or simply open the URL in a browser and check that the content matches your intended entries.
  5. Keep it updated. Whenever you add or remove an ad network, edit the file immediately. An outdated file can cause legitimate bids to be rejected.

Developer typing ads.txt entries in a code editor with a terminal window open

Common Implementation Mistakes

Even experienced developers make errors. Watch out for these:

  • Wrong domain. The file must be on the domain you registered in the app store (often your company website). If you host it on a subdomain like blog.example.com it will not be found.
  • Missing or incorrect relationship. Using RESELLER when you have a direct contract can lower your revenue share because some exchanges treat resellers as less trustworthy.
  • Trailing spaces or invisible characters. The file is parsed strictly; a trailing space after a line can cause the entire entry to be ignored.
  • Not using HTTPS. Ad exchanges may refuse to fetch the file over HTTP, leading to all bids being rejected.
  • Forgetting to update after switching networks. If you drop an ad network but leave its entry, you could be authorising a defunct partner — or worse, a domain that has been acquired by a malicious actor.

Verifying Your App Ads.txt

After uploading the file, you can manually verify it by visiting the URL. A properly configured file looks like this:

admob.google.com, pub-1234567890123456, DIRECT, f08c47fec0942fa0
unityads.unity3d.com, 1234567, DIRECT, -

You can also use the ads.txt Validator tool from Google Ad Manager (no account required) to check for syntax errors. Simply enter your domain and it will fetch the file and report any issues. For a deeper check, some ad networks provide their own verification endpoints.

Mobile phone screen displaying a successful app-ads.txt validation result

App Ads.txt and Your Learning Path

If you're just starting out in cybersecurity or system configuration, app‑ads.txt is a perfect example of a low-effort, high-impact security control. You need to understand DNS, web servers, and plain‑text formats — all foundational skills. It also teaches you to think like an attacker: fraudsters look for apps without this file because they're easy targets. By implementing it, you close that door.

As you move on to more advanced topics like network diagnostics or vulnerability analysis in controlled labs, remember that the simplest defences often prevent the most common attacks. App‑ads.txt does not stop every form of ad fraud, but it stops the one that hits small developers hardest: inventory spoofing.

Go ahead and check your own app's domain right now by typing into a browser. If you see a blank page or a 404 error, create the file this afternoon. Then set a recurring monthly calendar reminder to review it whenever you add or remove an ad network. That single habit will protect your revenue and your reputation as a developer.