AdsApp.​AudienceBuilder

  • AudienceBuilder is used to create Audience objects.

  • The build() method creates the audience, while the exclude() method creates an excluded audience.

  • You can set the user list, audience ID, audience type, max CPC bid, and CPM bid using the withAudience , withAudienceId , withAudienceType , withCpc , and withCpm methods respectively.

  • withAudienceType and withAudienceId are required fields for creating an audience.

Builder for Audience objects.

Example usage:

 var 
  
 audienceBuilder 
  
 = 
  
 adGroup 
 . 
 display 
 () 
 . 
 newAudienceBuilder 
 (); 
 var 
  
 audience 
  
 = 
  
 audienceBuilder 
  
 . 
 withAudienceType 
 ( 
 'USER_LIST' 
 ) 
  
 // 
  
 required 
  
 . 
 withAudienceId 
 ( 
 3 
 ) 
  
 // 
  
 required 
  
 . 
 withCpc 
 ( 
 0.50 
 ) 
  
 // 
  
 optional 
  
 . 
 build 
 () 
  
 // 
  
 create 
  
 the 
  
 audience 

Methods:

Member Type Description
AdsApp.AudienceOperation Builds the audience.
AdsApp.ExcludedAudienceOperation Builds the excluded audience.
AdsApp.AudienceBuilder Sets the user list of the audience.
AdsApp.AudienceBuilder Sets the audience ID of the audience.
AdsApp.AudienceBuilder Sets the type of the audience, either USER_INTEREST or USER_LIST .
AdsApp.AudienceBuilder Sets the max CPC bid of the new audience to the specified value.
AdsApp.AudienceBuilder Sets the CPM bid of the new audience to the specified value.

build()

Builds the audience. Returns a AudienceOperation that corresponds to the creation of the Audience .

Return values:

Type Description
AdsApp.AudienceOperation The AudienceOperation.

exclude()

Builds the excluded audience. Returns an ExcludedAudienceOperation that corresponds to the creation of the ExcludedAudience .

Return values:

Type Description
AdsApp.ExcludedAudienceOperation The ExcludedAudienceOperation.

withAudience(userList)

Sets the user list of the audience.

Arguments:

Name Type Description
userList
AdsApp.UserList The user list of the audience.

Return values:

Type Description
AdsApp.AudienceBuilder An audience builder with the specified user list.

withAudienceId(audienceId)

Sets the audience ID of the audience. This field is required. User List IDs (List IDs) are available on the details page of a User List (found under the Audiences section of the Shared Library).

Arguments:

Name Type Description
audienceId
String The audience ID of the audience.

Return values:

Type Description
AdsApp.AudienceBuilder An audience builder with the specified audience ID.

withAudienceType(audienceType)

Sets the type of the audience, either USER_INTEREST or USER_LIST . This field is required.

Arguments:

Name Type Description
audienceType
String The type of the audience.

Return values:

Type Description
AdsApp.AudienceBuilder An AudienceBuilder with the specified audience type.

withCpc(cpc)

Sets the max CPC bid of the new audience to the specified value.

Arguments:

Name Type Description
cpc
double The max CPC bid of the audience.

Return values:

Type Description
AdsApp.AudienceBuilder The audience builder with the specified max CPC.

withCpm(cpm)

Sets the CPM bid of the new audience to the specified value.

See Cost-per-thousand impressions (CPM) for more information.

Arguments:

Name Type Description
cpm
double The CPM bid of the audience.

Return values:

Type Description
AdsApp.AudienceBuilder The audience builder with the specified CPM.
Create a Mobile Website
View Site in Mobile | Classic
Share by: