Press enter to see results or esc to cancel.

Create, Edit and Check ads.txt

ads.txt is a simple text file that you may place in the root of your domain (for example https://example.com/ads.txt). This is a simple, flexible, and secure method for publishers and distributors to declare who is authorized to sell their inventory, improving transparency for programmatic buyers.

ads.txt supports transparent programmatic digital media transactions and can remove the financial incentive from selling counterfeit and misrepresented media. Similar to robots.txt, ads.txt can only be posted to a domain by a publisher’s webmaster, making it valid and authentic. As a text file, ads.txt is easy to update, making it flexible. Because publishers sell their inventory through a variety of sales channels, ads.txt supports the following types of supplier relationships:

  • Domain owners who sell on exchanges through their own accounts
  • Networks and sales houses who programmatically sell on behalf of domain owners
  • Content syndication partnerships where multiple authorized sellers represent the same inventory

IAB Technology Laboratory provides more detailed information on ads.txt file. Check also ads.txt specifications.

Creating and editing ads.txt file

Ad Inserter has a simple ads.txt viewer and editor. You can quickly create, check and edit ads.txt file. You can also easily add lines with account IDs from ad codes found in Ad Inserter blocks. To create, edit or check ads.txt file click on the ads.txt button in the header toolbar:

ad inserter header toolbar ads.txt

You will see a table view of the items in the current ads.txt file:

ad inserter ads.txt table

Ad Inserter will also scan all your blocks and extract known advertising systems (for example, AdSense). For each advertising system found, Ad Inserter will highlight line in the table:

  • Green lines show Account IDs found in blocks and present in ads.txt file
  • Red lines show Account IDs found in blocks but not present in ads.txt file
  • White / gray lines show other lines found in ads.txt file

Each line in the ads.txt file will show the following fields:

Advertising system

This is domain name of the advertising system – the canonical domain name of the SSP, Exchange, Header Wrapper, etc system that bidders connect to. This may be the operational domain of the system, if that is different than the parent corporate domain, to facilitate WHOIS and reverse IP lookups to establish clear ownership of the delegate system. Ideally the SSP or Exchange publishes a document detailing what domain name to use.

Account ID

This is publisher’s Account ID – the identifier associated with the seller or reseller account within the advertising system in field Advertising system. This must contain the same value used in transactions (i.e. OpenRTB bid requests) in the field specified by the SSP/exchange. Typically, in OpenRTB, this is publisher.id. For OpenDirect it is typically the publisher’s organization ID.

If you are using AdSense ads this field will contain your Publisher ID (pub-xxxxxxxxxxxxxxxx). Please note that Publisher ID should start with pub-.

Type

Type of Account / Relationship – an enumeration of the type of account. A value of DIRECT indicates that the Publisher (content owner) directly controls the account indicated in field Account ID on the system in field Advertising system. This tends to mean a direct business contract between the Publisher and the advertising system. A value of RESELLER indicates that the Publisher has authorized another entity to control the account indicated in field Account ID and resell their ad space via the system in field Advertising system. Other types may be added in the future. Note that this field should be treated as case insensitive when interpreting the data.

Cetification authority ID

An optional ID that uniquely identifies the advertising system within a certification authority (this ID maps to the entity listed in field Advertising system). A current certification authority is the Trustworthy Accountability Group (aka TAG), and the TAGID would be included here.

Click on valid TAGID will open Trustworthy Accountability Group page for the Advertising system.

The toolbar above the table has a search field to limit rows in the table. When you eneter search keywords the table will show only the lines that contain all your search keywords.

ad inserter ads.txt toolbar

Buttons in the toolbar:

ad inserter ads.txt toolbar edit

This button switches from table view to editor – this works for phisical and virtual ads.txt file (created by Ad Inserter).

ad inserter ads.txt toolbar reload

Reload ads.txt button reloads actual ads.txt, for example, when you have externally edited the file.

ad inserter ads.txt toolbar virtual file

This button toggles virtual ads.txt file – when highlighted, Ad Inserter will generate virtual ads.txt – see below for details.

ad inserter ads.txt file

This button open ads.txt file in a new tab.

If no ads.txt file is found the deafult view is editor where you can create ads.txt file.

When you need to edit ads.txt switch to editor mode:

ad inserter ads.txt toolbar edit

The editor shows few windows. For physical ads.txt file the first window shows path for WordPress installation and path for ads.txt file. When ads.txt file is not writable you’ll see a red warning next to the path. In such case you can switch to virtual ads.txt file. 

The next optional and read-only window shows missing lines in ads.txt file. Ad Inserter will scan all your blocks and extract known advertising systems. For each advertising system found in blocks but not present in ads.txt file, Ad Inserter will generate a line for ads.txt file. You can simply copy these lines to the ads.txt editor window below.

ad inserter ads txt editor

For example, for AdSense you need to have the following line in ads.txt file:

google.com, pub-xxxxxxxxxxxxxxxx, DIRECT, f08c47fec0942fa0

pub-xxxxxxxxxxxxxxxx is your AdSense Publisher ID which should start with pub-. Check also Google documentation on AdSense and ads.txt.

The lower window shows actual ads.txt file as found in your WordPress folder. Here you can add, remove or edit lines in the file. Once you are happy with it you need to save the file:

ad inserter ads.txt toolbar editor save

You can also cancel editing and return to table view:

ad inserter ads.txt toolbar editor cancel

ads.txt file must be placed on the root domain. If the plugin detects that your WordPress is installed in a folder it will show a warning. You will be able to view and edit ads.txt file in this folder, however, it is your responsibility to make sure the root domain will contain the right ads.txt file.

In case it is not possible to create physical ads.txt file you can use virtual ads.txt file – your website will have a redirection for ads.txt file either to Ad Inserter, to some other installed plugin on your website or to some external online service (for example Ads.txt manager) that will serve ads.txt file for your website. When the virtual ads.txt.file is created by Ad Inserter you can edit it as described on this page. Otherwise you will not be able to edit it with Ad Inserter. Use the editor of your virtual ads.txt file provider – other plugin or external service.

Virtual ads.txt file

Virtual file means that there is no physical file in the WordPress folder but a redirection that redirects request for ads.txt file to some plugin or external service. When Ad Inserter generates virtual ads.txt file the redirection is located in the .htaccess file:

RewriteRule ^ads\.txt /wp-admin/admin-ajax.php?action=ai_ajax&ads-txt= [QSA,L]

To switch to virtual ads.txt file click on the button to toggle virtual ads.txt – it will be highlighted when Ad Inserter generates virtual ads.txt file.

ad inserter ads.txt virtual file on

You can edit Ad Inserter virtual ads.txt as described on this page. You can also switch back to physical file anytime – in such case the virtual file (created by Ad Inserter) will be deleted.

Please note that you can only edit virtual ads.txt file created by Ad Inserter. In the case virtual ads.txt is not created by Ad Inserter you need to go to application (or plugin) that created it.