AdsApp.​TopicBuilder

Builder for Topic objects.

Example usage:

var topicBuilder = adGroup.display().newTopicBuilder();
var topic = topicBuilder
  .withTopicId(3)                 // required
  .withCpc(0.50)                  // optional
  .build()                        // create the topic

Methods:

MemberTypeDescription
buildAdsApp.TopicOperationBuilds the topic.
excludeAdsApp.ExcludedTopicOperationBuilds the excluded topic.
withCpcAdsApp.TopicBuilderSets the max CPC bid of the new topic to the specified value.
withCpmAdsApp.TopicBuilderSets the CPM bid of the new topic to the specified value.
withTopicIdAdsApp.TopicBuilderSets the topic ID of the topic.

build()

Builds the topic. Returns a TopicOperation that corresponds to the creation of the Topic.

Return values:

TypeDescription
AdsApp.TopicOperationThe TopicOperation.

exclude()

Builds the excluded topic. Returns an ExcludedTopicOperation that corresponds to the creation of the ExcludedTopic.

Return values:

TypeDescription
AdsApp.ExcludedTopicOperationThe ExcludedTopicOperation.

withCpc(cpc)

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

Arguments:

NameTypeDescription
cpcdoubleThe max CPC bid of the topic.

Return values:

TypeDescription
AdsApp.TopicBuilderThe topic builder with the specified max CPC.

withCpm(cpm)

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

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

Arguments:

NameTypeDescription
cpmdoubleThe CPM bid of the topic.

Return values:

TypeDescription
AdsApp.TopicBuilderThe topic builder with the specified CPM.

withTopicId(topicId)

Sets the topic ID of the topic. This field is required. The topic ID identifies the topic category. A list of valid topic IDs is available on our Verticals page.

Arguments:

NameTypeDescription
topicIdStringThe topic ID of the topic.

Return values:

TypeDescription
AdsApp.TopicBuilderA TopicBuilder with the specified topic ID.