Host app-ads.txt at your root domain
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.
No firebase.json configuration changes are needed. All files in the public directory are automatically served at the root path.
Deploy with:
firebase deploy --only hosting
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
Place robots.txt in the public/ directory:
User-agent: Google-adstxt Allow: /app-ads.txt User-agent: * Disallow:
Deploy and verify at https://yourdomain.com/robots.txt.
Set up a 301 redirect (if needed)
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
}
]
}
}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.
Using a different platform? Browse all platform guides