Google AdSense ads.txt Configuration for Subdomains on Same Hosting
This knowledge base article explains how ads.txt works with subdomains in Google AdSense, specifically when the subdomain is hosted on the same server and ma...
This knowledge base article explains how ads.txt works with subdomains in Google AdSense, specifically when the subdomain is hosted on the same server and mapped to a folder (custom PHP or similar stack).
The document covers:
-
ads.txt discovery behavior
-
Subdomain authorization rules
-
Correct configuration patterns
-
Verification and troubleshooting
-
Security and compliance considerations
This applies to production websites already serving ads and administrators validating revenue eligibility.
Product / System Overview
-
Product: Google AdSense
-
Standard: ads.txt (Authorized Digital Sellers – IAB)
-
Environment:
-
Apache / Nginx
-
Custom PHP applications
-
Same hosting, folder-mapped subdomains
-
ads.txt and Subdomain Architecture
ads.txt Discovery Rules
Google AdSense uses the following logic:
| Requesting Domain | ads.txt Lookup Location |
|---|---|
example.com | https://example.com/ads.txt |
sub.example.com | https://example.com/ads.txt |
blog.sub.example.com | https://example.com/ads.txt |
Key Rule
If no ads.txt exists on the subdomain, AdSense falls back to the root domain’s ads.txt.
Technical Behavior (How It Actually Works)
When ads are requested from a subdomain:
-
Ad request originates from
subdomain.example.com -
Google crawler checks:
https://subdomain.example.com/ads.txt -
If not found → crawler checks:
-
If publisher ID is authorized → ads are served and monetized
✅ Revenue is valid and credited to the same AdSense account
Valid Configuration (Recommended)
ads.txt location
Accessible at:
Example ads.txt entry
✔ Covers main domain + all subdomains
✔ No additional syntax required
✔ No duplication needed
Invalid / Unsupported Configuration
❌ Unsupported syntax (DO NOT USE)
Reason:
-
ads.txt does not support subdomain scoping
-
This line is ignored by crawlers
Use Cases and Environments
Supported
-
Custom PHP websites
-
WordPress multisite (same domain)
-
Folder-based subdomains
-
Same AdSense publisher ID
Special Cases (Optional separate ads.txt)
Only required if:
-
Subdomain is on different hosting
-
Subdomain uses different AdSense account
-
Subdomain is owned by a different publisher
Step-by-Step Validation Checklist
1. Verify ads.txt accessibility
Expected:
2. Verify publisher ID
Ensure ads.txt contains:
Matches AdSense account → Settings → Account information
3. Confirm ad serving on subdomain
-
Ads visible
-
No “unfilled” placeholders
-
No AdSense warnings
4. (Optional) Revenue verification via URL Channels
AdSense → Reports → Manage URL Channels:
Wait 24–48 hours for segmented reporting.
Common Errors, Root Causes, and Fixes
| Issue | Root Cause | Fix |
|---|---|---|
| Ads showing but “Earnings at risk” | ads.txt unreachable | Fix HTTP 403/404 |
| ads.txt loads HTML | CMS routing issue | Serve static text file |
| ads not monetizing | Wrong publisher ID | Correct pub ID |
| Duplicate ads.txt | Conflicting authorization | Keep single root ads.txt |
| Delay in earnings | Normal crawl lag | Wait 24–48 hours |
Security Considerations and Risks
-
ads.txt prevents unauthorized resale of your ad inventory
-
Incorrect entries may:
-
Block demand
-
Reduce fill rate
-
Trigger AdSense warnings
-
-
Never add third-party sellers unless verified
Best Practices and Recommendations
-
Maintain one authoritative ads.txt
-
Keep ads.txt flat text only
-
Avoid CMS rewrites or redirects
-
Monitor AdSense Policy Center weekly
-
Use URL channels for large subdomain traffic
-
Document ads.txt changes in change logs
Conclusion
For same-hosting, folder-mapped subdomains, a single root-domain ads.txt is sufficient and fully compliant.
If ads are serving and no AdSense warnings exist, earnings from the subdomain are valid and credited normally.
No additional configuration is required.
#adsense #adstxt #googlesense #subdomainads #admonetization #publisherguide #webhosting #customphp #serveradmin #siteops #adops #programmaticads #iab #inventorycontrol #websecurity #adsensetips #adsensehelp #techseo #webinfrastructure #dns #apache #nginx #hostingguide #adpolicy #webmasters #sitemonetization #adsenseearning #digitalads #adsenseconfig #adsenseaudit #adtech #supportengineers #itdocumentation #knowledgebase #adsensefix #adsensetroubleshooting #adopsengineering #adsensesetup #adsensedeveloper #adsensepolicy #adsensefaq #adsensetech #adsenseguide #adsensevalidation #adsensebestpractice #adsensecompliance
Was this guide useful?
Your answer helps us keep BISONKB accurate and practical.