All articles
SEO Tools 4 min readBy Mehadi ShawonPublished

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.

Glowing golden ID card with publisher identifier code above an AdSense dashboard on a laptop
Quick answer

How to Find Your Google AdSense Publisher ID (pub-XXXXXXXX)

Your Google AdSense Publisher ID lives in Account → Settings → Account Information inside your AdSense dashboard. It starts with 'pub-' followed by 16 digits and is the exact value you paste into your ads.txt file and AdSense code snippet.

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

  1. Sign in at adsense.google.com.
  2. In the left menu, click Account.
  3. Click Settings → Account Information.
  4. Your Publisher ID is the value labelled 'Publisher ID', formatted pub-XXXXXXXXXXXXXXXX.
Glowing golden ID card with publisher identifier code above an AdSense dashboard on a laptop

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.
Ad Space

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 Analyzer

Frequently 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.

Ad Space

Related articles

Try the related free tools

Hands-on utilities from DigiMetrics Hub that go with this guide.