Share your feedback about the Google Ads (AdWords) API. Take the 2021 AdWords API and Google Ads API Annual Survey.

Login customer ID

The login-customer-id is a new required header in Google Ads API when using a manager account to access an operating customer account. If accessing an operating customer account directly, the login-customer-id header is not required.

If the authenticated user has access to both the manager and operating customer accounts, then login-customer-id should be specified to avoid any ambiguity. Though not specifying login-customer-id would still work in this case, the context is set to the operating customer account only (which is probably not what is intended).

If you've been managing accounts with just OAuth2 credentials of a manager account, follow these steps to obtain the correct login-customer-id value:

  1. List accessible customers

    Use the ListAccessibleCustomers example to generate the list of all customers accessible using the OAuth2 credentials that you supplied. As mentioned on that page, only customers that are directly accessible will be returned. Both manager and operating customer accounts could be returned.

  2. Determine manager account hierarchy

    For each manager account returned in step 1, use the GetAccountHierarchy example to determine its accounts hierarchy.

    Note that if you run the GetAccountHierarchy example without specifying a login-customer-id, it will perform step 1 for you.

  3. Select the appropriate manager account

    If there are multiple manager accounts for a given operating customer account, select the manager account at the top of the hierarchy. This lets you maintain the same login-customer-id for multiple calls throughout the hierarchy of accounts and thereby avoid excessive switching.

    The exceptions to this rule are cases such as billing where selecting a specific manager account is necessary.