1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AdWords Scripts - 全体・任意のキャンペーン(またはラベル)に対して入札調整比を毎時自動適用するScript

Posted at

ボトルネック(作成の背景)


  • addAdScheduleメソッドでは新規での設定追加登録はできるが、更新は適用出来ない
  • 更新はsetBidModifierメソッドを使うが、引数が単価調整比のみで曜日と時間は修正出来ない

エンハンストな入札調整比との違い


  • モバイルなどの場合、あくまでキャンペーンに対する入札単価調整比のため、本来曜日・時間の概念は存在せず、変更する設定が1つで完結する。

逃げ道的解決策


  • 上記を踏まえ、毎時設定を削除・新規作成を繰り返すスクリプトを適用する
var iter = selector.get();
while (iter.hasNext()) {
    var camp = iter.next();
    var camp_iter = camp.targeting().adSchedules().get();
    Logger.log(camp);
    if (camp_iter.hasNext()) {
        var camp_adSchedule = camp_iter.next();
        camp_adSchedule.remove();
    }
    camp.addAdSchedule({
        dayOfWeek: dow,
        startHour: 0,
        startMinute: 0,
        endHour: 24,
        endMinute: 0,
        bidModifier: modifierValue
    });
}
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?