最適化案は Google 広告によって自動的に生成され、制限のあるキャンペーンのキャンペーンの予算を引き上げたり、関連性の高いキーワードを追加したりするなど、アカウントを最適化する方法を提案します。すべての最適化案の種類の一覧については、Google Ads API のドキュメントをご覧ください。
推奨事項を取得する
推奨事項を取得するには、AdsApp.recommendations()
セレクタを使用します。このセレクタは、他のセレクタと同様に、返される推奨事項の種類に関する条件を指定できます。
const selector = AdsApp.recommendations()
.withCondition('recommendation.type IN (CAMPAIGN_BUDGET)');
const recommendations = selector.get();
最適化案を適用する
推奨事項を取得したら、次のように適用します。
for (const recommendation of recommendations) {
// Perform whatever check here that works for your use case.
// You can also potentially skip this step if you've sufficiently narrowed
// down what recommendations you're selecting initially with customized
// withCondition clauses in the previous step.
if (shouldApply(recommendation)) {
recommendation.apply();
}
}