AdWordsApp.​ReviewBuilder

Builder for Review objects.

Example usage:

 // Create a review builder.
 var reviewBuilder = AdWordsApp.extensions().newReviewBuilder();

 // Create a review operation.
 var reviewOperation = reviewBuilder
   .withText("Amazing service.")                   // required
   .withSourceName("Example Site")                 // required
   .withSourceUrl("http://www.example.com/review") // required
   .withExactlyQuoted(true)                        // optional
   .withMobilePreferred(true)                      // optional
   .build();

 // Optional: examine the outcome. The call to isSuccessful()
 // will block until the operation completes.
 if (reviewOperation.isSuccessful()) {
   // Get the result.
   var review = reviewOperation.getResult();
 } else {
   // Handle the errors.
   var errors = reviewOperation.getErrors();
 }

Methods:

MemberTypeDescription
build AdWordsApp.ReviewOperation Creates a Review.
withEndDate AdWordsApp.ReviewBuilder Sets the review's end date from either an object containing year, month, and day fields, or an 8-digit string in YYYYMMDD format.
withExactlyQuoted AdWordsApp.ReviewBuilder Sets the exactly quoted value of the new review to the specified value.
withMobilePreferred AdWordsApp.ReviewBuilder Sets the review's device preference to mobile or clears it.
withSchedules AdWordsApp.ReviewBuilder Sets the review scheduling.
withSourceName AdWordsApp.ReviewBuilder Sets the name of the source of the new review to the specified value.
withSourceUrl AdWordsApp.ReviewBuilder Sets the source URL of the new review to the specified value.
withStartDate AdWordsApp.ReviewBuilder Sets the review's start date from either an object containing year, month, and day fields, or an 8-digit string in YYYYMMDD format.
withText AdWordsApp.ReviewBuilder Sets the text of the new review to the specified value.

build()

Creates a Review. Returns a ReviewOperation that can be used to get the new review (or access any associated errors if creation failed).

Return values:

TypeDescription
AdWordsApp.ReviewOperation The associated review operation.

withEndDate(date)

Sets the review's end date from either an object containing year, month, and day fields, or an 8-digit string in YYYYMMDD format. This field is optional. For instance, reviewBuilder.withEndDate("20130503"); is equivalent to reviewBuilder.withEndDate({year: 2013, month: 5, day: 3});. The change will fail and report an error if:
  • the given date is invalid (e.g., {year: 2013, month: 5, day: 55}),
  • the start date now comes after the end date, or
  • it's a date in the past

Arguments:

NameTypeDescription
date Object The new review end date.

Return values:

TypeDescription
AdWordsApp.ReviewBuilder A review builder with the specified end date.

withExactlyQuoted(isExactlyQuoted)

Sets the exactly quoted value of the new review to the specified value. Specify true if the text of the new review is exactly quoted, which will result in the text being rendered with quotation marks. Specify false if the text of the new review is paraphrased, which will result in the text being rendered without quotation marks. This field is optional and defaults to false.

Arguments:

NameTypeDescription
isExactlyQuoted boolean true if the text is exactly quoted, or false if the text is paraphrased.

Return values:

TypeDescription
AdWordsApp.ReviewBuilder Review builder with the specified exactly quoted value.

withMobilePreferred(isMobilePreferred)

Sets the review's device preference to mobile or clears it. This field is optional and defaults to false.

Arguments:

NameTypeDescription
isMobilePreferred boolean Whether or not this review should be mobile preferred. If true is passed in, device preference will be set to mobile. If false is passed in, device preference will be set to none.

Return values:

TypeDescription
AdWordsApp.ReviewBuilder A review builder with the specified mobile preference.

withSchedules(schedules)

Sets the review scheduling. Scheduling of a review allows you to control the days of week and times of day during which the review will show alongside your ads.

Passing in an empty array clears the scheduling field, causing the review to run at all times.

The following example sets the review to run on Mondays and Tuesday from 8:00 to 11:00.

  var mondayMorning = {
    dayOfWeek: "MONDAY",
    startHour: 8,
    startMinute: 0,
    endHour: 11,
    endMinute: 0
  };
  var tuesdayMorning = {
    dayOfWeek: "TUESDAY",
    startHour: 8,
    startMinute: 0,
    endHour: 11,
    endMinute: 0
  };

  reviewBuilder.withSchedules([mondayMorning, tuesdayMorning]);

Arguments:

NameTypeDescription
schedules AdWordsApp.ExtensionSchedule[] The new review schedules.

Return values:

TypeDescription
AdWordsApp.ReviewBuilder A review builder with the specified schedules.

withSourceName(sourceName)

Sets the name of the source of the new review to the specified value. The combined length of sourceName and text is limited to 67 characters. This field is required.

Arguments:

NameTypeDescription
sourceName String The source name.

Return values:

TypeDescription
AdWordsApp.ReviewBuilder Review builder with the specified source name.

withSourceUrl(sourceUrl)

Sets the source URL of the new review to the specified value. This field is required.

Arguments:

NameTypeDescription
sourceUrl String The source URL.

Return values:

TypeDescription
AdWordsApp.ReviewBuilder Review builder with the specified source URL.

withStartDate(date)

Sets the review's start date from either an object containing year, month, and day fields, or an 8-digit string in YYYYMMDD format. This field is optional. For instance, reviewBuilder.withStartDate("20130503"); is equivalent to reviewBuilder.withStartDate({year: 2013, month: 5, day: 3});. The change will fail and report an error if:
  • the given date is invalid (e.g., {year: 2013, month: 5, day: 55}),
  • the given date is after the review's end date,

Arguments:

NameTypeDescription
date Object The new review start date.

Return values:

TypeDescription
AdWordsApp.ReviewBuilder A review builder with the specified start date.

withText(text)

Sets the text of the new review to the specified value. The combined length of sourceName and text is limited to 67 characters.This field is required.

Arguments:

NameTypeDescription
text String The text.

Return values:

TypeDescription
AdWordsApp.ReviewBuilder Review builder with the specified text.

フィードバックを送信...

ご不明な点がありましたら、Google のサポートページをご覧ください。