Posts tagged with google-ads-api

I get the error :

{   "message": "The caller does not have permission",   "code": 7,   "status": "PERMISSION_DENIED",   "details": [     {       "@type": "type.googleapis.com\/google.ads.googleads.v10.errors.GoogleAdsFailure",       "errors": [         {           "errorCode": {             "authorizationError": "USER_PERMISSION_DENIED"           },           "message": "User doesn't have permission to access customer. Note: If you're accessing a client customer, the manager's customer id must be set in the 'login-customer-id' header. See https:\/\/developers.google.com\/google-ads\/api\/docs\/concepts\/call-structure#cid"         }       ],       "requestId": "asds33ad3sdadad334"     }   ] } 

and the code I get from here : https://developers.google.com/google-ads/api/docs/reporting/example

what I need to do with login-customer-id ?

I've seen a slide which advises to cache with a dictionary. In which case we can even get the same budget twice? What does it save?

The API docs state that:

getBudget() Returns the budget of the campaign. In order to change the campaign's budget,  

We are using the Google Ads transfer in BigQuery to ingest our Google Ads data. One thing I have noticed when querying the results is that all of the metrics are exactly 156x of the values we would expect in the Google Ads UI (cost, clicks, etc.)

We have tested multiple transfers and each time we have this same issue. The transfer process seems pretty straight forward, but am I missing something? Has anyone else noticed a similar issue or have any ideas of what to look at to adjust in the data transfer?

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.