Home / Guides / Google AdSense

How to add your Google AdSense line to ads.txt

By the ads-txt.in team · Published November 8, 2026

Google AdSense asks every publisher to add an authorised seller line to the site’s ads.txt file. It is one line, but a small typing mistake is enough for AdSense to treat it as missing. Here is how to get it right the first time.

Step 1: Find your publisher ID

Sign in to AdSense and open Account → Settings → Account information. Your publisher ID looks like pub-1234567890123456: the letters “pub”, a hyphen and 16 digits. You may also see it written with “ca-” in front inside ad code, such as ca-pub-1234567890123456. In ads.txt, leave out the “ca-”.

Step 2: Write the line

google.com, pub-1234567890123456, DIRECT, f08c47fec0942fa0
  • google.com is the ad system. Do not write www.google.com or adsense.google.com.
  • pub-… is your own publisher ID.
  • DIRECT means you control the AdSense account yourself.
  • f08c47fec0942fa0 is Google’s certification authority ID. It is the same for every Google publisher.

Our generator creates this line for you when you type your publisher ID, and checks the format.

Step 3: Put it in the right place

The file must be named exactly ads.txt, in lowercase, and live in the root of your domain, so that it opens at https://yourdomain.com/ads.txt. If you already have an ads.txt file for other networks, add the Google line to it; do not replace the other lines. Platform-specific steps are in our guides for WordPress, Blogger and cPanel and aaPanel hosting.

Step 4: Check it

Open the address in a browser. You should see plain text, not a web page or an error. Then run our ads.txt checker with your publisher ID to confirm the line is valid and that the server returns it correctly.

Step 5: Wait for Google to crawl it

AdSense does not read the file instantly. Google says it can take a few days for changes to show, and longer for sites with little traffic. During this time the alert in your account may remain. If it has not cleared after a couple of weeks, check the file again for mistakes, and see our guide on fixing the “Earnings at risk” alert.

Common mistakes

  • Leaving “ca-” in front of the publisher ID.
  • Using the ID of a different AdSense account, for example an old one.
  • Uploading the file to a sub-folder instead of the root.
  • Naming the file ads.txt.txt because the computer hid the extension.

Related guides