The Complete Ads.txt Resource Center
How to Write Your Ads.txt File
With the required information in hand, you're ready to write the first line of your ads.txt file. Begin by opening a blank text file in a program like Notepad (PC) or TextEdit (Mac). Then, put each of the four pieces of information described above on a single line. Separate each with a comma.
Here’s what it might look like:
example.com, 1234, DIRECT, abc123That's it — you've added an authorized seller to your ads.txt file. Adding more sellers is a simple matter of lather, rinse, and repeat. Starting on a new line of the file, add the four pieces of information for the next seller. Repeat that until you've added all your sellers.
It's crucial to maintain a consistent format throughout the file. Each authorized seller should be on a new line, and the fields should be separated by commas. Avoid unnecessary spaces or punctuation within the data records.
What makes it even simpler: every demand partner should be able to simply provide you with the complete line you need to add to your ads.txt entry if you ask.
Building an Ads.txt File with Google AdSense
Because Google has been pro-ads.txt since the project's inception, Google AdSense has made it easy to get your ads.txt file started. You can download an ads.txt file — with Google listed as an authorized seller — from your AdSense account.
Inside your AdSense dashboard, find Sites. Click the down arrow and find "Create an ads.txt file for..." You will see an ads.txt file when you click this, but keep in mind that, if you would like to authorize sellers in addition to Google, this won't be a complete file. You will have to manually add your other sellers. When you're done, click download.
Maintaining Your Ads.txt File
Once you've created your ads.txt file, it's important to remember that this isn't a one-time task. You should regularly update your ads.txt file as your advertising partnerships change. This ongoing maintenance is crucial to ensure your file remains accurate and effective in the programmatic advertising ecosystem.
After creating and implementing your ads.txt file, it's also important to validate it. You can use tools like Google's ads.txt validator to check if your file is correctly formatted and accessible. This step helps prevent potential issues that could affect your ad revenue.
Never Worry About Your Ads.txt File Again with Playwire
While creating an ads.txt file is a fairly simple task in the world of coding and web development, it's not something that your average web or mobile app publisher can just sit down and do well in an afternoon. The problem, though, is that you don't have to just do it well — you have to do it perfectly. Otherwise, you risk breaking the authorization of those who sell your inventory, which means your ad revenue tanks.
That's enough to get top billing in most publishers' nightmares. The good news is that you don't have to worry about it at all. You just have to let Playwire handle it.
Frequently Asked Questions About Ads.txt Files
Here are some answers to frequently asked questions.
What exactly is an ads.txt file and why do I need one?
An ads.txt file is a text file that serves as your digital authorization list for online advertising. It tells advertisers and programmatic advertising platforms exactly which companies are authorized to sell ads on your site. Think of it as your official guest list - without it, unauthorized parties might try to sell your ad inventory, leading to ad fraud and lost revenue. Every website owner who wants to sell ads through programmatic advertising should have one in their root directory.
Where should I place my ads.txt file on my website?
Your ads.txt file must be uploaded to your website's root domain - that's the main directory of your site (like yoursite.com/ads.txt). This specific location in the root directory is crucial because that's where buyers and advertising platforms automatically look to verify your authorized sellers. If it's anywhere else, the advertising system won't be able to find it, and your authorized digital sellers won't be recognized.
How do I get my publisher ID for the ads.txt file?
Your publisher ID is a unique identifier assigned to you by each ad network or ad exchange you work with. For your Google AdSense account, you can find this ID in your AdSense dashboard - just look for your account ID in the account settings. Each advertising platform will have a different publisher ID for you, so you'll need to collect these from all your authorized parties before you create your ads.txt file.
What's the difference between DIRECT and RESELLER in the relationship type field?
The relationship type tells buyers about your connection to each advertising platform. Use "DIRECT" when you have a direct business relationship with the ad network - meaning you work directly with them to sell your ad inventory. Use "RESELLER" when the platform is authorized to sell your ad space but doesn't have a direct relationship with you (they're reselling through another platform). Getting this right helps prevent domain spoofing and ensures buyers can properly verify your authorized sellers.
Can I automatically download my ads.txt file from Google AdSense?
Yes! Google AdSense makes it easy to get started. In your AdSense dashboard, navigate to Sites, click the down arrow, and look for "Create an ads.txt file for..." option. You can then click download to get a basic ads.txt file with Google already listed as an authorized seller. However, if you work with other ad networks beyond Google, you'll need to manually create additional entries for those authorized digital sellers.
How often should I update my ads.txt file to keep it up to date?
You should review and update your ads.txt file whenever you add or remove advertising partners. This means checking it quarterly at minimum, though we recommend monthly reviews to ensure it's properly formatted and includes all your current authorized sellers. An outdated file can prevent legitimate buyers from bidding on your ad inventory, directly impacting your ad revenue.
What happens if my ads.txt file isn't formatted correctly?
If your txt file has formatting errors, advertising systems might not be able to read it properly, which means they'll avoid bidding on your inventory to prevent potential ad fraud. Common formatting issues include extra spaces, missing commas, or incorrect domain names. Always validate your file after making changes to ensure your authorized parties are properly listed and buyers can access the relevant information they need.
Do I need to include every single ad network I work with?
Yes, you should include every advertising platform and ad exchange that you want to authorize to sell your ads. This includes direct partnerships, programmatic platforms, and any reseller relationships. Missing even one authorized seller from your file means buyers might not bid on inventory sold through that platform, potentially reducing your overall ad revenue.
Can I add comments or notes to my ads.txt file?
While the basic ads.txt format is just comma-separated values, you can add comments using the # symbol at the beginning of a line. However, keep it simple - the file should primarily contain your authorized sellers list. Each line should either be a valid seller entry or a comment, and make sure any comments don't interfere with the proper implementation of seller authorizations.
What should I do if I'm getting ads.txt errors in my advertising accounts?
First, check that your file is accessible at your root domain (yoursite.com/ads.txt). Then verify that each line is formatted correctly with the right domain, account ID, relationship type (DIRECT or RESELLER), and optional TAG ID. Use online validators to check your file, and don't hesitate to contact your advertising partners - they can often provide you with the exact line you need to paste into your file.
How does ads.txt help prevent counterfeit inventory and domain spoofing?
Ads.txt creates transparency in the programmatic advertising ecosystem by allowing buyers to verify that they're purchasing legitimate ad inventory from authorized sellers. When someone tries to create counterfeit inventory using your domain, buyers can check your ads.txt file and see that the unauthorized seller isn't listed, helping them avoid bidding on fake inventory and protecting your site's reputation.
Should I work with a partner to manage my ads.txt file?
Managing ads.txt files might seem straightforward, but getting every detail right is crucial for maintaining your ad revenue flow. Many publishers find it beneficial to work with ad tech partners who can handle the technical details, ensure proper implementation, and keep files updated as advertising relationships change. This is especially valuable if you work with multiple advertising platforms or don't have dedicated web development resources on your team.


