Posts under category google-ads-api

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!

I am following this package: https://github.com/googleads/google-ads-php. Here they said that I need to run this page:

https://github.com/googleads/google-ads-php/blob/main/examples/Authentication/GenerateUserCredentials.php

to terminal.

and I did it like:

php /locaation of the fie/GenerateUserCredentials.php 

After that I can get a link which is something like that:

https://accounts.google.com/o/oauth2/v2/auth?response_type=code&access_type=offline&client_id=535777736006-d1rp8msevnls2pmihk7b8l23j3vra7duh.apps.googleusercontent.com&redirect_uri=http%3A%2F%2Flocalhost%3A3000%2Fauth%2Fcallback&state=4e23ce963534701029c1a22d2de7848d034d8b0b0&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fadwords

(Above link is demo purpose)

So, When I click on this link I redirect to my google account and give access to them and after that I redirect back to this following URL:

http://localhost:3000/auth/callback?state=fddbaae6583b15aba552f682fe9f018233388533555f&code=4%2F0AfgeXvs4NV49mrqEBrl81ATRnXhqcu9x9ja8SAbaENSWhmNejGRGkZJE_AcD1aAFWdrlGg&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fadwords

Here you can see I have 2 params which is state and code.

Now my question is how can I get the access token and refresh token using this URL?