包含定義和建立行銷活動客群關聯的方法。 如需建置器的相關資訊,請參閱 建置器。
使用範例:
// Gets the iterator that iterates all campaigns
// in the account.
var shoppingCampaign = AdsApp.shoppingCampaigns().withIds(["123456789"]).get();
// Loops through all campaigns in the account.
while (iterator.hasNext()) {
var campaign = iterator.next();
// Get the campaign audience's builder.
var operation = campaign.targeting().newUserListBuilder()
.withAudienceId("AUDIENCE ID GOES HERE")
.build();
// See the Builders topic for performance considerations
// when using the operation object's methods.
if (!operation.isSuccessful()) {
for (var error of operation.getErrors()) {
Logger.log(`${error}\n`);
}
}
}
方法
組建
建立行銷活動對象,並傳回用來檢查是否已成功新增行銷活動對象的作業物件。
傳回
排除
將指定的客群從此行銷活動中排除,並傳回作業物件,用來檢查是否已成功新增排除的行銷活動客群。
傳回
withAudience (物件 userList)
設定相關聯的使用者清單。
引數
| 名稱 |
類型 |
描述 |
| userList |
字串 |
相關聯的使用者清單。 |
withAudienceId (字串 audienceId)
設定相關聯客群的 ID。
引數
| 名稱 |
類型 |
描述 |
| audienceId |
字串 |
相關聯客群的 ID。 |
withAudienceType (字串 audienceType)
設定相關聯客群的類型。
引數
| 名稱 |
類型 |
描述 |
| audienceId |
字串 |
相關聯客群的類型。 |
withBidModifier (double 修飾詞)
設定關聯的出價調節係數。
引數
| 名稱 |
類型 |
描述 |
| 修飾詞 |
double |
協會的出價調節係數。 |
傳回
傳回