Posts tagged with google-ads-api

I am creating a web platform on which we would like to let our users (many thousands) use the Google Keyword Planer tool via API to look up word statisks and also suggest new words, if possible.

From what I can read in Google's API docs you have to have an account with Google to use the KW planer. Isn't it possible to somehow use KW planer via API without have each user creating a Google Ads account? Paid or not paid.

Our new online service can of course have a hidden central Google account as long as we can provide volume searches as explained above. But it looks like Google slows down search speed if you do too many searches, and we can't have that.

I am happy for any suggestion on how to get access to the KW planer via API for large volume use. Semrush does something like this. They surely must get their data from Google.

Thanks for helping!

I am utilizing the python client library for the Google Ads API. Alls has been working as expected and all of a sudden began running extremely slow when running locally on my Mac. Ran the cProfile tool and found that this 'next_event' method from gRPC has started taking between 8-10secs per call.

Even basic usage of the API (i.e. GAQL to pull in campaign names) returns the same latency issue.

ncalls  tottime  percall  cumtime  percall filename:lineno(function)         1    8.123    8.123    8.126    8.126 {method 'next_event' of 'grpc._cython.cygrpc.SegregatedCall' objects} 

Have tried various versions of Python and the google-ads and gRPC packages. Others have ran this same code from the same repo/branch on their machines and do not experience this issue so I am trying to determine what about my environment/Mac is causing this issue.

Error while generating refresh token in google console

I am trying to generate the refresh token using desktop flow.i have successfully created client id and client secret. I am getting the consent prompt but when I allow next page it’s throwing error 127.0.0.1 site can’t be reached . I am following the documentation and using generate_refresh_token.py to generate the token . As per the doc it should work for both desktop and web app

https://developers.google.com/google-ads/api/docs/client-libs/python/oauth-web

As shown in the image admob banner ad is cut off or stretched.

If I use AdSize.banner widget does not take the entire width but shows the ad correctly. If I use full-banner the ad is stretched.

How do I get the banner to fit the full width of the screen and show the content correctly (without cut off or streached)?

class _AdBannerState extends State<AdBanner>{   BannerAd? _inlineAdaptiveAd;   bool _isLoaded = false;   AdSize? _finalSize;   @override   void didChangeDependencies() {     super.didChangeDependencies();     _loadAd();   }   void _loadAd() async {     await _inlineAdaptiveAd?.dispose();     setState(() {       _inlineAdaptiveAd = null;       _isLoaded = false;     });     // Get an inline adaptive size for the current orientation.     AdSize size = AdSize.fullBanner;     _inlineAdaptiveAd = BannerAd(       adUnitId: AdHelper.bannerAdUnitId,       size: size,       request: const AdRequest(),       listener: BannerAdListener(         onAdLoaded: (Ad ad) async {           debugPrint('Inline adaptive banner loaded: ${ad.responseInfo}');           // After the ad is loaded, get the platform ad size and use it to           // update the height of the container. This is necessary because the           // height can change after the ad is loaded.           BannerAd bannerAd = (ad as BannerAd);           _finalSize = await bannerAd.getPlatformAdSize();           // if (size == null) {           //   debugPrint(           //       'Error: getPlatformAdSize() returned null for $bannerAd');           //   return;           // }           setState(() {             _inlineAdaptiveAd = bannerAd;             _isLoaded = true;           });         },         onAdFailedToLoad: (Ad ad, LoadAdError error) {           debugPrint('Inline adaptive banner failedToLoad: $error');           ad.dispose();         },       ),     );     await _inlineAdaptiveAd!.load();   }   @override   Widget build(BuildContext context) {     return (_inlineAdaptiveAd != null && _isLoaded && _finalSize != null)         ? Expanded(             child: SizedBox(                 width: _finalSize!.width.toDouble(),                 height: _finalSize!.height.toDouble(),                 child: AdWidget(                   ad: _inlineAdaptiveAd!,                 )))         : const SizedBox(             width: 0,             height: 0,           );   }   @override   void dispose() {     _inlineAdaptiveAd?.dispose();     super.dispose();   } }