AdsApp.​AdSchedule

Represents one period of a Google Ads ad schedule.

For instance, if a campaign were set up to show ads only on weekdays from 9AM to 6PM, it would have five AdSchedules: one for Monday 9AM-6PM, one for Tuesday 9AM-6PM, and so on.

Methods:

MemberTypeDescription
getBaseCampaign AdsApp.Campaign Returns the base campaign to which this ad schedule belongs.
getBidModifier double Returns the bid modifier for this ad schedule.
getCampaign AdsApp.Campaign Returns the campaign to which this ad schedule belongs or null if it does not belong to a search or display campaign.
getCampaignType String Returns the campaign type.
getDayOfWeek String Returns the day of week this ad schedule applies to.
getEndHour int Returns the ending hour of this ad schedule.
getEndMinute int Returns the ending minute of this ad schedule.
getEntityType String Returns the type of this entity as a String, in this case, "AdSchedule".
getId String Returns the ID of the ad schedule.
getResourceName String Returns the resource name of the ad schedule.
getShoppingCampaign AdsApp.ShoppingCampaign Returns the shopping campaign to which this ad schedule belongs or null if it does not belong to a shopping campaign.
getStartHour int Returns the starting hour of this ad schedule.
getStartMinute int Returns the starting minute of this ad schedule.
getStatsFor AdsApp.Stats Returns stats for the specified date range.
getStatsFor AdsApp.Stats Returns stats for the specified custom date range.
getVideoCampaign AdsApp.VideoCampaign Returns the video campaign to which this ad schedule belongs or null if it does not belong to a video campaign.
remove void Removes the ad schedule.
setBidModifier void Sets the bid modifier for this ad schedule.

getBaseCampaign()

Returns the base campaign to which this ad schedule belongs.

Return values:

TypeDescription
AdsApp.Campaign The base campaign to which this ad schedule belongs.

getBidModifier()

Returns the bid modifier for this ad schedule.

The bid modifier is a multiplier applied to bids which match this ad schedule. So, for instance, a bid modifier of 1.1 increases the bid to 110% of its original value, and changes a bid of $5.00 to a bid of $5.50.

The bid modifiers for all matching criteria are multiplied together to calculate the actual bid modification. A campaign with the following bid modifiers:

TypeValueBid Modifier
LocationLaos1.3
Ad ScheduleSaturday 6AM-10AM0.9
PlatformMobile1.1
would have a combined bid modifier of 1.3 * 0.9 * 1.1 = 1.287, so a bid of $10 would get increased to $12.87 for metrics.clicks by Laotian smartphone users on Saturday mornings in the account timezone.

For more information about bid modifiers, please see the Google Ads Help Center article.

Return values:

TypeDescription
double The criterion bid modifier.

getCampaign()

Returns the campaign to which this ad schedule belongs or null if it does not belong to a search or display campaign.

Return values:

TypeDescription
AdsApp.Campaign The campaign to which this ad schedule belongs or null if it does not belong to a search or display campaign.

getCampaignType()

Returns the campaign type. Possible return values:

SEARCH_OR_DISPLAY, VIDEO, SHOPPING

Return values:

TypeDescription
String Video campaign type.

getDayOfWeek()

Returns the day of week this ad schedule applies to.

This will be one of "MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", or "SUNDAY".

Return values:

TypeDescription
String The day of week this ad schedule applies to.

getEndHour()

Returns the ending hour of this ad schedule.

The time is based on a 24-hour clock. Valid ending times range from 00:15 to 24:00. So, for instance, an ad schedule which ends at 3:30PM would return 15 as the value of getEndHour().

Return values:

TypeDescription
int The ending hour of this ad schedule.

getEndMinute()

Returns the ending minute of this ad schedule.

For instance, an ad schedule which ends at 3:30PM would return 30 as the value of getEndMinute(). The only possible return values are 0, 15, 30, and 45.

Return values:

TypeDescription
int The ending minute of this ad schedule.

getEntityType()

Returns the type of this entity as a String, in this case, "AdSchedule".

Return values:

TypeDescription
String Type of this entity: "AdSchedule".

getId()

Returns the ID of the ad schedule.

Ad schedule IDs may be shared across campaigns. In order to uniquely identify an ad schedule target, one must specify both its campaign ID and the ad schedule ID.

Return values:

TypeDescription
String The ID of the ad schedule.

getResourceName()

Returns the resource name of the ad schedule.

Return values:

TypeDescription
String The resource name of the ad schedule.

getShoppingCampaign()

Returns the shopping campaign to which this ad schedule belongs or null if it does not belong to a shopping campaign.

Return values:

TypeDescription
AdsApp.ShoppingCampaign The shopping campaign to which this ad schedule belongs or null if it does not belong to a shopping campaign.

getStartHour()

Returns the starting hour of this ad schedule.

The time is based on a 24-hour clock. Valid starting times range from 00:00 to 23:45. So, for instance, an ad schedule which starts at 3:30PM would return 15 as the value of getStartHour().

Return values:

TypeDescription
int The starting hour of this ad schedule.

getStartMinute()

Returns the starting minute of this ad schedule.

For instance, an ad schedule which starts at 3:30PM would return 30 as the value of getStartMinute(). The only possible return values are 0, 15, 30, and 45.

Return values:

TypeDescription
int The starting minute of this ad schedule.

getStatsFor(dateRange)

Returns stats for the specified date range. Supported values:

TODAY, YESTERDAY, LAST_7_DAYS, THIS_WEEK_SUN_TODAY, LAST_WEEK, LAST_14_DAYS, LAST_30_DAYS, LAST_BUSINESS_WEEK, LAST_WEEK_SUN_SAT, THIS_MONTH, LAST_MONTH, ALL_TIME.

Example:

var stats = adSchedule.getStatsFor("THIS_MONTH");

Arguments:

NameTypeDescription
dateRange String Date range for which the stats are requested.

Return values:

TypeDescription
AdsApp.Stats The stats for the specified date range.

getStatsFor(dateFrom, dateTo)

Returns stats for the specified custom date range. Both parameters can be either an object containing year, month, and day fields, or an 8-digit string in YYYYMMDD form. For instance, March 24th, 2013 is represented as either {year: 2013, month: 3, day: 24} or "20130324". The date range is inclusive on both ends, so forDateRange("20130324", "20130324") defines a range of a single day.

Arguments:

NameTypeDescription
dateFrom Object Start date of the date range. Must be either a string in YYYYMMDD form, or an object with year, month and day properties.
dateTo Object End date of the date range. Must be either a string in YYYYMMDD form, or an object with year, month and day properties.

Return values:

TypeDescription
AdsApp.Stats The stats for the specified date range.

getVideoCampaign()

Returns the video campaign to which this ad schedule belongs or null if it does not belong to a video campaign.

Return values:

TypeDescription
AdsApp.VideoCampaign The video campaign to which this ad schedule belongs or null if it does not belong to a video campaign.

remove()

Removes the ad schedule.

Returns nothing.

setBidModifier(modifier)

Sets the bid modifier for this ad schedule.

The bid modifier is a multiplier applied to bids which match this ad schedule. So, for instance, a bid modifier of 1.1 increases the bid to 110% of its original value, and changes a bid of $5.00 to a bid of $5.50.

The bid modifiers for all matching criteria are multiplied together to calculate the actual bid modification. A campaign with the following bid modifiers:

TypeValueBid Modifier
LocationLaos1.3
Ad ScheduleSaturday 6AM-10AM0.9
PlatformMobile1.1
would have a combined bid modifier of 1.3 * 0.9 * 1.1 = 1.287, so a bid of $10 would get increased to $12.87 for metrics.clicks by Laotian smartphone users on Saturday mornings in the account timezone.

For more information about bid modifiers, please see the Google Ads Help Center article. For ad schedules, acceptable bid modifiers are in the range 0.1 to 10.

Returns nothing.

Arguments:

NameTypeDescription
modifier double The new bid modifier.