I am trying to disable caching with zeep as is described here: https://github.com/googleads/googleads-python-lib/blob/master/README.md#how-can-i-configure-or-disable-caching

adwords_client = adwords.AdWordsClient(   developer_token, oauth2_client, user_agent,   client_customer_id=client_customer_id,   cache=googleads.common.ZeepServiceProxy.NO_CACHE) 

But I lack understanding of what I should provided ot AdWordsClient as ‘oauth2_client’ attribute.

I am trying to find the solution here http://googleads.github.io/googleads-python-lib/googleads.oauth2.GoogleOAuth2Client-class.html but without success so far.

I am using For OAuth2 process google_auth_oauthlib and I managed retrieved refresh token, but at this point I am kinda lost, because due to the fact that I am running it on GCP App Engine, I am not able to use googleads.yaml file.

Can somebody enlighten me in a case of this oauth2_client?

Thanks sincerely!

Tag:google-ads-api, google-cloud-platform, python

2 comments.

  1. Ernest Tavares

    A bit late but I found a solution to this and wanted to share with anyone who might hit this question.

    Here's where I found the solution

    You can do LoadFromStorage then disable the zeep cache:

    from googleads import ad_manager, common client = ad_manager.AdManagerClient.LoadFromStorage() client.cache = common.ZeepServiceProxy.NO_CACHE

    I spent hours trying to load using the credentials, and couldn't get it to work. This allowed me to run the module from an EC2 instance.

  2. Soni Sol

    here is an example of using Google Ads Python Client Library on an Google App Engine App.

    In this example it is explained how to do all the process for authentication considering there is no googleads.yaml

    In particular for the oauth2_client check here they generate it like this:

    oauth2credentials = client.OAuth2Credentials( None, args.client_id, args.client_secret, args.refresh_token, datetime.datetime(1980, 1, 1, 12), GOOGLE_OAUTH2_ENDPOINT, USER_AGENT)

    GOOGLE_OAUTH2_ENDPOINT is 'https://accounts.google.com/o/oauth2/token'

    and USER_AGENT is given to you in the Adwords API information

Add a new comment.