建議是由 Google Ads 自動產生,提供帳戶最佳化方式的構想,例如增加廣告活動預算 (適用於預算受限的廣告活動),或是新增相關關鍵字。如要查看建議類型的完整清單,請參閱 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();
}
}