Posts tagged with google-ads-api

python3.8

My code:

from googleads import adwords def execute_request():     adwords_client = adwords.AdWordsClient.LoadFromStorage(path="google_general/googleads.yaml")     campaign_service = adwords_client.GetService('CampaignService', version='v201809')     pass context["dict_list"] = execute_request() 

Traceback:

Traceback (most recent call last):   File "/home/michael/pycharm-community-2019.3.2/plugins/python-ce/helpers/pydev/_pydevd_bundle/pydevd_xml.py", line 282, in frame_vars_to_xml     xml += var_to_xml(v, str(k), evaluate_full_value=eval_full_val)   File "/home/michael/pycharm-community-2019.3.2/plugins/python-ce/helpers/pydev/_pydevd_bundle/pydevd_xml.py", line 369, in var_to_xml     elif hasattr(v, "__len__") and not is_string(v):   File "/home/michael/PycharmProjects/ads3/venv/lib/python3.8/site-packages/googleads/common.py", line 694, in __getattr__     raise googleads.errors.GoogleAdsValueError('Service %s not found' % attr) googleads.errors.GoogleAdsValueError: Service __len__ not found Unexpected error, recovered safely. 

googleads.yaml about logging

logging:   version: 1   disable_existing_loggers: False   formatters:     default_fmt:       format: ext://googleads.util.LOGGER_FORMAT     handlers:       default_handler:         class: logging.StreamHandler         formatter: default_fmt         level: DEBUG     loggers:     # Configure root logger       "":       handlers: [default_handler]       level: DEBUG 

I've just started studying the API. Namely, I'm trying to execute my first request (https://developers.google.com/adwords/api/docs/guides/first-api-call#make_your_first_api_call)

Could you help me with this problem? At least how to localize it more precisely.

I am trying to connect to google api using REST API URL so that I can integrate the same with Apigee. But when I tried the below I am getting 404 not found response. Please advice

import requests headers = { 'Authorization': 'Bearer access token', 'developer-token': 'xxxxyyyy', } response = requests.get('https://googleads.googleapis.com/v2/customers/<customerid>/campaigns', headers=headers) 

I have a google ads script which is failing with the following error.

TypeError: Cannot find default value for object. 

It seems fairly cryptic so im not sure what its referring to.

This is the line that its failing on:

var adOperation = adGroup.newAd().expandedTextAdBuilder()   .newAd()   .expandedTextAdBuilder()   .withHeadline1(expandedTextAd.getHeadline1())   .withHeadline2(expandedTextAd.getHeadline2())   .withDescription1(expandedTextAd.getDescription1())   .withPath1(expandedTextAd.getPath1())   .withPath2(expandedTextAd.getPath2())   .withTrackingTemplate(expandedTextAd.getTrackingTemplate())   .withFinalUrl(expandedTextAd.getFinalUrl())   .build(adGroup); 

I've checked adGroup is set and it is, not sure where to go from here.

Update:

I split the line in to each method call and the line which is failing is line 1

> var adOperation = adGroup .newAd() .expandedTextAdBuilder() 

We have applied for developer token in 2013 and have been using it to call all Google Adwords APIs [v201809]. Recently we have decided to add a new feature which requires a different Adwords API (TargetingIdeaService).

We are not sure what permission access level (https://developers.google.com/adwords/api/docs/access-levels#permissible_use) our developer token has and whether we can use our existing token to call this API feature.

Any idea how to find that out?

AdWords & Analytics Cookie Errors

Despite enabling Samesite flags per this documentation, we’re still seeing errors from sites including “adwords.google.com,” and “analytics.google.com.”

According to the documentation & warning messages we’ve received, we believe the Samesite attribute adjustment needs to be made on the Google end.

It’s specifically the Google-property sites like AdWords & Analytics that are leading us to believe that this may be the case. Can someone help us to either confirm or deny this theory?