Adsense is now showing warnings in sites that don't provide an ads.txt file. As per https://support.google.com/adsense/answer/7532444, it should be possible to create a file with a single line:

google.com, pub-0000000000000000, DIRECT, f08c47fec0942fa0

Comments

jcnventura created an issue. See original summary.

aharown07’s picture

Two details that may help people trying to set up their ads.txt file:

* In most cases, it should go in the site root directory
* Depending on your webserver and config, you may have to do some work to make the file crawlable.

In my case, using nginx with a setup that already included various "deny all" rules in the virtual server config (to try to keep things tight), it was necessary to add an allow statement (and some details for log management... probably optional)

   # Necessary for Google Adsense
    location = /ads.txt {
        allow all;
        log_not_found off;
        access_log off;
    }
jcnventura’s picture

  • jcnventura committed baa6bb9 on 8.x-1.x
    Issue #3059221 by jcnventura: Create ads.txt file
    
jcnventura’s picture

Status: Active » Fixed

  • jcnventura committed e05252f on 8.x-1.x
    Issue #3059221 by jcnventura: Allow other modules to alter publisher ID...
jcnventura’s picture

Version: 8.x-1.x-dev » 7.x-1.x-dev
Status: Fixed » Active

Needs a port to Drupal 7.

  • jcnventura committed ae43639 on 7.x-1.x
    Issue #3059221 by jcnventura: Create ads.txt file
    
jcnventura’s picture

Status: Active » Fixed

  • jcnventura committed 1701ca2 on 7.x-1.x
    Issue #3059221 by jcnventura: Add module dependency
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.