Posts tagged with google-ads-api

I need to load a Portrait Full-screen native ad.

I have set the nativeAdOptions like these
val nativeAdOptions = NativeAdOptions.Builder().setMediaAspectRatio(MediaAspectRatio.PORTRAIT).build()

and load the ad like this

AdLoader.Builder(context, adUnitId).withNativeAdOptions(nativeAdOptions) 

Even I set the MediaAspectRatio to MediaAspectRatio.PORTRAIT. I am getting landscape ads.

Is there any issue with Google Ad Manager SDK or Do I need to specify any extra AdOptions?

While authorizing my Google Ads Account using OAuth Playground to retrieve a lifetime refresh token which could used to further create access tokens, the authorization is throwing This app is blocked security error. I think this is because the GCP OAuth consent screen is not verified. But how do I verify my OAuth consent screen when I don't have an App domain name, since I'm using this as a one time activity to retrieve my refresh token using OAuth Playground?

I updated the libraries on my Xamarin Android application, and I get the following error: com.google.android.gms.internal.ads.zza is defined multiple times: obj\Debug\120\lp\107\jl\bin\classes.jar:com/google/android/gms/internal/ads/zza.class, obj\Debug\120\lp\116\jl\bin\classes.jar:com/google/android/gms/internal/ads/zza.class

Here are the libraries that collide based on the manifest files found in these folders:

  • com.google.android.gms.gass -> Xamarin.GooglePlayServices.Gass version 120.0.0.7
  • com.google.android.gms.ads.impl -> I assume it's Xamarin.GooglePlayServices.Ads version 121.3.0

Is there any thoughts how can I overcome this issue? My app does not build. I tried many version combinations, none of them helped.

I tried many version combinations, none of them helped.

I have a list of IDs that are integers. If I do print(data_clients["id"]) I get something like:

4323324234 2342342344 5464564565 

Then I want to call an API (Google Ads) that uses those numbers as IDs (to know which data to retrieve). I have to do a loop (or something similar) to get the data from each ID.

I've tried this

for id in range(data_clients["id"]):                 query = (f''' WHATEVER ''')                 stream = ga_service.search_stream(customer_id = data_clients["id"], query=query)                 list_id = [] 

With this code I get the following error:

4323324234 has type int, but expected one of: bytes, unicode 

And if I try to convert the int to Unicode or bytes (with chr or to_bytes), I get

int too big to convert 

Maybe the solution is obvious, but I'm a Python/coding beginner, so I'm pretty confused.

Any ideas? Thanks!