Inventory management

Ads.txt guide

Authorized Digital Sellers, or ads.txt is an IAB initiative that helps ensure that your digital ad inventory is only sold through sellers (such as AdSense) who you've identified as authorized. Creating your own ads.txt file gives you more control over who's allowed to sell ads on your site and helps prevent counterfeit inventory from being presented to advertisers.

We strongly recommend that you use an ads.txt file. It can help buyers identify counterfeit inventory and help you receive more advertiser spend that might have otherwise gone toward that counterfeit inventory.

Fix ads.txt issues in AdSense

If there's an issue with ads.txt on your site, you'll see an alert in your AdSense account. To prevent severe impact to your revenue, follow the steps below to fix the issue.

Note: It may take a few days for your changes to be reflected in AdSense. If your site doesn't make many ad requests it may take up to a month.

Create an ads.txt file for your site

  1. Sign in to your AdSense account.
  2. In the alert on your homepage, click Fix now.
  3. Click the Down arrow Down Arrow to open the "Create an ads.txt file for..." message.
  4. Click Download. Your ads.txt file is automatically downloaded.
  5. Upload the file to the root level domain of your site (for example, https://example.com/ads.txt).

    Root levels are one level down from what’s listed in the public suffix list. For example, "google.co.uk" is a root domain of "co.uk" but "maps.google.co.uk" is not. See the IAB ads.txt specification.

Note: If you’re using another ad network, remember to add that network to your ads.txt file. Contact your ad network for their ads.txt information.

Add your publisher ID to an ads.txt file

  1. Sign in to your AdSense account.
  2. In the alert on your homepage, click Fix now.
  3. Click the Down arrow Down Arrowto open the "Add your publisher ID to these ads.txt files" message.
  4. Click Copy.
  5. Paste the line into each of your ads.txt files.

    Your ads.txt file should now look like this, where pub-0000000000000000 is your own publisher ID:

    google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0

Frequently asked questions

What if the ads.txt file is hosted on a subdomain?

Google crawls and enforces ads.txt files placed on subdomains, where one exists, and is referenced from the ads.txt file on the root domain.

To reference a subdomain in your root domain ads.txt file, you add a subdomain= declaration. For example, let's say your ads.txt file for example.com needs to reference the subdomain subdomain.example.com. You'd add this line to your root domain ads.txt file: subdomain=subdomain.example.com. See the IAB ads.txt specification for additional details on subdomain referral.

Note: You only need to do this if the authorized seller or your publisher ID are different for the subdomain when compared to the root domain.

Does Google support redirects?

Google supports a single HTTP redirect to a destination outside the original root domain (for example, example1.com/ads.txt re-directs to example2.com/ads.txt). See the IAB update.

Multiple redirects are also supported, as long as each redirect location remains within the original root domain. For example:

  • example.com/ads.txt redirecting to www.example.com/ads.txt
  • example.com/ads.txt redirecting to subdomain.example.com/ads.txt
  • example.com/ads.txt redirecting to example.com/page/ads.txt

How do I set up an ads.txt file for WordPress?

Consider using a plugin to create your ads.txt file in WordPress. If you already use a plugin to place ads, it might include a feature to create your ads.txt file. This search can help you get started.

How do I set up an ads.txt file for Blogger?

See the Blogger Help Center for instructions.

My CMS doesn't let me place a file on my root domain. What should I do?

Contact your CMS provider who should provide you with the facility to host an ads.txt file on your behalf.

How does Google enforce ads.txt files?

Google uses the content of any ads.txt files hosted on a root domain to determine which seller accounts are allowed to serve ads on that domain. Google runs an auction and returns a winning ad for requests on sites where an ads.txt file exists with a correctly listed publisher identifier. If the identifier in the file is incorrect, an auction is not run for that request.

What information goes in an ads.txt file?

Create a text file named ads.txt and include separate lines for each exchange or SSP that is authorized to sell your inventory. Each of these lines should contain three pieces of data (plus a fourth optional field), in the format:

<Field #1>, <Field #2>, <Field #3>, <Field #4>

  • <Field #1>: The canonical domain name of the system where bidders connect. This may be the operational domain of the system, if it’s different than the parent corporate domain, to facilitate WHOIS and reverse IP lookups to establish clear ownership. The SSP or exchange may publish the domain name to use.

    For Google seller accounts, the domain name is always google.com.

  • <Field #2>: The publisher identifier associated with the seller or reseller account for the system in field #1. This must contain the same value as that specified in an SSP or exchange transaction (such as OpenRTB bid requests). Typically, in OpenRTB, this is the publisher.id field. For OpenDirect, it is typically the publisher’s organization ID. 

    For Google seller accounts, use the publisher ID displayed in each account (for example, pub-0000000000000000). To find this ID:

    Only include the pub- prefix and the 16-digit numeric code in your declaration. Delete the product-specific prefix (for example, ca- or ca-video-). If you monetize through multiple Ad Manager and/or AdSense accounts, you must include a separate row for each account, with its corresponding pub- code.
    Domains hosting an ads.txt file where the seller’s publisher ID isn’t listed are no longer monetized through Ad Manager, and Google no longer buys ads on such sites. Updating your ads.txt files to include publisher IDs for each site you want to monetize is recommended (learn how to update ads.txt in Ad Manager). If you use Scaled Partner Management, we recommend working with your child partners to include your publisher ID in their ads.txt files.
  • <Field #3>: The type of account or relationship. This field should be treated as case-insensitive when interpreting the data.
    • A value of 'DIRECT' indicates that the publisher (content owner) directly controls the account indicated in field #2 and has a direct business contract between the publisher and the advertising system.

      Google publishers who directly control the account indicated in field #2 should specify 'DIRECT'.

    • A value of 'RESELLER' indicates that the publisher has authorized another entity to control the account indicated in field #2 and resell their ad space via the system in field #1.

      Google publishers who don't directly control the account indicated in field #2 should specify 'RESELLER'. For example, an Ad Manager account using Scaled Partner Management should specify 'RESELLER' for inventory the account doesn't directly manage.

  • <Field #4>: (Optional): A unique identifier for the advertising system within a certification authority, which maps to the entity listed in field #1. One certification authority is the Trustworthy Accountability Group (TAG), and the TAG ID would be included here.

    For Google seller accounts, the TAG ID is f08c47fec0942fa0.

Was this helpful?
How can we improve it?