Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
На этом этапе вы выбираете аккаунт Google Ads, к которому будут выполняться вызовы API. Это может быть как рабочий (рабочий) аккаунт, так и тестовый. У каждого подхода есть свои преимущества и недостатки.
Производственные счета
Тестовые аккаунты
Преимущества
Легче писать и тестировать код, работающий с определенным содержимым аккаунта.
Легче писать и тестировать код, обрабатывающий данные отчетов в реальном времени.
Тестовые аккаунты не показывают рекламу, поэтому ошибки программирования не повлияют на ваши активные кампании.
Работает с токенами разработчика, имеющими уровень тестового доступа.
Недостатки
Ошибка в программировании на этапе разработки может повлиять на показ кампании в реальном времени, что приведет к таким проблемам, как низкая эффективность кампании, неправильный показ или финансовые потери.
Для выполнения вызовов API токен разработчика должен иметь как минимум базовый уровень доступа.
Вам необходимо реконструировать кампании в тестовых аккаунтах, чтобы протестировать код, который работает с определенным содержимым аккаунта.
Поскольку тестовые аккаунты не показывают рекламу, функции, связанные с показом рекламы в реальном времени, такие как отчетность по статистике, ошибки нарушения политики или обработка импорта офлайн-конверсий, не поддерживаются, что затрудняет тестирование этих функций.
Мы рекомендуем по возможности использовать тестовый аккаунт при разработке приложения. Инструкции см. в разделе Создание тестовых аккаунтов и кампаний .
Альтернативой является создание рабочей учетной записи с небольшим бюджетом, например, 1 доллар США в день, специально для тестирования функций, которые не поддерживаются тестовой учетной записью.
Выбор набора функций
При выборе учётной записи для выполнения вызовов API следует обратить внимание на список функций, которые вы хотели бы использовать с API. Даже если вы решите использовать рабочую учётную запись, некоторые функции зависят от неё, например:
Для использования функций выставления счетов вам понадобится учетная запись с ежемесячным выставлением счетов.
Некоторые новые функции аккаунта могут быть ограничены белыми списками.
Перед финализацией учетной записи, к которой будут выполняться вызовы API, проверьте документацию по конкретной функции, чтобы убедиться, что у этой функции нет дополнительных ограничений.
Определите идентификатор клиента для входа и идентификатор клиента.
Чтобы выполнить вызов API к клиенту Google Рекламы, необходимо предоставить доступ и соответствующие разрешения к вашему сервисному аккаунту клиенту напрямую или через связанный аккаунт менеджера. Для этого вам потребуется доступ администратора к аккаунту клиента.
Для начала войдите в свой аккаунт Google Ads как администратор. В некоторых случаях вам может быть доступно несколько аккаунтов клиентов. Выбранный аккаунт устанавливает идентификатор клиента для входа, который является обязательным заголовком для некоторых вызовов API.
После того как вы определили клиента Google Ads, к которому вы будете обращаться с вызовами API, обратите внимание на следующие данные:
Десятизначный идентификатор клиента, к которому вы планируете совершать API-вызовы. Иногда его называют действующим клиентом.
Десятизначный идентификатор клиента, в учётную запись которого вы вошли. Если вы вошли в учётную запись действующего клиента, идентификатор клиента совпадает с идентификатором клиента. Если вы вошли в учётную запись управляющего клиента, идентификатор клиента совпадает с идентификатором управляющего аккаунта.
Предоставить доступ к учетной записи службы
Войдя в свою учетную запись Google Ads как администратор, перейдите в раздел Администрирование > Доступ и безопасность .
Нажмите кнопку + на вкладке Пользователи .
Введите адрес электронной почты учётной записи службы в поле «Электронная почта» . Выберите соответствующий уровень доступа к учётной записи и нажмите кнопку « Добавить учётную запись» . Обратите внимание, что уровень доступа к электронной почте не поддерживается для учётных записей служб.
Учетной записи сервиса предоставлен доступ.
По умолчанию вы не можете предоставить доступ администратора учётной записи сервиса. Если для ваших вызовов API требуется доступ администратора, вы можете расширить его следующим образом.
Нажмите стрелку раскрывающегося списка рядом с уровнем доступа учетной записи службы в столбце Уровень доступа .
[[["Прост для понимания","easyToUnderstand","thumb-up"],["Помог мне решить мою проблему","solvedMyProblem","thumb-up"],["Другое","otherUp","thumb-up"]],[["Отсутствует нужная мне информация","missingTheInformationINeed","thumb-down"],["Слишком сложен/слишком много шагов","tooComplicatedTooManySteps","thumb-down"],["Устарел","outOfDate","thumb-down"],["Проблема с переводом текста","translationIssue","thumb-down"],["Проблемы образцов/кода","samplesCodeIssue","thumb-down"],["Другое","otherDown","thumb-down"]],["Последнее обновление: 2025-09-03 UTC."],[[["\u003cp\u003eChoose a Google Ads account (production or test) to make API calls, noting its email address for generating OAuth 2.0 refresh tokens.\u003c/p\u003e\n"],["\u003cp\u003eTest accounts are recommended for development to prevent affecting live campaigns; however, they don't support features related to live serving.\u003c/p\u003e\n"],["\u003cp\u003eProduction accounts, with a low budget, can be used to test features unsupported by test accounts, but a programming bug can affect live campaigns.\u003c/p\u003e\n"],["\u003cp\u003eEnsure the selected account supports the desired features as some features have account-specific restrictions.\u003c/p\u003e\n"],["\u003cp\u003eTo make API calls, you need access to the customer account, the 10-digit customer ID, email address for OAuth 2.0 token generation, and the 10-digit login customer ID.\u003c/p\u003e\n"]]],[],null,["# Prepare the customer account\n\n**Note:** The current step of this tutorial depends on the [type of application](/google-ads/api/docs/get-started/choose-application-type) you are building. We strongly recommend using service account to make API calls. However, the user authentication option is also provided as an alternative. The rest of this tutorial will be customized based on your choice. \nService accounts User authentication\n\nIn this step, you identify a Google Ads account to make API calls to. The account\ncan either be a production (live) account or a test account. Each approach has\nits advantages and disadvantages.\n\n|---------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| | ##### Production accounts | ##### Test accounts |\n| ##### Advantages | - Easier to write and test code that works against specific account contents. - Easier to write and test code that processes live reporting data. | - Test accounts *don't* serve ads, hence programming bugs won't affect your live campaigns. - Works with developer tokens that have Test Access level. |\n| ##### Disadvantages | - A programming bug in the development phase could affect live campaign serving, leading to issues such as poor campaign performance, incorrect serving, or financial losses. - The developer token should have at least the Basic Access level to in order to make API calls. | - You must reconstruct campaigns within test accounts to test code that works against specific account contents. - Since test accounts don't serve ads, features related to live serving such as reporting stats, policy violation errors, or processing offline conversion imports are not supported, making it difficult to test those features. |\n\nWe recommend using a test account while developing your application when\npossible. For instructions, see [Create test accounts and\ncampaigns](/google-ads/api/docs/best-practices/test-accounts#create).\n\nAn alternative is to set up a production account with a low account budget,\nsuch as $1/day, explicitly for testing features that are not supported by a\ntest account.\n\nChoice of feature set\n---------------------\n\nWhen choosing an account for making API call, an additional consideration is\nthe list of features you'd want to use with the API. Even if you choose to use\na production account, there are some features that are account-specific, for\nexample:\n\n- For billing features, you need an account that is on monthly invoicing.\n- Some new features in the account might be restricted by allowlists.\n\nBefore finalizing the account to make API calls against, check the\ndocumentation of the specific feature to make sure that the feature doesn't\nhave additional restrictions.\n\nIdentify the login customer ID and customer ID\n----------------------------------------------\n\nTo make an API call to a Google Ads customer, you must grant access and\nappropriate permissions to your service account to the customer account\neither directly or through a linked manager account. To do this, you need\nadministrator access to the customer account.\n\nStart by signing in to your Google Ads account as an administrator. In some cases,\nyou might have more than one customer account to choose from. The account you\nselect establishes the login customer ID, which is a required header for some\nAPI calls.\n\nAfter you've identified the Google Ads customer to make API calls to, note the\nfollowing details:\n\n- The 10-digit customer ID of the customer account to which you plan to make\n API calls against. This is sometimes referred to as the operating customer.\n\n- The 10-digit login customer ID of the customer account you're signed in to.\n If you're signed in to the operating customer, the login customer ID is the\n same as the customer ID. If you signed into a manager account of the\n operating customer, the login customer ID is the customer ID of the manager\n account.\n\nGrant access to the service account\n-----------------------------------\n\n1. While signed in to your Google Ads account as an administrator, navigate to\n **Admin \\\u003e Access and security**.\n\n2. Click the **+** button under the **Users** tab.\n\n3. Type the service account email address into the **Email** input box. Select\n the appropriate level of account access level and click the **Add account**\n button. Note that Email access level is not supported for service accounts.\n\n4. The service account is granted access.\n\nBy default, you cannot grant administrator access to a service account. If your\nAPI calls require administrator access, you can upgrade the access as follows.\n\n1. Click the drop-down arrow next to the access level of the service account\n in the **Access level** column.\n\n2. Select **Admin** from the drop-down list."]]