出价
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
借助 Google Ads 脚本,您可以管理广告系列的竞价。本指南介绍了此功能及其用途。如需设置 Google Ads 实体的出价,您需要指定两个部分:
Google Ads 脚本通过其 bidding()
方法提供对广告系列出价的访问权限。
出价策略
出价策略表示可应用于 Google Ads 实体的出价配置。出价策略可以是匿名出价策略,也可以是灵活出价策略。您可以通过广告系列 bidding()
属性的 setStrategy()
方法将出价策略应用于广告系列。以下代码段将名为 Test Campaign 的广告系列的竞价策略设置为 TARGET_SPEND
。
const campaign = AdsApp.campaigns()
.withCondition("campaign.name = 'Test Campaign'")
.get()
.next();
campaign.bidding().setStrategy("TARGET_SPEND");
某些类型的出价策略需要额外的实参,您可以使用 BiddingStrategyArgsBuilder
提供这些实参:
const bidding = campaign.bidding();
bidding.setStrategy(
'MAXIMIZE_CONVERSION_VALUE',
bidding.argsBuilder().withTargetRoas(5));
如需了解完整详情,请参阅 setStrategy(biddingStrategy, argsBuilder)
文档。
匿名出价策略
匿名出价策略会直接应用到实体。Google Ads 脚本支持以下匿名出价策略:
名称 |
说明 |
MANUAL_CPC |
基于点击的人工出价,此类出价中用户按点击次数付费。 |
MANUAL_CPM |
基于展示的人工出价,此类出价中用户按每千次展示费用付费。只能用于仅限展示广告网络广告系列。 |
TARGET_SPEND |
自动优化每次美元点击费用的出价策略。 |
MAXIMIZE_CONVERSIONS |
一种出价策略,可在给定每日预算的前提下自动尽可能提高转化次数。 |
MAXIMIZE_CONVERSION_VALUE |
一种出价策略,可在指定预算范围内自动尽可能提高广告系列的总转化价值。 |
TARGET_IMPRESSION_SHARE |
这种出价策略会自动设置出价,目的是在绝对页首、页首或 Google 搜索结果页的任何位置展示您的广告。 |
灵活出价策略
此策略允许在账号级定义共享出价配置。然后,您可以将共享出价配置应用于特定广告系列。要详细了解此功能,请访问我们的帮助中心。
您可以检索账户中的灵活出价策略,如下所示:
const biddingStrategy = AdsApp.biddingStrategies()
.withCondition("bidding_strategy.name = 'My Shared Bidding Strategy'")
.get()
.next();
您还可以访问采用此出价策略的广告系列。
const campaigns = biddingStrategy.campaigns().get();
与匿名出价策略相比,使用灵活出价策略的一项优势在于,您可以跟踪共用同一出价策略的 Google Ads 实体的效果;例如,若要获取账号的点击统计信息,请执行以下操作:
const clicks = biddingStrategy.getStatsFor("LAST_MONTH").getClicks();
如果您需要更改这些实体的出价策略,请修改关联的共享出价策略,而不是修改各个 Google Ads 实体的出价策略。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-27。
[null,null,["最后更新时间 (UTC):2025-08-27。"],[[["\u003cp\u003eGoogle Ads scripts allow you to manage your campaign bidding strategies programmatically.\u003c/p\u003e\n"],["\u003cp\u003eYou can set bidding strategies for your campaigns using either anonymous or flexible strategies.\u003c/p\u003e\n"],["\u003cp\u003eAnonymous strategies are applied directly to a campaign and include options like Target Spend and Maximize Conversions.\u003c/p\u003e\n"],["\u003cp\u003eFlexible strategies are defined at the account level and can be shared across multiple campaigns for centralized management.\u003c/p\u003e\n"],["\u003cp\u003eGoogle Ads scripts provide methods for retrieving and modifying both anonymous and flexible bidding strategies, enabling you to automate your bidding workflows.\u003c/p\u003e\n"]]],[],null,["# Bidding\n\nGoogle Ads scripts lets you manage bidding for your campaigns. This guide\nexplains this feature and its use. To set a Google Ads entity's bidding, you\nneed to specify two parts:\n\n- A [bidding strategy](//support.google.com/google-ads/answer/2472725)\n- The actual bid amount, if applicable\n\nGoogle Ads scripts provides access to bidding for campaigns through their\n`bidding()` method.\n\nBidding strategy\n----------------\n\nA bidding strategy represents a bidding configuration that can be applied to a\nGoogle Ads entity. A bidding strategy can either be anonymous or flexible. You\napply a bidding strategy to a campaign through the `setStrategy()` method of\nits `bidding()` property. The following code snippet sets the bidding strategy\nof a campaign named **Test Campaign** to `TARGET_SPEND`. \n\n const campaign = AdsApp.campaigns()\n .withCondition(\"campaign.name = 'Test Campaign'\")\n .get()\n .next();\n campaign.bidding().setStrategy(\"TARGET_SPEND\");\n\nSome types of bidding strategies require extra arguments, which you can provide\nusing a\n[`BiddingStrategyArgsBuilder`](/google-ads/scripts/docs/reference/adsapp/adsapp_biddingstrategyargsbuilder): \n\n const bidding = campaign.bidding();\n bidding.setStrategy(\n 'MAXIMIZE_CONVERSION_VALUE',\n bidding.argsBuilder().withTargetRoas(5));\n\nSee the\n[`setStrategy(biddingStrategy, argsBuilder)`](/google-ads/scripts/docs/reference/adsapp/adsapp_campaignbidding#setStrategy_biddingStrategy-argsBuilder)\ndocumentation for full details.\n\n### Anonymous bid strategy\n\nAn anonymous bid strategy is applied directly to an entity. Google Ads scripts\nsupports the following anonymous bid strategies:\n\n| Name | Description |\n|---------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| MANUAL_CPC | Manual click based bidding where user pays per click. |\n| MANUAL_CPM | Manual impression based bidding where user pays per thousand impressions. This can only be used for **Display Network only** campaigns. |\n| TARGET_SPEND | Bidding strategy that automatically optimizes clicks per dollar. |\n| MAXIMIZE_CONVERSIONS | Bidding strategy that automatically maximizes number of conversions given a daily budget. |\n| MAXIMIZE_CONVERSION_VALUE | Bidding strategy that automatically maximizes the total conversion value of your campaign within a specified budget. |\n| TARGET_IMPRESSION_SHARE | Bidding strategy that automatically sets bids with the goal of showing your ad on the absolute top of the page, on the top of the page, or anywhere on the page of Google search results. |\n\n### Flexible bidding strategy\n\nThis strategy allows for defining a shared bidding configuration at the account\nlevel. You can then apply the shared bidding configuration to specific\ncampaigns. You can learn more about this feature on\n[our help center](//support.google.com/google-ads/answer/2979071).\n\nYou can retrieve flexible bid strategies in your account as follows: \n\n const biddingStrategy = AdsApp.biddingStrategies()\n .withCondition(\"bidding_strategy.name = 'My Shared Bidding Strategy'\")\n .get()\n .next();\n\nYou can also access the\n[campaigns](/google-ads/scripts/docs/reference/adsapp/adsapp_biddingstrategy#campaigns)\nthat are using this bid strategy. \n\n const campaigns = biddingStrategy.campaigns().get();\n\nOne benefit of using a flexible bidding strategy over an anonymous bidding\nstrategy is that you can track the performance of Google Ads entities sharing\nthe same bid strategy; for example, to get click stats for your account: \n\n const clicks = biddingStrategy.getStatsFor(\"LAST_MONTH\").getClicks();\n\nIf you need to change the bidding strategy for these entities, modify\nthe associated shared bidding strategy instead of modifying the bidding\nstrategy of individual Google Ads entities."]]