테스트
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
테스트는 이제 막 시작하는 경우, 앱을 유지관리하는 경우, 기존 통합에 새로운 기능을 추가하는 경우 등 성공적인 Google Ads API 통합을 구축하는 데 중요한 단계입니다. 이 가이드에서는 Google Ads API 통합을 테스트하기 위한 몇 가지 권장사항을 소개합니다.
테스트 계정 및 프로덕션 계정
개발 목적으로 테스트 계정을 사용할 수 있습니다. 테스트 계정을 사용하면 애플리케이션 코드와 구성이 의도한 대로 작동하는지 확인할 수 있습니다.
하지만 테스트 계정에서는 일부 기능만 테스트할 수 있습니다.
테스트 계정 제한으로 인해 통합에서 일부 기능을 테스트할 수 없는 경우 개발에 프로덕션 계정을 대신 사용할 수 있습니다.
개발용 프로덕션 계정은 다음과 같은 점에서 테스트 계정과 다릅니다.
- 사용자가 볼 수 있는 광고 게재
- 유효한 URL 필요
- 광고 정책을 준수해야 합니다.
프로덕션 계정은 광고를 게재하므로 실적 보고서를 테스트할 수 있는 측정항목을 생성하고 Google Ads API의 다른 모든 기능을 잠금 해제합니다. 하지만 개발에 사용하는 경우에는 각별히 주의해야 합니다. 다음 조치를 취하는 것이 좋습니다.
- 개발 목적으로 액세스가 필요한 사용자에게만 액세스 권한을 부여하세요.
- 고정된 낮은 일일 계정 예산을 설정합니다.
- 테스트 계정을 사용할 수 없는 경우에만 개발에 프로덕션 계정을 사용하세요.
따라서 통합을 완전히 테스트하려면 테스트 사용자 인증 정보와 프로덕션 사용자 인증 정보가 모두 필요할 수 있습니다.
테스트 사용자 인증 정보
개발 계정을 수정하려고 할 때 실수로 프로덕션 계정을 수정할 위험을 최소화하려면 프로덕션 애플리케이션 사용자 인증 정보와 별도의 테스트 사용자 인증 정보를 유지하는 것이 좋습니다.
테스트 사용자 인증 정보를 만들려면 다음 단계를 따르세요.
- 테스트 목적으로만 사용할 이메일 계정 (예: api.test@example.com) 또는 서비스 계정을 만듭니다.
- 이 사용자 또는 서비스 계정을 테스트를 실행하는 Google Ads 계정의 유효한 사용자로 추가합니다. 이 사용자 또는 서비스 계정에 적절한 액세스 수준을 부여해야 합니다. 이 사용자 또는 서비스 계정에 프로덕션 계정에 대한 액세스 권한을 부여하지 마세요.
- 서비스 계정 흐름이 아닌 OAuth 2.0 사용자 인증 흐름을 사용하는 경우 테스트 사용자 계정에 대한 갱신 토큰을 생성합니다.
- 애플리케이션을 테스트할 때 이 새 사용자 인증 정보를 사용하세요. 개발자 토큰, 클라이언트 ID, 클라이언트 보안 비밀번호는 액세스할 수 있는 Google Ads 계정을 결정하는 데 영향을 미치지 않으므로 테스트 목적으로 재사용할 수 있습니다.
유효성 검사 요청
요청이 유효한지 테스트해야 하는 경우(예: 요청이 올바르게 구성되어 있고 정책을 위반하지 않는지 확인) GoogleAdsService.SearchStream
및 GoogleAdsService.Search
요청과 대부분의 변이 요청에 사용할 수 있는 validate_only
필드를 사용하면 됩니다.
참조 문서를 참고하여 특정 메서드에 이 필드를 사용할 수 있는지 확인하세요.
REST API
요청이 예상된 출력을 생성하는지 확인하는 등 임시 테스트의 경우 REST API를 사용하는 것이 가장 쉬운 옵션인 경우가 많습니다. REST 예시를 참고하여 REST API에 요청을 보낼 때 curl을 사용하는 방법을 알아보세요. REST 탐색기에서 테스트해 보세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-09-05(UTC)
[null,null,["최종 업데이트: 2025-09-05(UTC)"],[[["\u003cp\u003eTesting is crucial for successful Google Ads API integration, whether you're starting fresh, maintaining an app, or adding features.\u003c/p\u003e\n"],["\u003cp\u003eUtilize test accounts for development when possible, but be aware of their limitations and consider using production accounts cautiously for features not supported by test accounts.\u003c/p\u003e\n"],["\u003cp\u003eMaintain separate test credentials, especially refresh tokens, to avoid accidental modifications to production accounts.\u003c/p\u003e\n"],["\u003cp\u003eValidate your requests using the \u003ccode\u003evalidate_only\u003c/code\u003e field to ensure they are structured correctly and comply with policies.\u003c/p\u003e\n"],["\u003cp\u003eLeverage the REST API for quick, ad hoc testing and validation of request outputs.\u003c/p\u003e\n"]]],[],null,["# Testing is an important step in building a successful Google Ads API integration,\nwhether you're just getting started, maintaining an app, or adding\nnew features to an existing integration. This guide presents some best\npractices for testing your Google Ads API integration.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nTest accounts and production accounts\n-------------------------------------\n\n[Test accounts](/google-ads/api/docs/best-practices/test-accounts) are available for\ndevelopment purposes. With test accounts, you can validate that your application\ncode and configuration are working as intended.\n\nHowever, [not all\nfeatures](/google-ads/api/docs/best-practices/test-accounts#limitations) can be tested in a\ntest account account.\n\nWhen test account limitations prevent you from testing some features in your\nintegration, you can instead use a production account for development.\nProduction accounts for development differ from test accounts in the following\nways:\n\n- Serve ads that can be seen by users\n- Require valid URLs\n- Must comply with [advertising policies](//support.google.com/adspolicy/answer/6008942)\n\nBecause production accounts serve ads, they generate metrics letting you test\nperformance reports, as well as unlocking all the other features of the\nGoogle Ads API. However, using them for development requires extra caution. We\nrecommend taking the following measures:\n\n- Only grant access to users that need it for development purposes.\n- Set a fixed, low daily account budget.\n- Use production accounts for development only when test accounts can't be used.\n\nThus, to do full testing of your integration, you will likely need both test\ncredentials and production credentials.\n\nTest credentials\n----------------\n\nTo minimize the risk of accidentally modifying production accounts when trying\nto modify development accounts, we recommend maintaining a set of test\ncredentials that are separate from your production application credentials.\n\nTo create a set of test credentials:\n\n1. Create an email account (e.g. api.test@example.com) or a service account that will be used only for testing purposes.\n2. Add this user or service account as a valid user in the Google Ads accounts you are running your tests against. Make sure you give appropriate [access levels](//support.google.com/google-ads/answer/9978556) to this user or service account. Don't give this user or service account access to **any production accounts**.\n3. If you are using the [OAuth 2.0 user authentication flow, rather than the\n service account flow](/google-ads/api/docs/get-started/choose-application-type#choose-app-type), then generate a refresh token for your test user account.\n4. Use these new credentials when testing your application. The developer token, client ID, and client secret can be reused for testing purposes, since they have no effect in determining which Google Ads accounts can be accessed.\n\nRequest validation\n------------------\n\nIf you just need to test whether a request is valid---for example, to\nverify that the request is structured correctly and does not violate\npolicies---you can use the\n[`validate_only`](/google-ads/api/docs/concepts/api-structure#mutate_validation)\nfield, which is available for `GoogleAdsService.SearchStream` and\n`GoogleAdsService.Search` requests, as well as most mutate requests.\nConsult the [reference documentation](/google-ads/api/reference/rpc/v21/overview) to verify\nwhether this field is available for a given method.\n\nREST API\n--------\n\nFor ad hoc testing, for example to validate that a request yields the expected\noutput, using the REST API is often the easiest option. Consult the [REST\nexamples](/google-ads/api/rest/examples) to learn how to use curl in making\nrequests to the REST API. Also, try testing in the\n[REST explorer](/google-ads/api/rest/try-it)."]]