Posts tagged with google-ads-api

The problem is - is there a way to retrieve the ad with size of 728*90 and set it to my view which is 600*90?

The problem is that the Ad is truncated in the portrait mode while in the landscape it looks good.

Portrait:

Landscape:

I use tablet and in order to represent the Ad I use AdManagerAdView.

I found out where the problem is - the problem is that the app requests the ad with the size of (w:) 728 * (h:) 90, however, the width of the tablet is 600dp, so it is obvious that 128dp is kind of out of the screen.

I tried to check all possible ad sizes described here - https://developers.google.com/ad-manager/mobile-ads-sdk/android/banner#banner_sizes

these sizes:

            this.setAdSizes(AdSize(320, 50)) +             this.setAdSizes(AdSize(320, 100))             this.setAdSizes(AdSize(300, 250)) +             this.setAdSizes(AdSize(468, 60))             this.setAdSizes(AdSize(728, 90)) + 

However, I wasn't able to retrieve all the ads by thier sizes, I only got these:

            this.setAdSizes(AdSize(320, 50)) +             this.setAdSizes(AdSize(300, 250)) +             this.setAdSizes(AdSize(728, 90)) + 

From this point I made a conclusion that a publisher provides only these specific ads sizes. For me it means that if it is nessasary to use smaler ad that 728*90 the next size would be 300*250 which is more than twice narrowed than I need (600dp).

So the next idea was to use NativeAd (https://developers.google.com/ad-manager/mobile-ads-sdk/android/native/start), however, I get an error:

onAdFailedToLoad: {                    "Code": 3,                    "Message": "No ad config.",                    "Domain": "com.google.android.gms.ads",                    "Cause": "null",                    "Response Info": {                      "Response ID": "null",                      "Mediation Adapter Class Name": "",                      "Adapter Responses": []                    }                  } 

So as far as I undestand there is no way just to start to use NativeAd, it should be configurated on the publisher end first (as far as I see), because once I tried to made a request with the same credentials (as for AdManagerAdView), I get this config error, looks like NativeAd config is not existing on the publisher end.

So, finally the question is - is there a way to retrieve the ad with size of 728*90 and set it to my view which is 600*90?

I want to get keywords' historical metrics using google Ads API, but I must create a keyword plan and get the data, but it also has other keyword suggestions which is not needed. Currently am using keyword idea endpoint in which the given keyword is the first row with data. How to use the historical metrics endpoint without creating a keyword plan?

https://developers.google.com/google-ads/api/docs/keyword-planning/generate-historical-metrics

We use a python script to connect to Google Ads API and consume its REST operations.

All of a sudden the working script has started giving error with below message:

from google.ads.googleads.v10.enums.types import offline_user_data_job_status ModuleNotFoundError: No module named 'google.ads.googleads.v10' 

Please advise.

I have implemented a simple game for which I have added banner, interstitial and reward ads.

The banner and interstitial ads work perfectly both on test and my own google adMob adIds. However only the reward ads do not work. Even the test reward ad gives an error 3.

The code is as follows

Future<void> _loadRewardedAd() async {     if (this.mounted) {       setState(() {         loading = true;       });     }     await RewardedAd.load(         adUnitId: TestAdHelper.rewardedAdUnitId,         request: const AdRequest(),         rewardedAdLoadCallback: RewardedAdLoadCallback(onAdLoaded: (ad) {           ad.fullScreenContentCallback =               FullScreenContentCallback(onAdDismissedFullScreenContent: (ad) {             ad.dispose();             _rewardedAd = null;             widget.close(domain.Dialog.awardAd, show: false);           });           _rewardedAd = ad;         }, onAdFailedToLoad: (error) {           _rewardedAd?.dispose();           failedAttempts++;           log("failed to load reward ad $error");           failedAttempts <= 3               ? 2.seconds.delay().then((value) => _loadRewardedAd())               : null;           setState(() {             loading = false;             didntLoad = true;           });         }));   } 

and

ElevatedButton(     style: ElevatedButton.styleFrom(         minimumSize: Size(90, 60),         backgroundColor: Colors.greenAccent.shade700),     onPressed: () async {       await _loadRewardedAd().then((value) async {         await _rewardedAd?.show(             onUserEarnedReward: (_, reward) {           widget.incrementCoins();           widget.close(domain.Dialog.awardAd,               show: false);         });       });     },     child: loading         ? CircularProgressIndicator(             color: Colors.white,             backgroundColor: Colors.white38,           )         : Icon(             Icons.ondemand_video_rounded,             size: 40,           )) 

The test ID helper class uses the following IDs

static String get rewardedAdUnitId {     if (Platform.isAndroid) {       return "ca-app-pub-3940256099942544/5224354917";     } else if (Platform.isIOS) {       return "ca-app-pub-3940256099942544/1712485313";     } else {       throw UnsupportedError("Unsupported platform");     }   } 

I have tried looking up this issue but to no avail, only people agreeing that they have the same issue in threads that go as far as 2021.

I also get this error in the debug console, the number varies although 3 is the most common

I/flutter (10788): Ad with id 1 is not available for onAdFailedToLoad. I/flutter (10788): Ad with id 2 is not available for onAdFailedToLoad. I/flutter (10788): Ad with id 3 is not available for onAdFailedToLoad.

i have integrated google adsense for my client's website, ads are showing in some devices, but in some devices it showing always, particularly ads are not showing always in my client's devices,

is that any mistake i did on my google adsense account to resolve this issue, or it is the nature of google adsense?

but client's want to get ads for all devices and every time it need to show on his website,

i have tried with lots of blogs about this, everything is failed, and i'm finally here, hopefully i get a valuable knowledge here,

this is my first question on stackoverflow, if i made any mistake on it, please don't mind it, i'll correct on my future questions.

Thanks in advance.