// 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();
}
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}),
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:
Name
Type
Description
isExactlyQuoted
boolean
true if the text is exactly quoted, or false if the text
is paraphrased.
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:
Name
Type
Description
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.
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.
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.
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}),