How to Fix AdMob App-ads.txt Verification with GitHub Pages and Firebase Hosting

If you have an Android app published on Google Play and you are trying to verify it in Google AdMob, one of the most confusing issues you may encounter is the app-ads.txt verification problem.

You may have already created the correct app-ads.txt file. You may even be able to open that file successfully in your browser. Yet AdMob can still report:

“You may have set up an app-ads.txt file, but your details don’t match the information in your AdMob account.”

I recently worked through this exact problem with an Android application, Germany Jabo, and the important lesson was that having the file accessible is not enough—the file must be accessible from the correct root hostname that AdMob crawls.

This article explains the complete solution.


What is app-ads.txt?

app-ads.txt is an IAB Tech Lab standard that helps app developers identify which advertising platforms are authorized to sell advertising inventory for their apps.

For AdMob, the file contains a publisher record such as:

google.com, pub-2296246438593583, DIRECT, f08c47fec0942fa0

The important parts are:

  • google.com — advertising system
  • pub-2296246438593583 — AdMob publisher ID
  • DIRECT — direct relationship
  • f08c47fec0942fa0 — Google’s certification/authority ID

The exact line must come from your own AdMob account. Do not copy another developer’s publisher ID.


The Problem I Encountered

My Android app was already connected to AdMob.

The AdMob app settings showed the application, but verification failed.

AdMob displayed a message indicating that an app-ads.txt file might exist, but the details did not match.

Initially, everything appeared correct.

The app-ads.txt file existed in my GitHub repository:

GermanyJaboWeb/
├── index.html
├── privacy-policy.html
├── account-deletion.html
├── app-ads.txt
├── assets/
├── css/
├── js/
└── ...

The GitHub Pages URL was:

https://sushen.github.io/GermanyJaboWeb/app-ads.txt

And opening that URL in a browser displayed the correct line:

google.com, pub-2296246438593583, DIRECT, f08c47fec0942fa0

So it looked like everything should work.

But AdMob still couldn’t verify the application.


The Important Discovery

The critical test was to check the root hostname, rather than the GitHub project path.

The Google Play developer website was originally:

https://sushen.github.io/GermanyJaboWeb/

A common assumption is that AdMob will look here:

https://sushen.github.io/GermanyJaboWeb/app-ads.txt

But that isn’t how the crawler determines the location.

AdMob uses the hostname from the developer website.

In this case, the hostname is:

sushen.github.io

Therefore, the root location becomes:

https://sushen.github.io/app-ads.txt

I tested that location from the terminal:

curl -I https://sushen.github.io/app-ads.txt

The result was:

HTTP/1.1 404 Not Found

That explained the problem.

The file existed here:

https://sushen.github.io/GermanyJaboWeb/app-ads.txt

but AdMob was looking at:

https://sushen.github.io/app-ads.txt

The difference is crucial.


Why GitHub Pages Project Sites Can Cause This Problem

GitHub Pages supports project websites using a URL structure such as:

https://username.github.io/project-name/

For example:

https://sushen.github.io/GermanyJaboWeb/

The project files are located underneath:

/GermanyJaboWeb/

Therefore:

/GermanyJaboWeb/app-ads.txt

is valid for the GitHub Pages website.

However, the root hostname:

https://sushen.github.io/

is a different location.

So:

https://sushen.github.io/GermanyJaboWeb/app-ads.txt

being available does not mean:

https://sushen.github.io/app-ads.txt

is available.

This was the key to solving the verification problem.


The Solution: Firebase Hosting

Instead of trying to restructure the entire GitHub Pages website, I used Firebase Hosting specifically for app-ads.txt.

The existing GitHub Pages website could remain untouched.

The Firebase project was:

germanyjabo

Firebase provides a free Hosting domain:

https://germanyjabo.web.app/

This gives us a clean root hostname.

The required file can therefore be served from:

https://germanyjabo.web.app/app-ads.txt

This is exactly the structure we need.


Step 1 — Create a Dedicated Firebase Hosting Directory

Inside the existing GitHub repository, I created:

firebase-hosting

Then copied the existing app-ads.txt file into it:

mkdir firebase-hosting
copy app-ads.txt firebase-hosting\app-ads.txt

The resulting structure was:

GermanyJaboWeb/
├── app-ads.txt
├── index.html
├── privacy-policy.html
├── assets/
├── css/
├── js/
└── firebase-hosting/
└── app-ads.txt

Using a dedicated directory is useful because Firebase Hosting doesn’t need to deploy the entire GitHub website.


Step 2 — Initialize Firebase Hosting

From the repository directory, I ran:

firebase init hosting

Firebase asked for the Firebase project.

I selected:

Use an existing project

and selected:

germanyjabo

For the public directory, I entered:

firebase-hosting

For the single-page application question, I selected:

No

For GitHub automatic deployment, I selected:

No

And Firebase also asked about installing Firebase Agent Skills, where I selected:

No

The important configuration became:

{
"hosting": {
"public": "firebase-hosting",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
]
}
}

The Firebase project configuration was:

{
"projects": {
"default": "germanyjabo"
}
}

This confirmed that Firebase was pointing specifically to:

firebase-hosting

rather than the entire repository.


Step 3 — Deploy to Firebase

I then deployed the Hosting site with:

firebase deploy --only hosting

Firebase successfully deployed the site and returned:

Deploy complete!

The Hosting URL was:

https://germanyjabo.web.app

Step 4 — Test app-ads.txt

This is an important step.

Before changing anything in AdMob or Google Play, test the actual file.

First:

curl -I https://germanyjabo.web.app/app-ads.txt

The result was:

HTTP/1.1 200 OK

This is what we want.

Then I tested the actual contents:

curl https://germanyjabo.web.app/app-ads.txt

The response was:

google.com, pub-2296246438593583, DIRECT, f08c47fec0942fa0

Everything was correct.

We had therefore established three important facts:

  1. The hostname exists.
  2. app-ads.txt returns HTTP 200 OK.
  3. The contents contain the correct AdMob publisher record.

Step 5 — Change the Google Play Developer Website

This is the step that connects everything together.

The Google Play developer website originally pointed to:

https://sushen.github.io/GermanyJaboWeb/

I changed it to:

https://germanyjabo.web.app/

In Google Play Console, the location is:

Grow users → Store presence → Store settings → Store listing contact details

Then edit the Website field.

The final value should be:

https://germanyjabo.web.app/

After saving, the Google Play listing now identifies the Firebase root hostname as the developer website.


The Final Architecture

The resulting setup looks like this:

                Google Play
                     │
                     │ Developer Website
                     ▼
        https://germanyjabo.web.app/
                     │
                     │
                     ▼
        /app-ads.txt
                     │
                     ▼
google.com, pub-2296246438593583,
DIRECT, f08c47fec0942fa0
                     │
                     ▼
                  AdMob

Meanwhile, the original website can continue to exist independently:

GitHub Pages
https://sushen.github.io/GermanyJaboWeb/

There is no need to delete the GitHub Pages website.


Why This Works

The important distinction is between a URL path and a hostname.

This:

https://sushen.github.io/GermanyJaboWeb/app-ads.txt

contains:

Hostname:
sushen.github.io
Path:
/GermanyJaboWeb/app-ads.txt

But this:

https://germanyjabo.web.app/app-ads.txt

contains:

Hostname:
germanyjabo.web.app
Path:
/app-ads.txt

The second configuration places app-ads.txt directly at the root of the developer website hostname.

That is the important requirement for AdMob crawling.


Don’t Forget the Waiting Period

Changing the developer website does not necessarily make AdMob verify the application immediately.

Google’s AdMob documentation notes that changes to the developer website can take time to be detected.

Therefore, after changing the Google Play website:

Don’t repeatedly click “Check for updates.”

Give Google’s systems time to process the new website.

After the propagation period, return to AdMob and check the app-ads.txt status again.


Common Mistakes

Mistake 1: Putting the file only in the GitHub repository

Having:

app-ads.txt

in your GitHub repository does not automatically mean AdMob can crawl it.

The important question is:

What exact URL does the public website expose?


Mistake 2: Testing only the browser URL

A browser test such as:

https://sushen.github.io/GermanyJaboWeb/app-ads.txt

may show the correct file.

But you should also test the root hostname:

https://sushen.github.io/app-ads.txt

A simple command is:

curl -I https://sushen.github.io/app-ads.txt

If you get:

404 Not Found

you have found the problem.


Mistake 3: Deploying the entire website unnecessarily

You don’t necessarily need to move your whole website to Firebase.

A dedicated Hosting directory can contain just:

firebase-hosting/
└── app-ads.txt

This keeps the AdMob verification infrastructure separate from the main website.


Mistake 4: Using the wrong publisher ID

The app-ads.txt record must come from your AdMob account.

For example:

google.com, pub-2296246438593583, DIRECT, f08c47fec0942fa0

Do not modify the publisher ID or certification ID manually.


A Simple Troubleshooting Checklist

If AdMob still doesn’t verify your app, check these items one by one.

1. Is the developer website correct?

https://germanyjabo.web.app/

2. Does the root app-ads.txt URL exist?

https://germanyjabo.web.app/app-ads.txt

3. Does it return HTTP 200?

curl -I https://germanyjabo.web.app/app-ads.txt

Expected:

HTTP/1.1 200 OK

4. Is the publisher record correct?

google.com, pub-2296246438593583, DIRECT, f08c47fec0942fa0

5. Is the app package connected to the correct AdMob app?

Verify the Android package name in AdMob and Google Play.

6. Has Google had enough time to crawl the new website?

Don’t expect an immediate verification result after changing the developer website.


Conclusion

The biggest lesson from this troubleshooting process is simple:

An app-ads.txt file being available somewhere on your website is not necessarily enough. It must be available at the root of the hostname that AdMob uses for crawling.

For a GitHub Pages project site such as:

https://sushen.github.io/GermanyJaboWeb/

the project-path location:

https://sushen.github.io/GermanyJaboWeb/app-ads.txt

can exist while the root location:

https://sushen.github.io/app-ads.txt

does not.

Using Firebase Hosting provides a clean root hostname:

https://germanyjabo.web.app/

and allows app-ads.txt to be served directly from:

https://germanyjabo.web.app/app-ads.txt

Once the Google Play developer website points to that hostname, the AdMob crawler has a proper root-domain location to check.

The practical workflow is:

Create app-ads.txt
Put it at the root of a crawlable hostname
Verify HTTP 200
Verify publisher record
Set Google Play developer website to that hostname
Wait for Google to crawl the change
Check AdMob verification

This approach keeps the main GitHub Pages website intact while providing a clean, dedicated endpoint for AdMob’s app-ads.txt verification.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.