Version v8 is deprecated. Requests to this version will be blocked.

2,640 views
Skip to first unread message

Tova Schwartz

unread,
May 12, 2022, 2:34:16 AM5/12/22
to Google Ads API and AdWords API Forum
I am getting the error message of:
INFO - Request made: ClientCustomerId: -----, Host: googleads.googleapis.com, Method: /google.ads.googleads.v8.services.GoogleAdsService/Search, RequestId: -------, IsFault: True, FaultMessage: Version v8 is deprecated. Requests to this version will be blocked. 

I am using

google-api-python-client==1.7.11
google-ads==12.0.0

Where do I go to manage the version? Is related to the developer token?

Jade Nguyen

unread,
Jun 29, 2022, 6:58:01 PM6/29/22
to Google Ads API and AdWords API Forum
Happy Wednesday from Seattle,
I also received the the same message  while trying to the list of account that manage campaigns. How do I upgraded v8 to v9? In another word, what service I should use to get the list of account id? I referred to this GitHub: https://github.com/googleads/google-ads-python/blob/9541a751a2c8d8bd7abf97b0d3a9f61e0ebbcb57/examples/account_management/get_account_hierarchy.py

Here is the error detail:
"Request made: ClientCustomerId: 4719949072
, Host: googleads.googleapis.com
, Method: /google.ads.googleads.v8.services.GoogleAdsService/Search
, RequestId: DlVMhvKTYpNJIz62wPJWSw

, IsFault: True, FaultMessage:  Version v8 is deprecated. 
Requests to this version will be blocked."

Here is the script:
from google.ads.googleads.client import GoogleAdsClient
googleads_service = client.get_service("GoogleAdsService")

 query = """
            SELECT
              customer_client.id,
              customer_client.descriptive_name
            FROM customer_client
            WHERE
                customer_client.manager = False
                AND customer.test_account != TRUE
            """
# Issues a search request using streaming, including customer_id and query
   # go over each row of response, append customer id into the empty list
 response = googleads_service.search(customer_id=str(customer_id), query=query)

Google Ads API Forum Advisor

unread,
Jun 30, 2022, 2:02:20 AM6/30/22
to ngoc.ng...@gmail.com, adwor...@googlegroups.com
Hi Jade,

Thank you for posting your concern. Allow me to provide support.

I would like to suggest first using instead the latest version which is the v11. To use the said version, you will need download and configure the latest client library as well and since you are using Python, then I would suggest referring to this document.

As for your question "In another word, what service I should use to get the list of account id?", you may refer to this document as it specifies the sample implementation of service and report for retrieving account IDs from your manager account hierarchy.

Let me know if you have further questions. 

Regards,
Google Logo
Ernie John
Google Ads API Team
 


ref:_00D1U1174p._5004Q2cEiYE:ref

Jade Nguyen

unread,
Jun 30, 2022, 11:19:44 PM6/30/22
to Google Ads API and AdWords API Forum
Thank Ernie, 
I used this script of campaign performance report and was able to get the response However, when I was trying to parse this response into the panda data frame, I encountered the error. I believe that the step when I was trying to parse the response to pandas data returned the unknown error, which Google Ads interpreted as message: " Version v8 is deprecated. Requests to this version will be blocked." Is there an efficient way to parse the response to pandas dataframe? I provided more details below. Thank you for being patient with my long story.

Script:
# this worked
from google.ads.googleads.client import GoogleAdsClient
import pandas as pd
# from google.protobuf.json_format import MessageToJson, MessageToDict
from google.protobuf.json_format import MessageToDict

# credentials
credentials_dict = {'developer_token': 'XXX',
 'client_id': 'XXX',
 'client_secret': 'XXX',
 'refresh_token': 'XXX',
 'login_customer_id': 'XXX'}

client = GoogleAdsClient.load_from_dict(credentials_dict)

ga_service = client.get_service("GoogleAdsService")
search_request = client.get_type("SearchGoogleAdsStreamRequest")

query = """
    SELECT
        segments.date,
        campaign.id,
        campaign.name,
        campaign.status,

        metrics.impressions,
        metrics.clicks,
        metrics.cost_micros,

        metrics.conversions,
        metrics.interactions,
        metrics.engagements,
        metrics.ctr,

        customer.id,
        customer.descriptive_name
    FROM campaign
    WHERE
        segments.date DURING YESTERDAY
    """
customer_ids = [7988377523, 8518065321, 1556372374 ]
   
all_data = []
while customer_ids:
    customer_id = int(customer_ids.pop(0))
    search_request.customer_id = str(customer_id)
    search_request.query = query
    stream = ga_service.search_stream(search_request)
   
    for batch in stream:
        for row in batch.results:
            customer = row.customer
            customer_id = customer.id
           
            campaign = row.campaign
            campaign_id = campaign.id
            
            metrics = row.metrics
            clicks = metrics.clicks
           
            segments = row.segments
            date = segments.date
            print(date, campaign_id, clicks, cost_micros, customer_id
            ) 
# not worked with the unknown request error when I was trying to further parse the above response into pandas data frame.
            row_dict = {}
            row_dict['date'] = date
            row_dict['campaign_id'] = campaign_id
            row_dict['campaign_name'] = row.campaign.name
            row_dict['campaign_status'] = row.campaign.status

            row_dict["impressions"] = row.metrics.impressions
            row_dict["clicks"] = row.metrics.clicks
            row_dict['cost_micros'] = row.metrics.cost_micros

            row_dict["conversions"] = row.metrics.conversions
            row_dict["interactions"] = row.metrics.interactions
            row_dict["engagements"] = row.metrics.engagements

            row_dict['customer_id'] = row.customer.id
            row_dict['customer_name'] = row.customer.descriptive_name
            all_data.append(row_dict)
cpr = pd.DataFrame(all_data)
cpr.head(3)

# api response
results {
  customer {
    resource_name: "customers/7988377523"
    id: 7988377523
    descriptive_name: "XXX"
  }
  campaign {
    resource_name: "XXX"
    status: ENABLED
    name: "XXX"
    id: 1717373231
  }
  metrics {
    clicks: 0
    cost_micros: 0
  }
  segments {
    date: "2022-06-23"
  }
}

# error
GoogleAdsException: (<_SingleThreadedRendezvous of RPC that terminated with:    status = StatusCode.INVALID_ARGUMENT    details = "Request contains an invalid argument."    debug_error_string = "{"created":"@1656644641.028318815","description":"Error received from peer ipv4:142.251.33.202:443","file":"src/core/lib/surface/call.cc","file_line":903,"grpc_message":"Request contains an invalid argument.","grpc_status":3}" >, <_SingleThreadedRendezvous of RPC that terminated with:    status = StatusCode.INVALID_ARGUMENT    details = "Request contains an invalid argument."    debug_error_string = "{"created":"@1656644641.028318815","description":"Error received from peer ipv4:142.251.33.202:443","file":"src/core/lib/surface/call.cc","file_line":903,"grpc_message":"Request contains an invalid argument.","grpc_status":3}" >, errors { error_code { request_error: UNKNOWN } message: " Version v8 is deprecated. Requests to this version will be blocked." } request_id: "daGjvZa7ZeZEQo3Rl_-GAA" , 'daGjvZa7ZeZEQo3Rl_-GAA'

Google Ads API Forum Advisor

unread,
Jul 1, 2022, 1:08:09 AM7/1/22
to ngoc.ng...@gmail.com, adwor...@googlegroups.com
Hi Jade,

I am Carmela, also a member of the Google Ads API team.

Moving forward, could you first confirm if you already did the suggestion of my colleague Ernie which is using the v11? I asked this, because based on the error you have provided "Version v8 is deprecated. Requests to this version will be blocked", it is showing that you are still using the v8.

Also as for "Is there an efficient way to parse the response to pandas dataframe?", kindly note that our team can only provide support to the client libraries mentioned here. Since your concern here is more specific to the integration of the Google Ads API to an application, then I am afraid that I would not be able to provide support here as it is outside of our scope already.

Regards,
Google Logo
Carmela
Google Ads API Team
 


ref:_00D1U1174p._5004Q2cEiYE:ref

Jade Nguyen

unread,
Jul 1, 2022, 7:03:44 PM7/1/22
to Google Ads API and AdWords API Forum
Carmela,
I updated my Google Ads SDK python package to the latest version, using the command pip install google-ads (https://pypi.org/project/google-ads/#description). Note that my jupyter notebook with 3.7 version, which is aligned with what Google Ads v11 supports. Once again, I was able to get response and parse into the following format with v11. However I couldn't parse to the dataframe or csv file. Understood that you could only support any Google Ads library, but wonder if there is a way to parse the google ads response to data frame or cvs for convenience with v11.

v11 worked with printing the api response
date              campaign_id cost
2022-06-30 1717373231  0

Google Ads API Forum Advisor

unread,
Jul 4, 2022, 2:16:54 AM7/4/22
to ngoc.ng...@gmail.com, adwor...@googlegroups.com
Hi Jade,

Hope you are doing fine. Thank you for getting back to us.

Moving forward to your concern, it seems that this is more of a client library concern. That said, I would suggest reaching out to the python client library owner by posting your concern in this Issue Tab on Github as they are more equipped to guidance on this matter.

Abraham Bravo

unread,
Jul 11, 2022, 3:26:56 AM7/11/22
to Google Ads API and AdWords API Forum
good,
the api returns me:
"Version v8 is deprecated. Requests to this version will be blocked" I don't know how to update to version v9 or v10, what would be the steps to update the version?
Thank you

Google Ads API Forum Advisor

unread,
Jul 11, 2022, 4:16:36 AM7/11/22
to cafep...@gmail.com, adwor...@googlegroups.com
Hi Abraham,

This is Carmela from the Google Ads API team. Thank you for reaching out.

Moving forward, as mentioned below, version 8 was already sunset last May 11, 2022. You may check this blog post for more information. 

That being said, please see this guide as it contains the details on how to upgrade to the newest version of the Google Ads API.

Jade Nguyen

unread,
Jul 11, 2022, 2:15:47 PM7/11/22
to Google Ads API and AdWords API Forum
I was able to update v8 to v11 using Google Ads SDK and python script.
Step 1: Update your python to 3.7. 
Step 2:  pip install google-ads to get the latest Google Ads SDK, which is v11.
Step 3: Update the google-ads.yml to include use_proto_plus.
Here is the example. I use the dictionary rather than google-ads.yml file.

credentials_dict = {

'developer_token': xxx,

 'client_id': ''xxx',

 'client_secret': 'xxx',
 'refresh_token': 'xxx',
 'login_customer_id': 'xxx',

use_proto_plus: true

}

client = GoogleAdsClient.load_from_dict(credentials_dict)


Google Ads API Forum Advisor

unread,
Jul 11, 2022, 2:34:41 PM7/11/22
to ngoc.ng...@gmail.com, adwor...@googlegroups.com
Hi Jade,

Thank you for giving us the good news! Feel free to reach out for anything Ads API related.

Regards,

Google Logo
Aryeh
Google Ads API Team
 


ref:_00D1U1174p._5004Q2cEiYE:ref
Reply all
Reply to author
Forward
0 new messages