测试与生产
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
测试广告联盟通过提供与生产 Google Ad Manager 帐号完全隔离的数据环境来帮助您测试代码。
您应该先使用测试网络构建和测试代码,然后再开始将其用于生产帐号。如果您需要向测试广告联盟添加其他功能,请与您的客户经理联系。
如需创建测试广告联盟,请调用 NetworkService.makeTestNetwork
。每个客户端库中都有一个 MakeTestNetwork
示例。您只能为您的 Google 帐号创建一个测试广告联盟。
测试广告联盟在以下方面受到限制:
- 测试广告联盟的每个实体类型最多只能包含 10000 个对象。
- 测试广告联盟无法投放广告。
- 由于测试广告联盟无法投放广告,因此在未返回数据的情况下,报表一律返回。
- 由于预测需要传送历史记录,因此预测服务结果是伪造的。如需了解详情,请参阅 EEA。
- 默认情况下,测试广告联盟不是 Ad Manager 360 广告联盟,也就是说,它们不具有 Ad Manager 360 广告联盟中的高级功能。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-21。
[null,null,["最后更新时间 (UTC):2025-08-21。"],[[["\u003cp\u003eTest networks provide an isolated environment for testing Google Ad Manager code before using it in production.\u003c/p\u003e\n"],["\u003cp\u003eYou can create one test network per Google account using the \u003ccode\u003eNetworkService.makeTestNetwork\u003c/code\u003e method, and client libraries include examples.\u003c/p\u003e\n"],["\u003cp\u003eTest networks have limitations, including a 10,000 object limit per entity, inability to serve ads or generate real report data, and faked forecasting results.\u003c/p\u003e\n"],["\u003cp\u003eIf creating a test network with a Service Account, add an Administrator user for UI access via \u003ccode\u003eUserService.createUsers\u003c/code\u003e.\u003c/p\u003e\n"]]],["Test networks offer isolated environments for testing code without affecting production accounts. Create one test network per Google account using `NetworkService.makeTestNetwork`, referencing client library examples. Service accounts require an added Administrator via `UserService.createUsers` for UI access. Test networks have limitations: 10,000 objects per entity, no ad serving, empty reports, faked forecasts, and lack of Ad Manager 360 premium features. Use these isolated test environments prior to using your production account.\n"],null,["# Test vs. Production\n\nTest networks help you test your code by providing a completely isolated\ndata environment from your production Google Ad Manager account.\n\nYou should build and test code using test networks before you start using it\nagainst your production account. If you need additional features added to your\ntest network, please speak to your account manager.\n\nTo create a test network, call [`NetworkService.makeTestNetwork`](/ad-manager/api/reference/latest/NetworkService#makeTestNetwork).\nA `MakeTestNetwork` example is included in each of the [client libraries](/ad-manager/api/clients). You can create only one test network for\nyour Google account.\n| **Important:** If you create a test network using a Service Account, you must also add an additional Administrator (`roleId -1`) to access the network's UI. To do so, call [`UserService.createUsers`](/ad-manager/api/reference/latest/UserService#createUsers).\n\nTest networks are limited in the following ways:\n\n- Test networks are limited to 10,000 objects per entity type.\n- Test networks cannot serve ads.\n- Because test networks cannot serve ads, reports will always come back without data.\n- Since forecasting requires serving history, forecast service results will be faked. See [ForecastService](/ad-manager/api/reference/latest/ForecastService) for more information.\n- Test networks are, by default, not Ad Manager 360 networks, meaning that they do not have the premium features found in Ad Manager 360 networks."]]