Is there any way to insert domains/ads.txt in discourse?

(Chaudhary) #1

i am facing problems with google adsense impressions and pageviews since 18th december, google adsense reccomnds me to place a code in root of my domain/ads.txt. Which is actually my discourse domain. Please help me to fix it.


Can you tell us more about the problems?

(Chaudhary) #3

adsense and dfp sent me email to on 14th december that, there should be ads.txt file in your root, to deliver ads. Since its not possible in discourse to serve a static file by uploading in the root. How can i make this file and bypass rails to this file with app.yml ? i am trying from several days, but can not figureout how. Adsense stopped serving ads on my site.

content of file must be, pub-9628762020000018, DIRECT, f08c47fec0942fa0

(Rafael dos Santos Silva) #4

What’s the plugin you use for ads?

Google AdSense Plugin maintainers said they will implement this soon.

As for our official plugin since Google will only start asking for ads.txt for subdomains sometime in 2018, we will get to that at some point too.

(Chaudhary) #5

i do not use any plugin for adsense. I read that thread about ads.txt. But its still not implimented. I need help now, because my ads are not serving. Help please. google is asking for ads.txt who use adsense with dfp. and i have no other option than ads.txt.

(Jay Pfaffman) #6

What did you do in order to get discourse to serve the ads? Are you self hosted? You don’t see any plugins on the admin plugin page?

(Chaudhary) #7

i insert ads in cooked posts, with an sql query, every 24 hours, automatically. Because ads inside the content are more benefitial. One ad unit i keep before header in theme customization.

(Jay Pfaffman) #8

Then in the spirit of that solution, what you’d want to do is edit the nginx config files and insert code to serve the file you need.

(Chaudhary) #9

i can not get how to touch the /etc/nginx/config.d/discourse.conf with app.yml… what nginx block should i make.

(Jay Pfaffman) #10

Look in the samples directory in discourse _docker

(Penar Musaraj) #12

TIL you can easily do this in Admin > Customize > Permalinks.

Would look like this: