Protect your Lenovo Server

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 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 Domainads.txt Lookup Location
example.comhttps://example.com/ads.txt
sub.example.comhttps://example.com/ads.txt
blog.sub.example.comhttps://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:

  1. Ad request originates from subdomain.example.com

  2. Google crawler checks:

    https://subdomain.example.com/ads.txt

  3. If not found β†’ crawler checks:

    https://example.com/ads.txt
  4. 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

/public_html/ads.txt

Accessible at:

https://example.com/ads.txt

Example ads.txt entry

google.com, pub-1234567890123456, DIRECT, f08c47fec0942fa0

βœ” Covers main domain + all subdomains
βœ” No additional syntax required
βœ” No duplication needed


Invalid / Unsupported Configuration

❌ Unsupported syntax (DO NOT USE)

subdomain=subdomain.example.com

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

curl -I https://example.com/ads.txt

Expected:

HTTP/1.1 200 OK Content-Type: text/plain


2. Verify publisher ID

Ensure ads.txt contains:

pub-XXXXXXXXXXXXXXX

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:

example.com subdomain.example.com

Wait 24–48 hours for segmented reporting.


Common Errors, Root Causes, and Fixes

IssueRoot CauseFix
Ads showing but β€œEarnings at risk”ads.txt unreachableFix HTTP 403/404
ads.txt loads HTMLCMS routing issueServe static text file
ads not monetizingWrong publisher IDCorrect pub ID
Duplicate ads.txtConflicting authorizationKeep single root ads.txt
Delay in earningsNormal crawl lagWait 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


ads.txt subdomain adsense subdomain earnings google adsense ads.txt ads.txt same hosting ads.txt subdomain configuration adsense custom php site adsense subdomain allowed ads.txt root domain adsense ads not counting adsense revenue subdomain ads
Sponsored