Contains the methods for defining and creating a campaign audience association. For information about builders, see Builders.
Example usage:
// 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`);
}
}
}
Creates the campaign audience association and returns an operation object used to check whether the campaign audience association was successfully added.
Excludes the specified audience from this campaign and returns an operation object used to check whether the excluded campaign audience was successfully added.
An operation object used to check whether the campaign audience was successfully added.
exclude
Excludes the specified audience from this campaign and returns an operation object used to check whether the excluded campaign audience was successfully added.