Categories: Tips

ads.txt – What is ads.txt? How to implement for AdSense and others

If you haven’t heard of it yet, be prepared to hear a lot about ads.txt in the coming months. The clumsily named ads.txt project (pronounced “ads dot tee ex tee”) is the digital advertising industries initiative to clean up digital advertising and bring transparency to advertising. Although this has almost immediate impact on publishers, including those just using AdSense, many publishers are still unaware of it.  The initiative came about in the wake of a number of scandals around the misrepresentation of ad inventory that resulted in big money being spent on bad inventory. The solution, backed by the IAB and most of the big players in the ad space is deceptively simple (and for once cheap and easy for publishers of all sizes to implement).

Update October 2017: Google have announced that from October 15th they will stop buying inventory from sites that have an ads.txt file that doesn’t match the ad request. This means that it is imperative that publishers have their ads.txt correctly set-up right away if they have the file present.  Google are not yet blocking buys from sites with no ads.txt files, but this will follow.  For now the biggest risk is from incorrectly implemented ads.txt files. For examples of implementing ads.txt for AdSense and Ad Exchange either scroll down or click here.

How does ads.txt work?

Ads.txt is simply a text file that sits on your server and lists the places authorised to sell ads on your behalf. The “ads” part of the name is an acronym for “Authorised Digital Sellers”. The idea is simple: Buyers can collect this data and be sure that if they’re paying for ads on rollingstone.com then that is where those ads will appear (see example from rollingstone.com/ads.txt) .

The file simply lists the accounts that are authorised to sell the inventory, doing so in a format that can be easily crawled and indexed.

What do publishers stand to gain from implementing ads.txt?

If you are the New York Times, the benefit is obvious: Advertisers looking for exposure on your site won’t be tricked into buying misrepresented inventory and you retain control over pricing. As the standard gains more widespread adoption buyers are more likely to require ads.txt for all buys, making it more relevant to less well known publishers too.

Q: What are the drawbacks of implementing ads.txt?

The initiative is not without some criticism. Ads.txt is designed to bring transparency, but some argue that it is too transparent. Implementing ads.txt shows exactly where you sell your inventory to anyone who cares to look. If you price your ad inventory differently through different channels this allows buyers to shop around for the lowest price

Take, as an example, the ads.txt file for Business Insider :

#Ads.txt uk.businessinsider.com

google.com, pub-1037373295371110, DIRECT #video, banner, native, app
rubiconproject.com, 10306, DIRECT #banner
indexexchange.com, 183963, DIRECT #banner
indexexchange.com, 184913, DIRECT #banner
openx.com, 537147789, DIRECT #banner
openx.com, 538986829, DIRECT #banner
appnexus.com, 7161, DIRECT #banner
appnexus.com, 3364, RESELLER #native
facebook.com, 1325898517502065, DIRECT #video, banner, app
liveintent.com, 87, DIRECT #banner
taboola.com, 688168, DIRECT #native
triplelift.com, 4139, DIRECT #native
teads.com, 11643, DIRECT #outstream
teads.com, 11445, DIRECT #outstream
google.com, pub-8415620659137418, RESELLER #native

If I’m buying ads on Business Insider through one of these partners I can easily see where else inventory is available. I even have the relevant account IDs should I care to go comparing prices. Business Insider have even gone one step further and kindly labelled each demand partner with the types of ads they serve, although this is not part of the standard.

Again, these are “big publisher problems” that many independents would like to face, but are important to be aware of.

Should publishers adopt ads.txt?

Compared with other initiatives publishers are encouraged to adopt, the implementation cost of ads.txt is incredibly low. Five minutes work is enough to get most sites compliant, but despite this adoption hasn’t yet been overwhelming.  According to BuiltWith, only 1.8% of the top 10,000 websites currently use ads.txt, compared with over 44% using DoubleClick (not an entirely fair comparison, as both buy and sell side have reason to implement DoubleClick code, but a useful benchmark). Unsurprisingly, adoption is being led by USA, Germany and the UK.

Currently ads.txt is in a bit of a chicken and egg situation. There is not real drive for publishers to implement it until buyers start filtering to only buy from ads.txt supporting sources. Buyers aren’t implementing those filters yet, as there isn’t enough inventory until more publishers implement. Whether or not the initiative will gain enough momentum to get widespread adoption remains to be seen and is likely to be led by major publishers.

There could potentially be an early adopter advantage to those who have ads.txt in place if/when buyers start filtering on its use. The low cost and ease of adoption means that this could suit independent publishers who aren’t concerned about the transparency issue and have the flexibility to rule out change more easily.

Implementing ads.txt for Google ads (AdSense and Ad Exchange)

Implementing ads.txt is incredibly simple. Create a text file and add one line per authorised partner. On each line add the following three pieces of information, separated by a comma:

  • The domain of the advertising system
  • Your account ID
  • The type of relationship you have with that partner (either DIRECT or RESELLER if you are working through a third party)

There is an optional 4th field which is the TAG ID of the source if they are certified by the Trustworthy Accountability Group.  Once created simply upload that file to your webserver so that it is visible at example.com/ads.txt and you are done.

Google are pushing hard on ads.txt . Whilst they haven’t said that they will stop bidding on inventory that doesn’t have a corresponding ads.txt file, they will stop buying and selling unauthorised inventory in Q4 2017. In practice that means that there is more immediate risk to AdSense and Ad Exchange publishers from badly implementing ads.txt than not implementing it. This makes it doubly important to ensure that:

  1. If you use an ads.txt file you must include declarations for an AdSense and Ad Exchange accounts that you serve
  2. Those declarations need to be correct

ads.txt for AdSense

If you publish ads via Google AdSense and want to implement ads.txt you will need to first locate your publisher ID.  This can be found by logging in to AdSense and then navigating to Settings > Account > Account information.  Your publisher ID is in the format of pub-0000000000000000 with the zeros replaced by your own 16 digit number.

The entry in ads.txt for a publisher’s own Google AdSense account will then look like:

google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0

Please note that the TAGID for Google is always f08c47fec0942fa0 . Also, don’t forget to include the pub- part of your publisher ID, as this is apparently one of the most common errors in ads.txt implementation for AdSense publishers.

Update October 16th: AdSense publishers are now starting to see warnings in their account regarding ads.txt . The warning states Earnings at risk – One or more of your ads.txt files doesn’t contain your AdSense publisher ID. Fix this issue now to avoid severe impact to your revenue.

This in-account warning complements notices that are being sent by email in the following format:

Dear Publisher,
We’ve noticed that the ads.txt file on one or more of your sites that you monetise through this AdSense account (pub-xxxxxxxxxxxxxxxx) is missing the correct publisher code.
From mid-October, Google will stop buying ads on sites with ads.txt files which don’t include the correct publisher IDs. We recommend you update your ads.txt files immediately to prevent impact to your earnings. Make sure that the ads.txt file for each site you want to monetise through this account contains the snippet below:
google.com, pub-xxxxxxxxxxxxxxxx, DIRECT, f08c47fec0942fa0
It may take up to 24 hours for AdSense to process your updated ads.txt files.
You can learn more about ads.txt, how buyers will use it and how to implement it on your sites in our Help Centre.


ads.txt for Ad Exchange

The set-up for publishers with their own direct DoubleClick Ad Exchange account is the same, with the ID being found through DFP by navigating to Admin > Global settings > All network settings. Again the Publisher ID is in the format of pub-0000000000000000.

For publishers accessing Ad Exchange through a GCPP (such as OKO) or other third party the process is the same, but they will need to get the publisher ID from their managing partner and specify it as reseller. To take the example of a publisher using their own AdSense account and accessing Ad Exchange through a partner, their ads.txt file will look like the example below (We’ve labelled with a #comment for clarity):

google.com, pub-0000000000000001, DIRECT, f08c47fec0942fa0 # own adsense
google.com, pub-0000000000000002, RESELLER, f08c47fec0942fa0 # AdX

Mat Bennett :

View Comments (15)

    • This is a good question. We don't work on any Blogspot sites, so I am not overly familiar with the limitations of the platform. I'm guessing though that the issue is that you cannot upload text files. If this isn't the case for Blogspot, it will certainly be an issue on other platforms.

      If there is no way to get a text file serving from the domain, then you simply will not be able to implement ads.txt at this time. That is regrettable, but shouldn't cause an immediate issue. I haven't heard of any solution in the pipleline that doesn't require a text file though, so it could become more of an issue later if/when more buyers start demanding it.

      As I say, I have never used Blogspot, but it might be worth checking whether you can use redirects. The ads.txt standard does support redirects, so you could potentially 302 to the file hosted elsewhere. There also might be an option to do something similar through your domain DNS, depending on who the provider is.

    • If working with a partner other than OKO it would be advisable to check implementation details with the partner in question.

      However, the standards say that "A value of ‘DIRECT’ indicates that the Publisher (content owner) directly controls the account". So, if it is your account ID on that line in ads.txt then the value should be direct. If the ID belongs to a company that you partner with (ie that account is in their name and you have a sub-account of are syndicated) then RESELLER would be the correct value. For Ad Exchange accounts this will mean that you list as DIRECT only if you have your own AdX account (login + they pay you directly), and RESELLER if you access AdX through a third party NPM account.

    • It's good that tools are appearing to help with ads.txt, although the initiative has been developed to be easy to manage. OKO advice is to consider whether external tools are needed, particularly if they involve increasing the risk by hosting the files elsewhere. There are advantages, but not for every site.

      If managing multiple partners on multiple sites then redirecting to a central file can also be an option. This would be free, secure and reliable.

  • We are implemented ads.txt, but it is without google ad sense id. but our revenue has been dropped after the implementation of ads/.txt. We have received a warning as written by you and we have implemented ads.txt as per the guideline. Even after 4 day our revenue is dropping drastically. Immediately let me know how it can be fixed

    • We're not yet sure how frequently Google is recrawling for the files. If you are seeing CPM drop that cannot be otherwise explained and you still have the warning in your account then you should reach out to your AdSense account manager/support or your Certified Publishing Partner. We have not seen the same on accounts that we are managing.

    • If you use a hosted service then you need to talk to the provider about the solution. Realistically, this is going to be a big problem for a lot of small publishers who's CMS/Host service hasn't kept up with the development of the advertising ecosystem. Amazingly this even includes Google/Blogger publishers at the moment.

      We are aware of two possible ways around this at the moment:

      1. Use a redirect
      If your service allows you to have redirects then you could have /ads.txt redirect to a remotely hosted file. This is not an option for all services, but if you can do a redirect this will work as long as there is only one redirect "hop".

      2. Host your domain elsewhere
      If your domain points to a host that does allow you to host an adstxt file you could use URL rewriting to serve the rest of the content from your hosted CMS location.

      Both will work, but neither is ideal. We suspect that more publishers will choose option #3 - move the website to another service.

  • I just lost one day's AdSense revenue by doing the mistake of adding the Ads.txt file without proper care. One of the Adx partners I am working with demanded that we should use their pub-id and just for that reason, I added the Ads.txt file with their pub-id. However, I didn't take care to include my own pub-id in the Ads.txt file. Even after seeing the warning message, I didn't pay serious attention to it, until I realised next day that I lost one day's revenue on my AdSense. I have shared my own experience here (http://www.spiderworks.in/earnings-at-risk-one-or-more-of-your-ads-txt-files-doesnt-contain-adsense-publisher-id/) with the below warning:

    “Earnings at risk – One or more of your ads.txt files doesn’t contain your AdSense publisher ID. Fix this now to avoid severe impact to your revenue.”

    Adding our pub-id to the Ads.txt file would have solved the problem, but I decided to remove the Ads.txt file itself since I am not sure how many other problems this is going to introduce, like other Adx partners I am working with.

    • Oh no! We've seen this more than once: Partners giving publishers ads.txt instructions that are unclear and potentially costly to publishers. Your ads.txt file is your way of telling buyers who you are working with. Every publishers should know why every line exists.

  • recently we got the same warning in our adsense account. Simply we want to know that it's necessary to add ads.text file or not. Is there any negative impact if we dont add this ads.txt file.
    It's really confusing.
    Please reply soon.

    • Yes - definitely add it. The downside is minimal and adsense will soon stop earning you any money if you don't add the file