How do I upload ads.txt from Google Adsense in my domains root directory?

Hi Everyone - I am new to Netlify and new to website building in general, excited to be here!

I’ve published my website recently (freesolitaire.co) and I am having a problem uploading the ads.txt from AdSense into my root domain.

I didn’t create this website in Jekyll or any other static site generator. This game was developed and I have added onto the code to make the game into the website. I am very very new to this and any help would be much appreciated

hi there, how are you deploying your site? are you using drag n drop, or are you deploying from a git repo?

Hi Perry!

I am just dragging and dropping the file directly to Netlify.

hey lucas,

you can drag n drop an entire folder - so you could try adding the ads.txt to a folder and then dragging n dropping the whole thing.

let us know if this works - if yes, it’ll definitely help other people. :muscle:

Absolutely, I’ll give it a go! Does it matter which folder the ads.text is put into?

i’m not super familiar with where that file goes - i am assuming it goes in the document root, so, whichever folder your index.html is also in.

you might check google’s documentation if its unclear.

Updated on my end. I put the code in the folder with my index.html. When I did it this way the site launched incorrectly. Do I need to add the code directly in the index.html you think?

What google documentation are you referring to? I will read through it.

He said he’s not super familiar with it, so, you probably don’t have much luck here. You might try searching. Here’s one link I found: https://support.google.com/adsense/answer/7532444?hl=en. I have never used AdSense, so, I am not very knowledgeable about this topic either, but, in that link, Google says that you need to add the .txt file in your website’s root, which means, the folder in which you have your home page’s index.html. I can’t see why adding that file should break your website. Just download the file from your dashboard, copy it to your publish folder and upload the website again.

EDIT: I just went to https://freesolitaire.co/ads.txt and I got a 404. Seems like you still haven’t uploaded the required file.

Hi Hrishikesh, thank you for your help. When I follow the above instructions this is the result I am getting:

This is what my folder looks like for the site with the txt file added in:

Screen Shot 2020-10-04 at 12.22.52 PM

Why’s your index.html inside a Index folder. Technically, your website’s address now is yourdomain.com/index/. And if you’ve used relative links, it probably won’t work.

You should probably move that index.html out of the Index folder. That’s the root of your (actually most of the) website(s). If you’re using a different configuration, sorry, we probably can’t help you unless we actually see the site’s source code.