包含用于定义和创建市场活动受众关联的方法。 有关生成器的信息,请参阅 Builders。
用法示例:
// 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`);
}
}
}
方法
build
创建市场活动受众并返回一个操作对象,用于检查是否成功添加市场活动受众。
返回
排除
从此市场活动中排除指定的受众,并返回一个操作对象,用于检查是否已成功添加排除的市场活动受众。
返回
withAudience (Object userList)
设置关联的用户列表。
参数
| 名称 |
类型 |
说明 |
| userList |
string |
关联的用户列表。 |
withAudienceId (string audienceId)
设置关联的受众 ID。
参数
| 名称 |
类型 |
说明 |
| audienceId |
string |
关联受众的 ID。 |
withAudienceType (string audienceType)
设置关联的受众类型。
参数
| 名称 |
类型 |
说明 |
| audienceId |
string |
关联的受众类型。 |
withBidModifier (双修饰符)
设置关联的出价修饰符。
参数
| 名称 |
类型 |
说明 |
| 改 性 剂 |
double |
关联的出价修饰符。 |
返回
返回