针对展示次数份额进行出价 - 单一帐号

出价图标

一些广告客户希望他们的广告在搜索结果中尽可能频繁地展示,而不在乎成本高低。另一些广告客户则会选择较为适中的展示次数份额,这样虽然费用较低,但仍能让他们的广告足够醒目。

通过“出价展示次数份额”脚本,您可以逐步实现展示次数份额目标。该脚本会浏览您的关键字,找到最需要调整的关键字,然后提高或降低它们的出价,以影响它们在搜索结果中的展示频率。

正在安排

此脚本会考虑过去 7 天的统计信息。请将其设为每周运行。

运作方式

该脚本会执行两项操作:

  • 首先,它会查找展示次数份额过低的关键字,并提高出价。
  • 然后,脚本会查找点击率高于 1% 且展示次数份额过高的所有关键字,并降低它们的出价

请注意,一个迭代器只能提取 50,000 个关键字。因此,脚本每次执行时,最多会提高 50,000 个出价并降低 50,000 个出价。

您应仔细根据账号的情况调整出价。在调整关键字的出价时,您可能需要考虑除点击率之外的其他因素。

参数

更新脚本中的下列参数:

  • TARGET_IMPRESSION_SHARE 可指定您希望实现的展示次数份额。
  • 一旦关键字的展示次数份额在 TARGET_IMPRESSION_SHARETOLERANCE 范围内,其出价就不再更新。我们不希望关键字出价不断上下波动,因为其展示次数份额是 49 比 51。
  • BID_ADJUSTMENT_COEFFICIENT 指定在调整关键字出价时使用的调节系数。调节系数越大,出价变化幅度就越大。

初始设置

  • 使用下面的源代码创建新脚本。
  • 不要忘记更新以下代码中的 TARGET_IMPRESSION_SHARETOLERANCEBID_ADJUSTMENT_COEFFICIENT
  • 仔细查看用于提取关键字的条件。
  • 将脚本设为每周 (Weekly) 运行。

源代码

// Copyright 2015, Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/**
 * @name Bid To Impression Share
 *
 * @overview The Bid To Impression Share script adjusts your bids and allows you
 *     to steer ads in an advertiser account into a desired impression share in
 *     the search results. See
 *     https://developers.google.com/google-ads/scripts/docs/solutions/bid-to-impression-share
 *     for more details.
 *
 * @author Google Ads Scripts Team [adwords-scripts@googlegroups.com]
 *
 * @version 3.0
 *
 * @changelog
 * - version 3.0
 *   - Updated to use new Google Ads Scripts features.
 * - version 2.0.1
 *   - Fixed logic when determining which keywords to raise and lower.
 * - version 2.0.0
 *   - Refactored to target impression share rather than position.
 * - version 1.0.1
 *   - Refactored to improve readability. Added documentation.
 * - version 1.0
 *   - Released initial version.
 */

// Ad impression share you are trying to achieve, representated as a percentage.
const TARGET_IMPRESSION_SHARE = 0.5;

// Once the keywords fall within TOLERANCE of TARGET_IMPRESSION_SHARE,
// their bids will no longer be adjusted. Represented as a percentage.
const TOLERANCE = 0.05;

// How much to adjust the bids.
const BID_ADJUSTMENT_COEFFICIENT = 1.05;

/**
 * Main function that lowers and raises keywords' CPC to move closer to
 * target impression share.
 */
function main() {
  raiseKeywordBids();
  lowerKeywordBids();
}

/**
 * Increases the CPC of keywords that are below the target impression share.
 */
function raiseKeywordBids() {
  const keywordsToRaise = getKeywordsToRaise();
  for (const keyword of keywordsToRaise) {
    keyword.bidding().setCpc(getIncreasedCpc(keyword.bidding().getCpc()));
  }
 }

/**
 * Decreases the CPC of keywords that are above the target impression share.
 */
function lowerKeywordBids() {
 const keywordsToLower = getKeywordsToLower();
 for (const keyword of keywordsToLower) {
   keyword.bidding().setCpc(getDecreasedCpc(keyword.bidding().getCpc()));
 }
}

/**
 * Increases a given CPC using the bid adjustment coefficient.
 * @param {number} cpc - the CPC to increase
 * @return {number} the new CPC
 */
function getIncreasedCpc(cpc) {
  return cpc * BID_ADJUSTMENT_COEFFICIENT;
}

/**
 * Decreases a given CPC using the bid adjustment coefficient.
 * @param {number} cpc - the CPC to decrease
 * @return {number} the new CPC
 */
function getDecreasedCpc(cpc) {
  return cpc / BID_ADJUSTMENT_COEFFICIENT;
}

/**
 * Gets an iterator of the keywords that need to have their CPC raised.
 * @return {!Iterator} an iterator of the keywords
 */
function getKeywordsToRaise() {
  // Condition to raise bid: Average impression share is worse (less) than
  // target - tolerance
  return AdsApp.keywords()
      .withCondition(`ad_group_criterion.status = ENABLED`)
      .withCondition(
          `metrics.search_impression_share < ${TARGET_IMPRESSION_SHARE - TOLERANCE}`)
      .orderBy(`metrics.search_impression_share ASC`)
      .forDateRange(`LAST_7_DAYS`)
      .get();
}

/**
 * Gets an iterator of the keywords that need to have their CPC lowered.
 * @return {!Iterator} an iterator of the keywords
 */
function getKeywordsToLower() {
  // Conditions to lower bid: Ctr greater than 1% AND
  // average impression share better (greater) than target + tolerance
  return AdsApp.keywords()
      .withCondition(`metrics.ctr > 0.01`)
      .withCondition(
          `metrics.search_impression_share > ${TARGET_IMPRESSION_SHARE + TOLERANCE}`)
      .withCondition(`ad_group_criterion.status = ENABLED`)
      .orderBy(`metrics.search_impression_share DESC`)
      .forDateRange(`LAST_7_DAYS`)
      .get();
}