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

Comment #1

jcnventura created an issue. See original summary.

aharown07’s picture

Comment #2

aharown07 commented

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

Comment #3

jcnventura
Primary language English
commented

Comment #4

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

Comment #5

jcnventura
Primary language English
commented
Status: Active » Fixed

Comment #6

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

Comment #7

jcnventura
Primary language English
commented
Version: 8.x-1.x-dev » 7.x-1.x-dev
Status: Fixed » Active

Needs a port to Drupal 7.

Comment #8

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

Comment #9

jcnventura
Primary language English
commented
Status: Active » Fixed

Comment #10

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

Comment #11

Status: Fixed » Closed (fixed)

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