← All platform guides

Firebase Hosting

Google's recommended option. Place the file in your public/ directory.

Host app-ads.txt at your root domain

1

Firebase Hosting serves all files in your configured public directory at the root of your domain. Place app-ads.txt in the public/ directory (the default) or wherever your firebase.json configures the public field to point.

2

No firebase.json configuration changes are needed. All files in the public directory are automatically served at the root path.

3

Deploy with:

firebase deploy --only hosting
4

Verify at https://yourdomain.com/app-ads.txt.

Note: Firebase Hosting is Google's own recommended hosting solution for app-ads.txt and has no meaningful limitations for this use case. It is the most reliable option if you are already using Firebase.

Allow the Google-adstxt crawler in robots.txt

1

Place robots.txt in the public/ directory:

User-agent: Google-adstxt
Allow: /app-ads.txt

User-agent: *
Disallow:
2

Deploy and verify at https://yourdomain.com/robots.txt.

Set up a 301 redirect (if needed)

1

If your store listing uses a www subdomain but Firebase Hosting serves the bare domain (or vice versa), add a redirect in firebase.json:

{
  "hosting": {
    "public": "public",
    "redirects": [
      {
        "source": "/app-ads.txt",
        "destination": "https://yourdomain.com/app-ads.txt",
        "type": 301
      }
    ]
  }
}
2

Run firebase deploy --only hosting and verify the redirect.

Done setting up?

Run a free scan to confirm your app-ads.txt is reachable and correctly configured.

Run a free scan

Using a different platform? Browse all platform guides

Firebase Hosting: app-ads.txt setup guide — AppAds Verify