---
title: "How to Create an Ads.Txt File in Drupal"
description: "The Ads.txt file, which stands for Authorized Digital Sellers, is a countermeasure against fraud within programmatic advertising. This initiative, governed by the Interactive Advertising Bureau..."
url: https://www.inmotionhosting.com/support/edu/drupal/drupal-adstxt/
date: 2021-05-04
modified: 2023-09-13
author: "InMotion Hosting Contributor"
categories: ["Drupal"]
type: post
lang: en
---

# How to Create an Ads.Txt File in Drupal

The **Ads.txt** file, which stands for *Authorized Digital Sellers*, is a countermeasure against fraud within programmatic advertising. This initiative, governed by the [Interactive Advertising Bureau (IAB)](https://iabtechlab.com/ads-txt-about/), allows two important things: 

- Anyone can see which companies are authorized to sell ad inventory for a specific website
- Advertisers can ensure ad space purchases for a website aren’t counterfeit

Although it’s not commonly discussed, the standard is backed by major tech companies including Google and has been around [since 2017](https://www.adstxt.com/stats).

- [What is the Ads.Txt File](#what)
- [Install the AdsTxt Drupal Module](#install)
- [Configure Your Drupal Ads.Txt File](#config)

Ignite your online presence with cutting-edge [Drupal VPS Hosting](https://www.inmotionhosting.com/drupal-hosting). Elevate speed, security, and reliability for a seamless website experience.

## What is the Ads.Txt File

Technically speaking, the Ads.txt file is a text file with one authorized advertiser per line. The format consists of four fields, separated by commas, using the [**OpenRTB**](https://iabtechlab.com/standards/openrtb/) (real-time bidding) protocol:

- **Domain name** of the authorized company such as [supply-side platforms (SSPs) and exchanges](https://clearcode.cc/blog/ssp-and-ad-exchange-companies/)
- **Publisher account ID** of the authorized company used for OpenRTB bid requests
- **Relationship** with the authorized company (direct or reseller)
- **Certification authority ID** with [TAG](https://www.tagtoday.net/registry) (optional) 

Below we’ll cover how to do this with the [**AdsTxt**](https://www.drupal.org/project/adstxt) Drupal module.

Not what you were expecting? If you’re interested in commissions, check out our [InMotion Hosting affiliate program](https://www.inmotionhosting.com/hosting-affiliate-program).

## Install the AdsTxt Drupal Module

This is the easiest way to install the Drupal AdsTxt module.

1. [Log into Drupal](https://www.inmotionhosting.com/support/edu/drupal/how-to-log-into-the-drupal-admin-dashboard/).
2. [Install the Drupal module](https://www.inmotionhosting.com/support/edu/drupal/install-2/) using the [**AdsTxt**](https://www.drupal.org/project/adstxt) download link for your Drupal version.
3. Click **Enable newly added modules**.
4. Under *Advertising*, select **ads.txt**.
5. At the bottom, select **Install**.

## Configure Your Drupal Ads.txt File

[![Drupal Ads.txt confguration](https://www.inmotionhosting.com/support/wp-content/uploads/2021/04/drupal-adstxt.png)](https://www.inmotionhosting.com/support/wp-content/uploads/2021/04/drupal-adstxt.png)

1. On the *Configuration* page, select **Ads.txt**.
2. Replace the examples with authorized companies in your ads.txt and app-ad.txt (for mobile apps) files. 
3. If a subdomain of your Drupal site has a separate list of authorized companies, add the following (replacing the text below with your full subdomain): subdomain=subdomain.example.com
4. You can also add a contact method (email address or contact page). Anything after code#/code will be ignored:contact=advertising@example.com
5. Once you’re done, select **Save Configuration**.
6. Check your results (e.g. example.com/ads.txt) to ensure it’s not blocked by [robots.txt](https://www.inmotionhosting.com/support/website/how-to-stop-search-engines-from-crawling-your-website/) or a redirect misconfiguration resulting in a 404 error.

Learn more from our [Drupal Education Channel](https://www.inmotionhosting.com/support/edu/drupal/) as well as additional information about [Drupal site hosting](https://www.inmotionhosting.com/drupal-hosting).
