Ads.txt Setup

Ads.txt setup is required for all publishers using Ezoic. This guide will help you set up your ads.txt file to work with Ezoic's ad partners.

What is Ads.txt?

Ads.txt is a text file that publishers place on their websites to publicly declare the companies authorized to sell their digital inventory. It helps prevent unauthorized inventory sales and protects against domain spoofing.

Ads.txt Setup

To append Ezoic's ad partners to your ads.txt file, you'll need to set up a redirect. Here are several recommended methods to achieve this.

Important Notes:

  • Replace [YOUR_DOMAIN].com with your actual domain name.
  • If you need additional assistance setting up your ads.txt account, please contact Ezoic support.
1. .htaccess File Redirect

Insert the following code in your .htaccess file:

1Redirect 301 /ads.txt https://srv.adstxtmanager.com/19390/[YOUR_DOMAIN].com
2. Nginx Redirect

Add the following redirection code to your Nginx configuration:

1server {
2    location ~ /ads.txt {
3        return 301 https://srv.adstxtmanager.com/19390/[YOUR_DOMAIN].com;
4    }
5}
3. PHP Redirect

If your current ads.txt file is PHP, place this code in it:

1<?php
2header('Location: https://srv.adstxtmanager.com/19390/[YOUR_DOMAIN].com');
3exit;
4?>
4. Curl Command

If you're unable to use the above methods, you can use the following curl command to download your ads.txt file and save it to your server.

1curl -L https://srv.adstxtmanager.com/19390/[YOUR_DOMAIN].com > ads.txt
We recommend setting up a cron job to run this command at least every 24 hours in order to keep your ads.txt file up to date.

Verify Your Setup

After implementing one of these redirect methods, make sure to clear your cache and verify that your ads.txt redirect is working correctly by visiting yourdomain.com/ads.txt. If you encounter any issues or need further assistance with setting up your ads.txt redirect, don't hesitate to reach out to Ezoic's support team.

By implementing one of these redirect methods, you ensure that your ads.txt file is properly configured to work with Ezoic's ad partners. This maximizes your monetization potential while maintaining security and transparency in programmatic advertising.

Continue to the next implementation step.