I'm trying to create a campaign that must target mobile devices only, using the google ads API client library in python. The documentation says that I have to modify the DeviceInfo criteria, but that attribute is immutable. This is my code rn:

campaign_service = client.get_service("CampaignService")     campaign_criterion_service = client.get_service("CampaignCriterionService")     # Create the campaign criterion.     campaign_criterion_operation = client.get_type("CampaignCriterionOperation")     campaign_criterion = campaign_criterion_operation.create     campaign_criterion.campaign = campaign_service.campaign_path(         customer_id, campaign_id     )          campaign_criterion.device = client.enums.DeviceEnum.MOBILE 

What am I missing?

I have a project whose Publishing status is Testing (I am using Google Ads Api).

            using FileStream stream = new("Credentials.json", FileMode.Open, FileAccess.Read);             // The file token.json stores the user's access and refresh tokens, and is created             // automatically when the authorization flow completes for the first time.             UserCredential credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(              GoogleClientSecrets.FromStream(stream).Secrets,              scopes,              "user",              CancellationToken.None,              new FileDataStore("Token", true)             );             if (credential.Token.IsExpired(credential.Flow.Clock))                 await credential.RefreshTokenAsync(CancellationToken.None); 

When I use the code above, it expects me to log in via Gmail, but I want to automatically handle the Refresh token and continue uninterrupted requests without understanding anything to the user. I am using Desktop Application as Flow, but I am using Net 5 Api as Framework. I look forward to your help in this matter.

Thank you from now.

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.