Another ways instead of Google AdMob

Hi all,

I’ve been trying to use AdMob in a project here. But I’m facing problems when I put the prod key in the app and ask to AdMob to verify it. The app is already published in Google Play Store, put the app-ads.txt in my site, etc, etc, but nothing solves the problem. Furthermore, Google’s customer service doesn’t help me with practically anything. Given the above, have any of you ever done a Flutter project where you have your own spaces for ads within the app?

I use Google AdMob primarily because they pay well, but they are unreliable and annoying, cutting your payment for no reason. As a backup, I use Unity Ads , which is the only that works fine in Flutter and my country [<O>], but they pay way less (it’s just a backup in case Google fails to display ads).

I’ve build an abstract Ads widget that will try to show Google Ads, if that fails, it tries to show Unity Ads, if that fails, it shows a banner saying “Hey! You can pay USD 0.17 to stop seeing ads”. Also, this widget is able to get a config from Firebase Remote Config to show custom banners, when I get some customers that wants to display ads on my app.

What problem you are having with Google Ads exactly? Maybe I can help.

2 Likes

@evaluator118 thanks for your answer. The problem is not with Flutter itself, but with Google AdMob. That’s why I’m worried about posting this here, since this is a Flutter group.
But since you asked what’s going on, I’ll try to describe it as succinctly as possible:
I created the app in Flutter and sent it to the Google Play Store, using my company developer account and after all the necessary tests and period, it was approved. In the app I am using Google AdMob and to test I used the test key. Once it was on the Play Store, I created a personal Google AdMob account and linked the app there.
Within Google AdMob they ask you to indicate the app so they can validate, they ask you to create the app-ads.txt file and place it in the main folder of your website and this is done. But when I check the app on Google AdMob, the message always appears:
“You may have set up an app-ads.txt file, but its details don’t match the information in your AdMob account.” But the file is there, it is configured correctly and Google AdMob does not provide any further details on what I should check, other than what they said. This is very frustrating. That’s why I asked if I can’t use AdMob, what options have you used.

Thanks in advance

Go to your AdMob console (admob.google.com), then click on your avatar. It will show your Publisher ID (something like pub-059xxxxxxxxxx028)

Now, using a browser, type the URL of your app-ads.txt.

The first line is something like this?

google.com, pub-059xxxxxxxxxx028, DIRECT, f08xxxxxxxxxxfa0

That pub-xxx must be the same. Also, in the console, open your app and go to Ad settings (last option). That ca-app-pub-xxx~xxx must be present in your Android manifest (and also on your iOS plist). Notice that this id has a tilde (~) in it. This is your APP ID.

In the console, apps, ad units, you’ll see a similar code for each ad unit (this time, is the same code, but without the tilde (~), it has a / only (the first part is always the same). That should match as well.

So, basically:

Your app ID must be the same on AdMob and on your app configuration (android/app/src/main/AndroidManifest.xml):

<meta-data
  android:name="com.google.android.gms.ads.APPLICATION_ID"
  android:value="ca-app-pub-059xxxxxxxxxx028~93xxxxxx15" />

In your ios/Runner/Info.plist:

<key>GADApplicationIdentifier</key>
<string>ca-app-pub-059xxxxxxxxxx028~11xxxxxx13</string>

(Notice both are your app id, with tilde (~) and they match only in the number before the ~ (this is your publisher id, the other side is your app id, which may not be the same for Android and iOS)

And finally, your app-ads.txt that have the same pub-number (without the ~)

ca-app-pub-xxxxx~yyyyy
pub-xxxxx
ca-app-pub-xxxxx/zzzzz

xxx = Your ID
yyy = Your app ID
zzz = Your Ad Unit ID

@evaluator118 thank you for your time. Yes, I already done everything you posted, but with no success. We decided cut off this option and decide about it later.

Thank you!!