Publish app-ads.txt with Firebase Hosting. Redirection settings

807 views
Skip to first unread message

Peter Rule

unread,
Mar 29, 2021, 9:40:29 AM3/29/21
to Google Mobile Ads SDK Developers
Hi
I have successfully published my app-ads.txt with Firebase Hosting.  My AdMob accout reports that it finds it.
I also tried to configure redirection settings but without success.
Here is my firebase.json file.  Is there a problem with it?
regards Peter

{
  "hosting": {
    "public": "public",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "redirects": [
    {
      "source": "/",
      "type": 301
    }
   ]
  }
}

Mobile Ads SDK Forum Advisor Prod

unread,
Mar 29, 2021, 12:39:16 PM3/29/21
to randrd...@gmail.com, google-adm...@googlegroups.com
Hi Peter,

Thank you for bringing this question to our attention. I was able to look over your json file and as a whole it looks fine. I was comparing it to this document that we have posted. The only part I would look at more is the redirect. Not sure if that is setup properly. I was looking at it quickly and not sure if the code or something might be a bit off on that part. So I would suggest to just check that part out again. As far as the rest of it? that seems to be fine.

Regards,
Google Logo
William Pescherine
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2Eo2IK:ref

Peter Rule

unread,
Mar 29, 2021, 1:35:34 PM3/29/21
to Google Mobile Ads SDK Developers
Hi William,
Thanks for looking at this.  It is the redirect which is not working.
AdMob to crawls and verifies my app-ads.txt file.  So thats working.
I tried changing "source":"/" to "source":"https://my-firebase-project-id.web.app" but that didn't work.  When you click on Developer website in the App Store it takes you to my app-ads.txt.

firebase deploy --only hosting doesn't report any errors.
I used the link below as my guide for this.

Any ideas as to what could be wrong with the redirect?
Peter

Mobile Ads SDK Forum Advisor Prod

unread,
Mar 29, 2021, 3:23:48 PM3/29/21
to randrd...@gmail.com, google-adm...@googlegroups.com
Hi Peter,

Thank you for responding back. As ou will see by the link that I posted mine is from firebase and yours is the app reseller. You could play around with the hosting: and change it from "public" to "dist/app" but admittedly not sure if that will matter. As it is suggested to use the public.

As I am looking at this more. the "destination" his a slight bit different as it is missing the "/" at the start of the URL which could be causing the misdirect. Also I would suggest looking into these 2 the "source",v it is just redirecting from "/" when it needs to know where is is really redirecting from. The "/" seems maybe too generic?

Peter Rule

unread,
Mar 30, 2021, 4:58:15 AM3/30/21
to Google Mobile Ads SDK Developers
Hi William,
I have noticed that the marketing URL in the App Store is https://my-firebase-project-id.web.app/app-ads.txt not https://my-firebase-project-id.web.app as per the guidelines.
I will need to upload a new app version to change the marketing URL.  I will give it a go and let you know.
Peter

Peter Rule

unread,
Mar 31, 2021, 11:36:50 AM3/31/21
to Google Mobile Ads SDK Developers
Hi William,
I changed the marketing URL in the App Store to https://PROJECT_ID.web.app as per the guidelines. Where PROJECT_ID is my Firebase project.  The Admob app-ads.txt crawl still works fine but it still dosen't redirect.  Can you see anything wrong with my code?
It seems identical to whats in the documentation.
Regards
Peter

{
  "hosting": {
    "public": "public",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "redirects": [ {
      "source": "/",
      "destination": "https://randrdevelop.com",
      "type": 301
    } ]
  }
}

Mobile Ads SDK Forum Advisor Prod

unread,
Mar 31, 2021, 2:53:49 PM3/31/21
to randrd...@gmail.com, google-adm...@googlegroups.com
Hi Peter,

Thank you for the update. I have been looking over this and just do not see anything that could be causing the issue with the redirect. As such allow me to bring this to my team to look at and see if there is something that we are just missing.

Mobile Ads SDK Forum Advisor Prod

unread,
Apr 5, 2021, 8:24:15 PM4/5/21
to randrd...@gmail.com, google-adm...@googlegroups.com
Hello all,

For anybody following this thread, the debugging was taken off the forum thread, and Peter was able to get it working based on the previously shared code. It might have been some caching issue.

Thanks,
Eric, Mobile Ads SDK Team

ref:_00D1U1174p._5004Q2Eo2IK:ref
Reply all
Reply to author
Forward
0 new messages