Section numbers are those of the IAB Tech Lab’s Ads.txt Version 1.1, read as text for this site (the version history lists 1.0 in June 2017, 1.0.1 in August 2017, 1.0.2 in March 2019, 1.0.3 in March 2021 and 1.1 in July 2022).
The record (3.3, 3.4)
One record per line: <FIELD #1>, <FIELD #2>, <FIELD #3>, <FIELD #4>, fields separated by commas.
A reader ignores any run of white space or tabs; no field may contain tabs, commas or white space unless it is URL-encoded.
If the data is obviously corrupted or malformed, the contents of the file should be ignored (3.4.2).
| Field | Name | Rule |
|---|---|---|
| 1 | Domain name of the advertising system | Required. The canonical domain of the SSP, exchange or header wrapper that bidders connect to. A valid DNS name obeying RFC 1123 (3.4.2). |
| 2 | Publisher’s account ID | Required. The identifier of the seller account in that system; it must be the value used in transactions (in OpenRTB typically publisher.id). A string or an integer (3.4.2). |
| 3 | Type of account or relationship | Required. DIRECT: the publisher directly controls the account. RESELLER: the publisher has authorised another entity to control the account and resell the space. “Other types may be added in the future.” Treated as case-insensitive. |
| 4 | Certification authority ID | Optional. An ID of the system within a certification authority, currently the TAG ID of the Trustworthy Accountability Group. Superseded by the identifiers object of sellers.json; “may be deprecated in a future version”. |
- Comments:
#to the end of the line is ignored (3.4.1). - Extension fields: allowed if they use a distinct final separator
;before the extension data (3.4.3). - Line ends: CR, LF and CR LF are all accepted as separators (3.4.2, 5.3).
- Placeholder:
placeholder.example.com, placeholder, DIRECT, placeholdersays the file follows the specification and authorises no system. A file must hold at least one properly formatted line; an empty file for this purpose was deprecated in 1.0.2 and should be ignored after 1 March 2020 (3.2, 3.2.1).
Variables (3.5, 3.5.1)
A line of the form VARIABLE=VALUE is a variable declaration, stored with the root domain. The name has no internal white
space; the only separator is =; the value is an open string. Declaring them at the end of the file is recommended, not required.
Repeated lines are all read and stored, except where a variable says otherwise.
| Variable | Since | Rule |
|---|---|---|
CONTACT | 1.0.1 | Optional. Human-readable contact for the owner of the file: an email address, a phone number, a contact form link. |
SUBDOMAIN | 1.0.1 | Optional. A subdomain of the root domain where another ads.txt is found, which the crawler fetches for that subdomain. Only root domains refer to subdomains; subdomains do not refer to other subdomains (3.5.1, 5.5). |
INVENTORYPARTNERDOMAIN | 1.0.3 | Recommended where relevant. The domain of a partner authorised to monetise ads in the site or app, whose ads.txt (not app-ads.txt) is followed; only one hop (4.6). |
OWNERDOMAIN | 1.1 | Recommended. The business domain that owns the site or app; the same as sellers.domain in sellers.json; Public Suffix List +1, “not a full hostname or a URL”. If repeated, only the first is used. If absent, the domain where the file is found is the owner (4.7). |
MANAGERDOMAIN | 1.1 | Optional. The domain of a primary or exclusive monetisation partner when the owner does not manage monetisation. Syntax: domain[, country] with an ISO 3166-1 alpha-2 country code, blank meaning global. One per country, and one global without a country (3.5.1, 4.8). |
“Other variables may be added in the future”: the explorer labels a variable that is not one of these five and does not call it an error.
Location and retrieval (3.1, 3.6)
- Posted at
/ads.txton the root domain (public suffix plus one label) and on subdomains where needed, over HTTP or HTTPS, with the content typetext/plain; other content types are an error and the content is ignored (3.1, 3.2). - 2xx: the file is used. A redirect (301, 302, 307) within the root domain is followed; one redirect to a destination outside it is allowed, and if that destination redirects again it is an error. 401: contact the site. 404: no declarations exist. Other errors: use the last data retrieved (3.1).
- Consumers cache the file; with no cache directives they default to an expiry of 7 days (3.6).