If you are trying to monetize your mobile game using Google AdMob, you will eventually be asked to verify your app using an app-ads.txt file. This file helps prevent ad fraud and ensures that only authorized sellers are selling your app's ad inventory.
While it sounds technical, setting it up is completely free and relatively simple. You just need to host a single text file online and link it to your app.
Here is the step-by-step guide to creating, hosting, and verifying your app-ads.txt file using GitHub Pages.
Before you do anything else, you need the specific code that belongs to your AdMob account.
Log in to your Google AdMob console.
Navigate to your app and go to the app-ads.txt tab.
You will see a specific line of code provided by Google. It will look something like this:
google.com, pub-XXXXXXXXXXXXXXX, DIRECT, f08c47fec0942fa0
Copy this exact line of text. You will need it in Step 3.
For Google's crawler to find your file, it must be hosted at the root of your domain. GitHub Pages is a free and reliable way to do this.
Note: You will need a free GitHub account for this.
Log in to GitHub and click New repository.
The Crucial Step: In the "Repository name" field, you must enter your exact GitHub username followed by .github.io.
Example: If your username is MyGameStudio, you must name the repository mygamestudio.github.io.
Do not add any slashes or extra words. This specific naming format tells GitHub to publish your site from the root domain.
Choose Public visibility and click Create repository.
Now you need to create the actual file inside your new repository.
On your empty repository page, click the Add file button and select Create new file.
In the filename box, type exactly: app-ads.txt
In the large text editor area, paste the code you copied from AdMob in Step 1.
Scroll down and click the green Commit new file button.
Your file is uploaded, but you need to tell GitHub to publish it as a website.
On your repository page, click the Settings tab.
In the left sidebar, click Pages.
Under the Build and deployment section, ensure the Source is set to Deploy from a branch.
Under Branch, select main from the dropdown, keep the folder as / (root), and click Save.
Wait a minute or two for GitHub to build the site.
If you navigate to your main website URL (e.g., https://mygamestudio.github.io/), you will likely see a 404 "File not found" error page.
This is completely normal and does not mean your setup is broken.
GitHub is looking for a homepage (an index.html file) to display. Because you only uploaded a text file, it doesn't know what to show. However, Google's AdMob crawler does not care about your homepage. It is only looking for the app-ads.txt file.
How to verify your file is working:
Go to your browser and type your URL, but add /app-ads.txt to the very end:
https://mygamestudio.github.io/app-ads.txt
If you see your single line of AdMob code displayed on the screen, congratulations! Your file is live and accessible to Google.
Finally, you need to tell Google where to find this file.
Google Play Console: Go to your app's Store settings. Under "Store listing contact details," find the Website field. Enter your root domain exactly like this: https://mygamestudio.github.io/ (Do not include the /app-ads.txt part here). Save and publish your changes.
AdMob Console: Go back to your AdMob app-ads.txt page and click the "Check for updates" button.
Google's crawlers are not instantaneous. After clicking "Check for updates," it can take anywhere from a few hours up to 24 hours for Google to scan your website and verify the file. As long as the direct link to your app-ads.txt loads correctly in your browser, you have done everything right. Just check back the next day!
Partner with Impulse Response Enterprises Ltd
Impulse Response Enterprises Ltd, is a technology-oriented economic research organization. We are up to the times; technology has a strong place with policy. We do economic research, econometric and mathematical analysis, strategic plans, action plans, and economic evaluations. We build machine learning models for economic analysis, develop websites and React Native apps, and create games in Unreal Engine 5 and Godot.
👉 Contact us today at impulseresponseenterprisesltd@gmail.com or visit www.impulseresponseenterprises.cc to schedule your consultation and start your journey toward digital excellence!