Posts tagged with google-ads-api

I need to use Python in Google Colab to dismiss recommendations from many managed Google Ads accounts using the Google Ads API. I have been using the docs and the GitHub examples to build my code and it has worked to an extent. I have been able to retrieve recommendations with their resource names, but I have not been able to dismiss the recommendations. It seems there is an error getting the DismissRecommendationOperation.

Here is the code (with sensitive info redacted) and error message:

client = GoogleAdsClient.load_from_storage("google-ads.yaml.txt", version="v10") customer_id = "XXXXXXXXXX" recommendation_id = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" rec_service = client.get_service("RecommendationService") operation = client.get_type("DismissRecommendationOperation") operation.resource_name = recommendation_service.recommendation_path(     customer_id, recommendation_id ) response = rec_service.dismiss_recommendation(     customer_id=customer_id, operations=[operation] ) print(     "Dismissed recommendation with resource name: "     f"'{response.results[0].resource_name}'." ) 
--------------------------------------------------------------------------- AttributeError                            Traceback (most recent call last) /usr/local/lib/python3.7/dist-packages/google/ads/googleads/client.py in get_type(self, name, version)     440             type_classes = self._get_api_services_by_version(version) --> 441             message_class = getattr(type_classes, name)     442         except AttributeError: 2 frames AttributeError: unknown type 'DismissRecommendationOperation'. During handling of the above exception, another exception occurred: ValueError                                Traceback (most recent call last) /usr/local/lib/python3.7/dist-packages/google/ads/googleads/client.py in get_type(self, name, version)     442         except AttributeError:     443             raise ValueError( --> 444                 f"Specified type '{name}' does not exist in "     445                 f"Google Ads API {version}"     446             ) ValueError: Specified type 'DismissRecommendationOperation' does not exist in Google Ads API v10 

I have been using the docs here: https://developers.google.com/google-ads/api/docs/recommendations and the GitHub example here: https://github.com/googleads/google-ads-python/blob/23b6342914b49fa50e1c82b67f6508d2ac721787/examples/recommendations/dismiss_recommendation.py

Thank you so much for your help!

I am working on a project to convert Python code that's using the soon-to-be-discontinued Adwords API to the new version Google Ads API v10.

I have a query that needs a few metrics, but when I use the main customer ID that works to connect, I get REQUESTED_METRICS_FOR_MANAGER error saying I need to "issue separate requests against each client account under the manager account".

How do I generate a client account to do this? I haven't seen any examples of this step.

Thanks much!

So I'm trying to get raw google ads user data (including events, journeys etc), which i need to send to a Data-Warehouse.

Data From all my sources are send to Google Analytics & then to Data-Warehouse.

What i need is the RAW-Hit/Session level data that Google-Ads Monitor via Campaigns (from my account) to my Data-Warehouse directly, without any intermediate services.

Services like stitch-data does it directly, what all options do we have.

Thank you.

I am following this guide but it seems depricated? Or please correct me if I'm wrong. There is no kotlin version. I am implementing this part, where we get keyword ideas from API call

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

But after implementing it I am stuck on a piece of sending parameters. Could you please guide me on where can I get these parameters below