Do you manage a subdomain? Are you confused about how to manage the ads.txt file format across subdomains? Here’s how to manage your subdomain ads.txt files.
In 2017, a new digital advertising standard was created called the ads.txt file format. To help verify which advertisers are allowed to advertise on your website, lines of code can be added to an ads.txt file placed on the root level of a webserver.
But what if you manage a subdomain of a website and need to have a separate ads.txt file from the ads.txt on the main domain? Here’s how to manage and redirect ads.txt files on a site with multiple subdomains.
- FTP access to both the root domain and subdomain(s)
- A basic text editor
- Basic coding skills
- 10 minutes of free time
NERD NOTE: The “ADS” in ads.txt is an acronym for Authorized Digital Sellers. The technology is an initiative from the IAB Technology Laboratory. The contents of an ads.txt file specify which companies are authorized to advertise on a website and can help reduce internet fraud.
Preparing The Ads.txt File For Your Subdomains
You can create or edit an ads.txt document using any basic text editor. I suggest using BBedit (macOS) or Notepad (Windows OS). Do NOT use Microsoft Word or another word processing application. These apps create text characters and file types that won’t be compatible with your web server.
Each ad network that you partner with will supply you with a different set of entries for your ads txt file. The contents of your ads.txt document will consist of several lines of ad tags that look like this:
adtech.com, 0000, RESELLER advertising.com, 0000, RESELLER appnexus.com, 0000, DIRECT Cedato.com, 0000, RESELLER contextweb.com, 0000, RESELLER
It’s also a good idea to add notes to your ads.txt file. I suggest adding a note saying where the ad tags came from and who updated that section. This will help reduce clutter and confusion. Just type a “#” symbol in from of your note. Any line that starts with a “#” will be ignored.
#Start NAME OF AD PROVIDER adtech.com, 0000, RESELLER advertising.com, 0000, RESELLER appnexus.com, 0000, DIRECT Cedato.com, 0000, RESELLER contextweb.com, 0000, RESELLER #Updated May 6, 2020 | YOUR NAME #End NAME OF AD PROVIDER
Upload Or Update Your Ads.txt Files
Once you’re done creating your ads.txt files, you’ll need to upload it to your webserver. There are a variety of ways to do this including using an FTP client or cPanel. Talk to someone who oversees your website if you don’t know how to do this. Also, create a backup of your currents ds.txt file before you overwrite it with your new upload.
Authorize The Subdomain Ads.txt File From The Root Domain
The final step is to add a line of code to the ads.txt file on the root domain that points to the ads.txt file on the subdomain. Here’s how to do that:
#Subdomain Permissions - DO NOT REMOVE subdomain=SUBDOMAIN.ROOTDOMAIN.com #Updated Apr 6, 2020 | YOUR NAME
How To Use The Ads.txt File Format Across Subdomains
That’s it. As long as your main ads.txt file has a pointer to the additional ads.txt file(s) on your subdomain(s), then you should be okay. Just remember that the ads.txt files on your subdomains won’t work unless the root domain points to them. Please post a comment below if you have any questions. Also, we would really appreciate your feedback if you have suggestions on how to make this tutorial about managing your ads.txt files even better.
- How To Open WebP Files And Convert WebP To JPG
- How To Use The BBEdit GREP Advanced Find And Replace Function
- Why You Should Update Your WordPress Ping List
- How To Enable GZIP Compression For Your Website
Frank Wilson is a retired teacher with over 30 years of combined experience in the education, small business technology, and real estate business. He now blogs as a hobby and spends most days tinkering with old computers. Wilson is passionate about tech, enjoys fishing, and loves drinking beer.