AdSense Publisher ID vs ca-pub / Ad Client: Which Code Goes Where

AdSense publisher ID vs ca-pub / ad client: ID-Then-Paste shows which code goes where for small blogs. WordPress placement stays on its owner guide page.

AdSense Publisher ID vs ca-pub / Ad Client: Which Code Goes Where

AdSense publisher ID vs ca-pub / ad client is the same account identity in two common spellings—plus the fields that accept each form. Small blogs break monetization by pasting the HTML client string into ads.txt, or by mixing two accounts across plugins.

This page is ID-Then-Paste. It is not WordPress AdSense code placement without breaking the theme (that URL owns where snippets sit in the theme—early-link it for layout). It is not Auto ads vs manual units (format choice). It is not ads not showing (full blank-slot triage)—use that after IDs are correct.

Match the string shape to the field: pub- for ads.txt and account info; ca-pub / client for ad tags. One account—do not invent a second ID to “fix” fill.

Official: Find your publisher ID · Ads.txt guide · Connect your site. Product UIs rename menus; confirm the live Help steps in your account.

Disclosure: Implementation hygiene only. No RPM, earnings, or approval promises.

Table of contents

  1. ID-Then-Paste
  2. Three strings, one account
  3. Where each string belongs
  4. Common paste mistakes
  5. Auto ads versus manual units (ID angle)
  6. When IDs are fine but ads stay blank
  7. ID-Then-Paste checklist
  8. FAQ
  9. Copy once, paste to the right box

ID-Then-Paste

        ID-THEN-PASTE
  1. FIND   → Account → Settings → Publisher ID (pub-…)
  2. NOTE   → same digits appear as ca-pub-… inside ad code
  3. ADS.TXT→ google.com, pub-…, DIRECT, … (Copy from AdSense)
  4. TAGS   → client=ca-pub-… / data-ad-client="ca-pub-…"
  5. PLACE  → theme/plugin per WordPress placement owner
  6. VERIFY → view-source search for adsbygoogle + matching digits

The original value is a field map. Most “which code?” threads bury the answer under theme screenshots. Here the job is identity hygiene only.

Three strings, one account

Google documents the publisher ID as pub- plus sixteen digits (Help). You need it for support and for ads.txt.

In ad code, the same account usually appears with a ca- prefix—e.g. ca-pub-1234567890123456 on client= / data-ad-client. Publishers casually call this the ad client or ca-pub. It is not a second AdSense account; it is the client parameter shape for serving tags.

Name people sayTypical shapePrimary use
Publisher IDpub-################Account info, ads.txt seller ID, support
ca-pub / ad clientca-pub-################Script client and data-ad-client
Ad unit / slot IDlonger path after / in unit codeSpecific unit (when using manual ads)

Slot IDs identify a unit, not a different publisher. Do not swap a slot string into ads.txt.

Where each string belongs

Account information
Sign in → Account → Settings → Account information → Publisher ID field. That pub-… value is the source of truth.

ads.txt
Use the line AdSense copies for you in the Sites / ads.txt flow. It includes google.com, your pub-… ID, DIRECT, and the certification ID Google documents. Details and status words: ads.txt Authorized meanings. If the column says Not found, fix hosting with ads.txt not found triage—do not “upgrade” the line by pasting ca-pub into the middle.

Ad tags (Auto ads or units)
Paste the snippet AdSense generates. The script URL and ins tag should carry your ca-pub-… client. Changing themes? Re-place the same account code—do not generate a “temporary” client.

WordPress / theme files
How you inject the snippet (header, plugin, widget) is owned by WordPress AdSense placement. This page only insists the digits match your publisher ID.

Verification / connect flows
When Google asks you to add a head snippet or meta tag to connect a site, use the code from that flow for your account—not a friend’s ca-pub, not an old rejected account’s leftover script.

Common paste mistakes

  1. ca-pub inside ads.txt — Seller lines expect the publisher ID form Google shows. Wrong shape → Unauthorized / verification failures.
  2. Two accounts on one site — Header plugin uses account A; footer widget uses account B. Pick one approved account; remove the orphan.
  3. Typed digits from memory — One wrong digit fails ads.txt and attribution. Prefer Copy from AdSense.
  4. Pastemaking “ca-pub” into a field labeled Publisher ID — Some plugins ask for pub-… only. Read the label; if unsure, paste what AdSense Account information shows and check the plugin docs.
  5. Treating slot ID as publisher ID — Manual unit codes include more than the client. ads.txt still needs the account pub- line.

Scenario: a blogger copies the full Auto ads script into a host “ads.txt” file manager field. The crawler sees HTML garbage instead of a seller line. Status stays Not found until a real text file exists—again, Not found triage.

Auto ads versus manual units (ID angle)

Both formats should reference the same AdSense client / publisher identity. Auto ads does not give you a “better” pub ID; manual units do not need a second account to “raise RPM.” Format trade-offs live on Auto ads vs manual.

If you switch from Auto to manual (or the reverse), update placements carefully so you do not leave two competing snippets fighting in the theme—placement owner covers breakage; here, confirm both snippets still show the same digit string in view-source.

When IDs are fine but ads stay blank

Correct IDs do not override:

  • Site still in Getting ready / not Ready (label map · review clock)
  • ads.txt Not found or Unauthorized
  • Ad blockers, consent messaging, or policy limits
  • Broken theme injection

Run ads not showing: what to check after the ID map passes. Do not open a second AdSense account solely because a unit is blank.

ID-Then-Paste checklist

  • Publisher ID from Account information written down (pub-…)
  • Ad code ca-pub-… digits match that publisher ID
  • ads.txt uses the AdSense Copy line with pub-… (not HTML)
  • Only one AdSense account’s client appears in view-source
  • Plugins asking for “publisher ID” received the shape they document
  • Theme placement follows WordPress placement
  • Blank slots → ads not showing, not a new pub ID

FAQ

What does an AdSense publisher ID look like?

Google Help shows the publisher ID as pub- followed by sixteen digits (example shape: pub-1234567890123456). Find it under Account → Settings → Account information, in welcome emails, or inside ad code.

What is ca-pub in AdSense code?

In ad tags, the client value often appears as ca-pub- plus the same digit string as your publisher ID. It identifies your account in the script and data-ad-client attributes so requests attribute correctly.

Do I paste ca-pub into ads.txt?

No. ads.txt seller lines use the pub- form (without inventing extra prefixes). Copy the line AdSense provides. Putting the wrong string in ads.txt can leave Unauthorized or Not found issues.

Where does the ad client ID go?

In the Auto ads or ad unit snippet Google gives you—typically the client= query on adsbygoogle.js and data-ad-client on the ins tag. Do not invent a second client ID for a plugin unless that plugin asks for the same official value.

Is this the WordPress placement guide?

No. Theme headers, widgets, and unbroken layouts live on the WordPress AdSense placement owner. This page only maps which ID string belongs in which field.

Why are my ads not showing if the ID looks right?

Correct IDs are necessary but not sufficient. Site approval, ads.txt, blockers, consent, and placement all matter. Use the ads-not-showing triage after the ID map checks out.

Should Auto ads and manual units use different publisher IDs?

Both should point at the same AdSense account’s client / publisher identity. Switching formats does not mean opening a second pub- ID. Choose Auto vs manual on the Auto-vs-manual owner.

Can I share my publisher ID publicly?

The ID appears in public ad code and ads.txt by design. Still avoid posting full account screenshots with payment or personal data. Google may ask for the publisher ID when you contact support.

Copy once, paste to the right box

Pull pub-… from Account information. Expect the same digits as ca-pub-… in tags. Keep ads.txt on the seller line AdSense copies. Place snippets with the WordPress placement guide. If units stay empty after IDs match, open ads not showing—not a second publisher ID.

Keep learning

More guides in the same topic lane.

Make Money Online5 min read

PDF to Text or PDF to Word: Which Job?

Need copy-paste plain text from a PDF or an editable Word file? Choose PDF to Text vs PDF to Word before upload—format, cleanup, and live tool links.

Make Money Online6 min read

JPG to PDF or Protect PDF: Which Job First?

Photos still need a PDF packet, or the PDF only needs a password? Route JPG stacks vs Protect PDF before you lock the wrong file or skip the build step.