با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
در این مرحله، یک حساب Google Ads برای برقراری تماس های API شناسایی می کنید. این حساب می تواند یک حساب تولیدی (زنده) یا یک حساب آزمایشی باشد. هر رویکردی مزایا و معایب خود را دارد.
حساب های تولید
حساب های آزمایشی
مزایا
نوشتن و آزمایش کدی که در برابر محتوای حساب خاص کار می کند آسان تر است.
نوشتن و آزمایش کدی که داده های گزارش زنده را پردازش می کند آسان تر است.
حسابهای آزمایشی تبلیغاتی را ارائه نمیکنند ، بنابراین اشکالات برنامهنویسی بر کمپینهای زنده شما تأثیری نمیگذارند.
با توکن های توسعه دهنده ای کار می کند که سطح دسترسی تست دارند.
معایب
یک اشکال برنامهنویسی در مرحله توسعه میتواند بر اجرای زنده کمپین تأثیر بگذارد و منجر به مشکلاتی مانند عملکرد ضعیف کمپین، ارائه نادرست یا ضررهای مالی شود.
برای برقراری تماسهای API، توکن توسعهدهنده باید حداقل سطح دسترسی اولیه را داشته باشد.
باید کمپینها را در حسابهای آزمایشی بازسازی کنید تا کدی را آزمایش کنید که بر خلاف محتوای حساب خاص کار میکند.
از آنجایی که حسابهای آزمایشی تبلیغاتی ارائه نمیکنند، ویژگیهای مربوط به ارائه زنده مانند گزارش آمار، خطاهای نقض خطمشی، یا پردازش واردات تبدیل آفلاین پشتیبانی نمیشوند، که آزمایش این ویژگیها را دشوار میکند.
توصیه می کنیم در صورت امکان از یک حساب آزمایشی هنگام توسعه برنامه خود استفاده کنید. برای دستورالعملها، به ایجاد حسابهای آزمایشی و کمپینها مراجعه کنید.
یک جایگزین این است که یک حساب تولیدی با بودجه حساب کم، مانند 1 دلار در روز، به طور صریح برای آزمایش ویژگی هایی که توسط یک حساب آزمایشی پشتیبانی نمی شوند، راه اندازی کنید.
انتخاب مجموعه ویژگی
هنگام انتخاب یک حساب کاربری برای برقراری تماس API، یک نکته دیگر فهرست ویژگی هایی است که می خواهید با API استفاده کنید. حتی اگر انتخاب کنید از یک حساب تولیدی استفاده کنید، برخی از ویژگیهای خاص حساب وجود دارد، به عنوان مثال:
برای ویژگیهای صورتحساب، به حسابی نیاز دارید که در صورتحساب ماهانه باشد.
برخی از ویژگیهای جدید در حساب ممکن است توسط لیستهای مجاز محدود شده باشند.
قبل از نهایی کردن حساب برای برقراری تماسهای API، مستندات ویژگی خاص را بررسی کنید تا مطمئن شوید که این ویژگی محدودیتهای اضافی ندارد.
شناسه مشتری ورود و شناسه مشتری را شناسایی کنید
برای برقراری تماس API با یک مشتری Google Ads، باید دسترسی و مجوزهای مناسب را به حساب سرویس خود به حساب مشتری بدهید یا به طور مستقیم یا از طریق یک حساب مدیر مرتبط. برای انجام این کار، به دسترسی مدیر به حساب مشتری نیاز دارید.
با ورود به حساب Google Ads خود به عنوان سرپرست شروع کنید. در برخی موارد، ممکن است بیش از یک حساب مشتری برای انتخاب داشته باشید. حسابی که انتخاب میکنید شناسه مشتری ورود به سیستم را ایجاد میکند، که یک سرصفحه ضروری برای برخی از تماسهای API است.
پس از اینکه مشتری Google Ads را برای برقراری تماس API شناسایی کردید، به جزئیات زیر توجه کنید:
شناسه مشتری 10 رقمی حساب مشتری که قصد دارید با آن تماس API برقرار کنید. گاهی اوقات از این به عنوان مشتری عامل یاد می شود.
شناسه مشتری 10 رقمی ورود به سیستم حساب مشتری که در آن وارد شدهاید. اگر به سیستم مشتری عامل وارد شده اید، شناسه مشتری ورود به سیستم با شناسه مشتری یکسان است. اگر به حساب مدیر مشتری عامل وارد شده اید، شناسه مشتری ورود به سیستم، شناسه مشتری حساب مدیر است.
اجازه دسترسی به حساب خدمات
هنگامی که به عنوان سرپرست به حساب Google Ads خود وارد شدید، به Admin > Access and Security بروید.
روی دکمه + در زیر تب کاربران کلیک کنید.
آدرس ایمیل حساب سرویس را در کادر ورودی ایمیل تایپ کنید. سطح مناسبی از سطح دسترسی حساب را انتخاب کنید و روی دکمه افزودن حساب کلیک کنید. توجه داشته باشید که سطح دسترسی ایمیل برای حسابهای سرویس پشتیبانی نمیشود.
به حساب سرویس دسترسی داده شده است.
بهطور پیشفرض، نمیتوانید دسترسی سرپرست را به یک حساب سرویس بدهید. اگر تماسهای API شما نیاز به دسترسی سرپرست دارند، میتوانید دسترسی را به شرح زیر ارتقا دهید.
روی فلش کشویی کنار سطح دسترسی حساب سرویس در ستون Access level کلیک کنید.
تاریخ آخرین بهروزرسانی 2025-08-26 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-26 بهوقت ساعت هماهنگ جهانی."],[[["\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."]]