# Ads.txt

The ads.txt is an IAB-approved text file (opens new window) that aims to prevent unauthorized inventory sales.

Publishers drop a text file on their web servers that lists all of the companies that are authorized to sell the publishers’ inventory. Similarly, programmatic platforms also integrate ads.txt files to confirm which publishers’ inventory they are authorized to sell. This allows buyers to check the validity of the inventory they purchase.

When activating Marfeel some lines must be added to the ads.txt file of the publisher so Marfeel can monetize the inventory of the site. When activating the MarfeelCDN this is a hands-off process, the MarfeelCDN does it automatically.

ads.txt must be a unique file both for desktop and mobile and it must include all the lines the publisher needs for the desktop monetization and also all the lines required by Marfeel.

Here's an example of how an ads.txt can look like:

    # Network1 lines
    smartadserver.com, 2483, DIRECT
    indexexchange.com, 179394, RESELLER
    contextweb.com, 560288, RESELLER, 89ff185a4c4e857c
    pubmatic.com, 156439, RESELLER, 5d62403b186f2ace
    pubmatic.com, 154037, RESELLER, 5d62403b186f2ace
    rubiconproject.com, 16114, RESELLER, 0bfd66d529a55807
    openx.com, 537149888, RESELLER, 6a698e2ec38604c6
    sovrn.com, 257611, RESELLER, fafdf38b16bf6b2b
    appnexus.com, 3703, RESELLER, f5ab79cb980f11d1

    # Network 2 lines
    indexexchange.com, 179394, DIRECT, 50b1c356f2c5c8fc
    google.com, pub-4556360108841032, DIRECT, f08c47fec0942fa0
    google.com, pub-5918552270747313, RESELLER, f08c47fec0942fa0
    openx.com, 539514824, RESELLER, 6a698e2ec38604c6

# Ads.txt control

Ads.txt file is an important file that could impact the monetization. It's common that publishers update it frequently on a weekly basis while trying new ad networks and revenue streams. Every time a publisher plugs in or out a network several lines must be added or removed from the file.

The same situation happens with the Marfeel related lines. Marfeel every week tests new revenue streams and thus have the need for adding and removing lines from the ads.txt.

The dynamism of the ads.txt paradigm brings the need for full control on the ads.txt file both for the publisher and the Marfeel.

To give this control and flexibility MarfeelStudio provides a sophisticated ads.txt panel that enables both the parties to update whenever needed the file with full transparency and traceability.

# Ads.txt generation flow

The ads.txt served by Marfeel is a dynamic merge of the lines of the origin ads.txt (the physical ads.txt on the publisher servers) and the required Marfeel lines. To merge both subsets of lines several steps are required:

  1. MarfeelInsight must detect the tenant has MarfeelCDN active
  2. MarfeelInsight polls hourly the customer origin servers requesting the origin ads.txt
  3. MarfeelInsight gets the required Marfeel ads.txt lines for a given publisher based on all the SSPs and DSPs that have connected.
  4. MarfeelInsight merges the two subsets of lines removing any potential duplicity and persists the merged ads.txt
  5. MarfeelInsight validates the resulting ads.txt to detect any potential error that could damage the monetization of the publisher
  6. The resulting validated ads.txt is persisted on the tenant's repository via Leroy, this triggers a Jenkins build that copies the ads.txt file to Gutenberg's file system.

# Serving ads.txt

At any time MarfeelCDN gets a request to ads.txt the request is re-routed to Gutenberg (which serves the file as a static resource), not to the publisher's origin. This way the merged and complete version of ads.txt is served and ad revenues can be maximized.

Exception

When MarfeelMan is the user agent of the request, MarfeelCDN returns the original ads.txt file.

Example:

curl -A "MarfeelMan" https://151.101.130.207/ads.txt -H "Host:www.tenant.com" -k