Invalid Customer ID Error on generateKeywordIdeas Request

138 views
Skip to first unread message

Hero Team

unread,
Oct 4, 2024, 10:04:53 PM10/4/24
to Google Ads API and AdWords API Forum

Hi Google Ads API Team,

I'm currently working with the Google Ads API (JavaScript/Node.js client) and trying to generate keyword ideas using the KeywordPlanIdeaService. However, I'm encountering a persistent error: Invalid Customer ID ''.

Here's the situation:
  • I have basic access to the Google Ads Developer API, and I'm using a client account ID that is not a manager account (MCC) or a test account.
  • The client account ID I'm using is 3877686113, which is a regular client account, not part of any test or sandbox environment.
  • I am authenticating through a Google Ads Manager account (4138760923), and I’ve ensured that the refresh token and OAuth credentials are valid.
  • The OAuth token has the necessary scope: https://www.googleapis.com/auth/adwords.

Despite passing what I believe to be correct values for the client account ID and refresh token, I keep encountering this error when trying to call the generateKeywordIdeas method.

Request Details:

Here's the request I'm making to the KeywordPlanIdeaService:

{ "customerId": "3877686113", // Client account ID "language": "1000", // English language code "geoTargetConstants": ["geoTargetConstants/2840"], // US location code "keywordPlanNetwork": "GOOGLE_SEARCH_AND_PARTNERS", "keywordSeed": { "keywords": ["running shoes", "sports shoes"] } }

Error:

When I run the request, I get the following error:

Google Ads API Error: {
  "errors": [{
    "error_code": {
      "request_error": "INVALID_CUSTOMER_ID"
    },
    "message": "Invalid customer ID ''"
  }],
  "request_id": "uiI2_yxjJIgkP9t4MkdgLQ"
}

What I Have Checked:
  1. The client account ID (3877686113) is not a manager account or test account.
  2. I have basic developer access to the Google Ads API.
  3. The refresh token is valid and has the correct scope (https://www.googleapis.com/auth/adwords).
  4. The manager account ID (4138760923) is used for login, and the client account ID is used for the actual request.
My Question:
  • Why am I receiving this Invalid Customer ID error despite using a valid client account ID?
  • Is there something specific about basic access or my request structure that might be causing this issue?
  • Are there any restrictions or special conditions when calling generateKeywordIdeas from a manager account on behalf of a client account?

Any help or insights you can provide would be greatly appreciated!

Thank you in advance for your assistance.

Hero Team

unread,
Oct 7, 2024, 1:08:24 PM10/7/24
to Google Ads API and AdWords API Forum
Hello, 

Any update on this? Really need to understand the problem.

Google Ads API Forum Advisor

unread,
Oct 7, 2024, 2:53:14 PM10/7/24
to he...@herospace.app, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

As per your query, I understand you are getting Invalid customer Id, when querying the data. I have tried the query provided and while passing the parameter 'language' the 'languageConstants/{criterion_id}' is required.
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vGcPu:ref" (ADR-00270712)

Thanks,
 
Google Logo Google Ads API Team

 

Hero Team

unread,
Oct 7, 2024, 3:02:18 PM10/7/24
to Google Ads API and AdWords API Forum
I did this and still got
Google Ads API Error: Rg {
  errors: [ Dg { error_code: [g], message: "Invalid customer ID ''." } ],
  request_id: 'Rv8KIdElwEMz_GmgG6vWYg'

Hero Team

unread,
Oct 7, 2024, 3:04:36 PM10/7/24
to Google Ads API and AdWords API Forum
This is my request

  const request = {
      customerId: customerService.customerOptions.customer_id, // Correct client account ID
      language: "languageConstants/1000", // English language code
      geoTargetConstants: [`geoTargetConstants/${locationCode}`], // Location code
      keywordPlanNetwork: "GOOGLE_SEARCH_AND_PARTNERS", // Use search network
      keywordSeed: {
        keywords: seedKeywords, // The seed keywords
      },
    };

Hero Team

unread,
Oct 7, 2024, 3:11:06 PM10/7/24
to Google Ads API and AdWords API Forum
locationCode being "2840"

Hero Team

unread,
Oct 7, 2024, 9:01:11 PM10/7/24
to Google Ads API and AdWords API Forum
Hello?

Google Ads API Forum Advisor

unread,
Oct 8, 2024, 3:38:18 AM10/8/24
to he...@herospace.app, adwor...@googlegroups.com
Hi,

After checking your MCC account '4138760923', I have observed that the client account '3877686113' is not linked with your MCC account and also you are using the developer token of the specified MCC account for executing the generateKeywordIdeas

To avoid the 'Invalid Customer ID' error, I would suggest to link your client account with your MCC account. If you are trying to link using Google Ads UI, kindly refer to the Manager accounts (MCC): Link accounts to your manager accounts. If you are trying to link using Google Ads API refer to the code sample of Link Manager To Client and Linking to Manager Accounts for more information.
Reply all
Reply to author
Forward
0 new messages