ads.txt

How to manage ads.txt file with a new feature

Add the ads.txt content independently

1. Login to your cms panel and open the "Configuration Editor" Module.

2. Search the ads_list key.

If the key is not present, add it.

Fill the fields in this way:

- Attributes: ads_list

- Value: the content that must have the ads.txt file

- Channel ID: Reference channel ID.
Leave "0" if you want to insert a generic file (or if there is only one channel on the platform)

- Domain ID: Reference Domain ID.

Leave "0" if the reference channel has only one domain.




If the key is already present and you want to edit it, click the icon on the right and edit the necessary data in the part below.

HOW IT WORKS


We created a redirect for the path "/ads.txt" that dispatches the requests on a file called ads.jsp.


This jsp file gets the configuration keys with name "ads_list" that can be set up both for specific channel (by entering the id of the channel) and generic use (by leaving "0" as Channel ID value), as explained above.

This file works simply and it has only 3 different cases:

- If in Configuration Editor there aren't both the specific and the generic "ads_list" it tries to take the file ads.txt from the project root.


- If in Configuration Editor there is a specific "ads_list" it takes it from the specific configuration key.


- Otherwise it tries to take the generic "ads_list" in Configuration Editor.