INVALID_CUSTOMER_ID while accessing KeywordPlanIdeaService

87 views
Skip to first unread message

Ajay Balgovind Kuril

unread,
Apr 27, 2023, 8:58:31 AM4/27/23
to Google Ads API and AdWords API Forum
Hi I am getting invalid customer id error, traceback is as follows: 
please let me know the reason as customer id is correct
keyword_ideas = keyword_plan_idea_service.generate_keyword_ideas(
  File "/usr/local/lib/python3.9/site-packages/google/ads/googleads/v13/services/services/keyword_plan_idea_service/client.py", line 436, in generate_keyword_ideas
    response = rpc(
  File "/usr/local/lib/python3.9/site-packages/google/api_core/gapic_v1/method.py", line 113, in __call__
    return wrapped_func(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/google/api_core/grpc_helpers.py", line 72, in error_remapped_callable
    return callable_(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/grpc/_interceptor.py", line 247, in __call__
    response, ignored_call = self._with_call(request,
  File "/usr/local/lib/python3.9/site-packages/grpc/_interceptor.py", line 290, in _with_call
    return call.result(), call
  File "/usr/local/lib/python3.9/site-packages/grpc/_interceptor.py", line 146, in result
    raise self._exception
  File "/usr/local/lib/python3.9/site-packages/grpc/_interceptor.py", line 274, in continuation
    response, call = self._thunk(new_method).with_call(
  File "/usr/local/lib/python3.9/site-packages/grpc/_interceptor.py", line 301, in with_call
    return self._with_call(request,
  File "/usr/local/lib/python3.9/site-packages/grpc/_interceptor.py", line 290, in _with_call
    return call.result(), call
  File "/usr/local/lib/python3.9/site-packages/grpc/_interceptor.py", line 146, in result
    raise self._exception
  File "/usr/local/lib/python3.9/site-packages/grpc/_interceptor.py", line 274, in continuation
    response, call = self._thunk(new_method).with_call(
  File "/usr/local/lib/python3.9/site-packages/grpc/_interceptor.py", line 301, in with_call
    return self._with_call(request,
  File "/usr/local/lib/python3.9/site-packages/grpc/_interceptor.py", line 287, in _with_call
    call = self._interceptor.intercept_unary_unary(continuation,
  File "/usr/local/lib/python3.9/site-packages/google/ads/googleads/interceptors/exception_interceptor.py", line 99, in intercept_unary_unary
    self._handle_grpc_failure(response)
  File "/usr/local/lib/python3.9/site-packages/google/ads/googleads/interceptors/exception_interceptor.py", line 71, in _handle_grpc_failure
    raise self._get_error_from_response(response)
google.ads.googleads.errors.GoogleAdsException: (<_InactiveRpcError of RPC that terminated with:
        status = StatusCode.INVALID_ARGUMENT
        details = "Request contains an invalid argument."
        debug_error_string = "UNKNOWN:Error received from peer ipv4:142.251.42.106:443 {grpc_message:"Request contains an invalid argument.", grpc_status:3, created_time:"2023-04-27T18:14:12.833278+05:30"}"
>, <_InactiveRpcError of RPC that terminated with:
        status = StatusCode.INVALID_ARGUMENT
        details = "Request contains an invalid argument."
        debug_error_string = "UNKNOWN:Error received from peer ipv4:142.251.42.106:443 {grpc_message:"Request contains an invalid argument.", grpc_status:3, created_time:"2023-04-27T18:14:12.833278+05:30"}"
>, errors {
  error_code {
    request_error: INVALID_CUSTOMER_ID
  }
  message: "Invalid customer ID \'\'."
}
request_id: "d6nJi-4xxCBMqqBJh6MU3w"
, 'd6nJi-4xxCBMqqBJh6MU3w')

Ajay Balgovind Kuril

unread,
Apr 28, 2023, 3:23:28 AM4/28/23
to Google Ads API and AdWords API Forum
Any update?

Ajay Balgovind Kuril

unread,
Apr 28, 2023, 9:24:36 AM4/28/23
to Google Ads API and AdWords API Forum
Hey I have not received any update, i am working on a priority task here.

Google Ads API and AdWords API Forum

unread,
Apr 28, 2023, 11:16:39 AM4/28/23
to Google Ads API and AdWords API Forum
Re-posting the last inquiry (https://groups.google.com/g/adwords-api/c/NQ3T1TnYm08from the forum as it wasn't routed to our support queue.

Regards,
Google Ads API Team

Google Ads API and AdWords API Forum

unread,
Apr 28, 2023, 11:27:01 AM4/28/23
to Google Ads API and AdWords API Forum
Hi,

Thank you for reaching out to our team.

Regarding your concern, it appears that this is about the INVALID_CUSTOMER_ID error. The said error means that the customer ID is invalid. That said you may check your specified CID in your request.

In order for our team to better check and investigate this issue on our end, can you provide the complete request and response logs with request ID and request header generated on your end.

Note that these logs can be requested or provided to the developer handling the Google Ads API transactions when logging of the API requests has been enabled. You may check here and click your client library for the specific guideline to enable it.

Regards,
Google Ads API Team

Ajay Balgovind Kuril

unread,
Apr 30, 2023, 6:41:57 AM4/30/23
to Google Ads API and AdWords API Forum
Hi ,
Sharing logs here, have removed credentials due to company policies.
[nltk_data]   Package stopwords is already up-to-date!
-------- {'developer_token': '-XXXX', 'refresh_token': '1//XXXXXX-XXXX', 'client_id': 'XXXXXXXXXXXXXXXXXXXXX', 'client_secret': 'XXXXXX-XXXXXXX', 'use_proto_plus': False, 'login_customer_id': '9237865946'}
Request made: ClientCustomerId: , Host: googleads.googleapis.com, Method: /google.ads.googleads.v13.services.KeywordPlanIdeaService/GenerateKeywordIdeas, RequestId: bAjMOKyHSBEgff1RSaJwiA, IsFault: True, FaultMessage: Invalid customer ID ''.
Traceback (most recent call last):
  File "/Users/admin/Desktop/Ajay/Youtube_API/colabnotebook_f/colabnotebook/driver.py", line 29, in <module>
    getkeywords(site, input_keywords_list)
  File "/Users/admin/Desktop/Ajay/Youtube_API/colabnotebook_f/colabnotebook/driver.py", line 20, in getkeywords
    google_df = get_df(input_keywords_list, site, 'Direct (Product Keywords)')
  File "/Users/admin/Desktop/Ajay/Youtube_API/colabnotebook_f/colabnotebook/search_volume_puller.py", line 270, in get_df
        debug_error_string = "UNKNOWN:Error received from peer ipv4:142.250.199.170:443 {created_time:"2023-04-30T16:05:51.695222+05:30", grpc_status:3, grpc_message:"Request contains an invalid argument."}"
>, <_InactiveRpcError of RPC that terminated with:

        status = StatusCode.INVALID_ARGUMENT
        details = "Request contains an invalid argument."
        debug_error_string = "UNKNOWN:Error received from peer ipv4:142.250.199.170:443 {created_time:"2023-04-30T16:05:51.695222+05:30", grpc_status:3, grpc_message:"Request contains an invalid argument."}"

>, errors {
  error_code {
    request_error: INVALID_CUSTOMER_ID
  }
  message: "Invalid customer ID \'\'."
}
request_id: "bAjMOKyHSBEgff1RSaJwiA"
, 'bAjMOKyHSBEgff1RSaJwiA')
The content of this email including any attachment(s) is confidential and intended for the recipient(s) specified in this message only. This message and/or any attachment(s) may be privileged or otherwise protected as per applicable laws. It is strictly forbidden to make copies of or share any part of this message including any attachment(s)  with any third party, without a written consent of the sender. If you received this message by mistake, please reply to this message and let us know and delete the email and any attachment(s) from your system.

Ajay Balgovind Kuril

unread,
May 2, 2023, 3:06:03 AM5/2/23
to Google Ads API and AdWords API Forum
Have shared logs still no response, any update?

Google Ads API Forum Advisor

unread,
May 2, 2023, 12:57:29 PM5/2/23
to adwor...@googlegroups.com

Hi,

Thank you for your response. However, the error stack trace you provided are not enough for us to further investigate. Can you please provide the complete request and response logs with request ID and request header generated on your end? You may check the links below for reference on how these information looks like. Kindly make sure to send these to us using Reply privately to author option. I've noticed that the "logs" you sent still reflected in the public forum.

You may also check here and click your client library for the specific guideline to configure logging. I also suggest that you double check the customer ID that you are passing in your code because based from the error, the customer ID that you are using is invalid. If you are using Python, here's a sample code to generate keyword ideas.

Reference links:

    Zeyuan Gu

    unread,
    May 2, 2023, 8:31:31 PM5/2/23
    to Google Ads API and AdWords API Forum
    Hi Ajay,

    I came across your question on the Google Ads API forum. You asked some intriguing and challengine question! Did you your "INVALID_CUSTOMER_ID" problem fixed? I bet you are constantly running into issues when developing with GAQL just like me when I first started 3.5 years ago. I am an ex-Google software engineer and I worked on Google Ads. I understand how painful it is to use the API and decided to quit Google and work on solving peoples' problem with GAQL full-time.

    I built this software called Adzviser which takes your natural language query and translates it to GAQL. You can ask questions in lines of "How much did I spend on search campaigns last month" and the results will be shown right there for you (video demo). I'm also very open to discuss literally ANY challenges that you will come across. Just keep me as point of contact if you ever run into any problems pulling data from Google Ads.

    Look forward to hearing from you.

    Zeyuan Gu
    Log Angeles, US
    Reply all
    Reply to author
    Forward
    0 new messages