How to Find Your Google AdSense Publisher ID (pub-XXXXXXXX)
Your AdSense publisher ID (pub-XXXXXXXXXXXXXXXX) is hidden behind two clicks. Here's exactly where to find it — and what to do with it.

How to Find Your Google AdSense Publisher ID (pub-XXXXXXXX)
Every AdSense article assumes you already know your pub- ID. Most people don't. Here's the exact two-click path, plus the three places you'll actually use it.
The Exact Path
- Sign in at adsense.google.com.
- In the left menu, click Account.
- Click Settings → Account Information.
- Your Publisher ID is the value labelled 'Publisher ID', formatted pub-XXXXXXXXXXXXXXXX.

Where You'll Use It
- In ads.txt at your site root: google.com, pub-XXXXXXXXXXXXXXXX, DIRECT, f08c47fec0942fa0
- Inside the AdSense auto-ads script (the data-ad-client attribute).
- Anywhere a third-party platform (Shopify, Ghost, etc.) asks for your AdSense account ID.
Common Mistakes
- Copying with leading or trailing spaces — ads.txt parsers will reject it.
- Using your Google Ads customer ID (XXX-XXX-XXXX) instead of your AdSense pub- ID.
- Placing ads.txt anywhere other than the domain root.
Verify Your Setup
After updating ads.txt, visit https://yourdomain.com/ads.txt directly in a browser and confirm the line shows up exactly as written. Google's ads.txt crawler re-checks within 24 hours.
Run a free SEO audit on your site to catch missing files like ads.txt.
Open SEO AnalyzerFrequently Asked Questions
Is my publisher ID different from my customer ID?+
Yes. The customer ID is for Google Ads (advertiser side). The publisher ID (pub-XXXXXXXX) is for AdSense (publisher side). Don't mix them in ads.txt.
What if I can't see Account Information in AdSense?+
Your account might be pending review or limited. Check the home dashboard for any warning banner — the Settings menu unlocks once your account is fully active.
Can I have more than one publisher ID?+
No. Each AdSense account has exactly one publisher ID, which covers all the sites you add to that account.
Why does Google say my ads.txt is invalid?+
Most often a typo in the publisher ID, or hosting ads.txt at /folder/ads.txt instead of the root. It must be at https://yourdomain.com/ads.txt.
Related articles
Try the related free tools
Hands-on utilities from DigiMetrics Hub that go with this guide.
Domain Age Checker
Find out how old any domain is. Free domain age checker with registration and expiry details.
Open tool Network & IPWhat Is My IP
Instantly find your public IP address, location, ISP and timezone. Free, no signup required.
Open tool Network & IPWHOIS Lookup
Find domain registration details, owner info, expiry date and nameservers with our free WHOIS tool.
Open tool