Search code examples
admobgithub-pagesgitlab-pages

Use gitlab/github pages to publish app-ads.txt for Admob


Admob looks for this file in the root of the pages. The problem with either gitlab or github is that you can create these pages for free, but you end up having a link like this:

https://accountName.github.io/projectName

Admob doesn't expect to have that /projectName at the end of .io and because of that, app-ads.txt is missing.

Is there any way to modify this url or change it in Admob? I guess I could by some domains but that's not what I'm looking for right now since I've got many open projects.


Solution

  • I found a free way to do this using github (maybe also avaialble following same steps in gitlab but I haven't tried).

    You need to create a new organization and specify the name of your project/website.

    Now you create a new repository for this organization and both need to have the same name plus .github.io. e.g.: myProject.github.io

    If you go now to settings --> page you'll have something like:

     Your site is ready to be published at https://myProject.github.io/
    

    So now you can have app-ads.txt at the root of your repo and it will be availble also at the root of your domain: https://myProject.github.io/app-ads.txt.

    Admob will find it ok