Muokkaa

Jaa


AdGroupAudienceBuilder

Contains the methods for defining and creating an ad group audience association. For information about builders, see Builders.

Example usage:

    // Gets the iterator that iterates all ad groups
    // in the account.
    var iterator = AdsApp.adGroups().get();

    // Loops through all ad groups in the account.
    while (iterator.hasNext()) {
        var adGroup = iterator.next();

        // Get the ad group audience's builder.
        var operation = adGroup.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`);
            }
        }
    }

Methods

Method Name Return Type Description
build AdGroupAudienceOperation Creates the ad group audience association and returns an operation object used to check whether the ad group audience association was successfully added.
exclude AdGroupExcludedAudienceOperation Excludes the specified audience from this ad group and returns an operation object used to check whether the excluded ad group audience was successfully added.
withAudience(Object userList) AdGroupAudienceBuilder Sets the associated user list.
withAudienceId(string audienceId) AdGroupAudienceBuilder Sets the associated audience's ID.
withAudienceType(string audienceType) AdGroupAudienceBuilder Sets the associated audience's type.
withBidModifier(double modifier) AdGroupAudienceBuilder Sets the association's bid modifier.

build

Creates the ad group audience and returns an operation object used to check whether the ad group audience was successfully added.

Returns

Type Description
AdGroupAudienceOperation An operation object used to check whether the ad group audience was successfully added.

exclude

Excludes the specified audience from this ad group and returns an operation object used to check whether the excluded ad group audience was successfully added.

Returns

Type Description
AdGroupExcludedAudienceOperation An operation object used to check whether the excluded ad group audience was successfully added.

withAudience(Object userList)

Sets the associated user list.

Arguments

Name Type Description
userList string The associated user list.

withAudienceId(string audienceId)

Sets the associated audience's ID.

Arguments

Name Type Description
audienceId string The ID of the associated audience.

withAudienceType(string audienceType)

Sets the associated audience's type.

Arguments

Name Type Description
audienceId string The associated audience's type.

withBidModifier(double modifier)

Sets the association's bid modifier.

Arguments

Name Type Description
modifier double The association's bid modifier.

Returns

Type Description
AdGroupAudienceBuilder The ad group audience builder with the bid modifier applied.

Returns

Type Description
AdGroupAudienceBuilder The ad group audience builder with the name applied.