Google Ads Ad Manager V1 Client - Class AdSpot (0.8.0)

Reference documentation and code samples for the Google Ads Ad Manager V1 Client class AdSpot.

An AdSpot is a targetable entity used in the creation of AdRule objects. A ad spot contains a variable number of ads and has constraints (ad duration, reservation type, etc) on the ads that can appear in it.

Generated from protobuf message google.ads.admanager.v1.AdSpot

Namespace

Google \ Ads \ AdManager \ V1

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ name string

Identifier. The resource name of the AdSpot. Format: networks/{network_code}/adSpots/{ad_spot_id}

↳ canonical_display_name string

Optional. Name of the AdSpot. The name is case insensitive and can be referenced in ad tags. This value is required if customSpot is true, and cannot be set otherwise. You can use alphanumeric characters and symbols other than the following: ", ', =, !, +, #, , ~, ;, ^, (, ), <, >, [, ], the white space character.

↳ display_name string

Optional. Descriptive name for the AdSpot.This value is optional if customSpot is true, and cannot be set otherwise.

↳ custom_spot bool

Optional. Whether this ad spot is a custom spot. This field is optional and defaults to false. Custom spots can be reused and targeted in the targeting picker.

↳ flexible bool

Optional. Whether this ad spot is a flexible spot. This field is optional and defaults to false. Flexible spots are allowed to have no max number of ads.

↳ max_duration Google\Protobuf\Duration

Optional. The maximum total duration for this AdSpot. This field is optional, defaults to 0, and supports precision to the nearest second.

↳ min_ad_duration Google\Protobuf\Duration

Optional. The minimum allowed duration for ads in the AdSpot. This field is optional and defaults to 0.

↳ max_ad_duration Google\Protobuf\Duration

Required. The maximum allowed duration for ads in the AdSpot. This field is required and must be greater than min_ad_duration.

↳ max_ads int

Optional. The maximum number of ads allowed in the AdSpot. This field is optional and defaults to 0. A value of 0 means that there is no maximum for the number of ads in the ad spot. No max ads is only supported for ad spots that have flexible set to true.

↳ targeting_type int

Optional. The AdSpot TargetingType determines how this ad spot can be targeted. This field is required.

↳ backfill_blocked bool

Optional. Whether backfill is blocked in this ad spot. This field is optional and defaults to false.

↳ allowed_line_item_types int[]

Optional. The set of line item types that may appear in the ad spot. This field is optional and defaults to an empty set, which means that all types are allowed. Note, backfill reservation types are controlled by the backfillBlocked field.

↳ inventory_sharing_blocked bool

Optional. Whether inventory sharing is blocked in this ad spot. This field is optional and defaults to false.

getName

Identifier. The resource name of the AdSpot.

Format: networks/{network_code}/adSpots/{ad_spot_id}

Returns
Type Description
string

setName

Identifier. The resource name of the AdSpot.

Format: networks/{network_code}/adSpots/{ad_spot_id}

Parameter
Name Description
var string
Returns
Type Description
$this

getCanonicalDisplayName

Optional. Name of the AdSpot. The name is case insensitive and can be referenced in ad tags. This value is required if customSpot is true, and cannot be set otherwise. You can use alphanumeric characters and symbols other than the following: ", ', =, !, +, #, , ~, ;, ^, (, ), <, >, [, ], the white space character.

Returns
Type Description
string

hasCanonicalDisplayName

clearCanonicalDisplayName

setCanonicalDisplayName

Optional. Name of the AdSpot. The name is case insensitive and can be referenced in ad tags. This value is required if customSpot is true, and cannot be set otherwise. You can use alphanumeric characters and symbols other than the following: ", ', =, !, +, #, , ~, ;, ^, (, ), <, >, [, ], the white space character.

Parameter
Name Description
var string
Returns
Type Description
$this

getDisplayName

Optional. Descriptive name for the AdSpot.This value is optional if customSpot is true, and cannot be set otherwise.

Returns
Type Description
string

hasDisplayName

clearDisplayName

setDisplayName

Optional. Descriptive name for the AdSpot.This value is optional if customSpot is true, and cannot be set otherwise.

Parameter
Name Description
var string
Returns
Type Description
$this

getCustomSpot

Optional. Whether this ad spot is a custom spot. This field is optional and defaults to false. Custom spots can be reused and targeted in the targeting picker.

Returns
Type Description
bool

hasCustomSpot

clearCustomSpot

setCustomSpot

Optional. Whether this ad spot is a custom spot. This field is optional and defaults to false. Custom spots can be reused and targeted in the targeting picker.

Parameter
Name Description
var bool
Returns
Type Description
$this

getFlexible

Optional. Whether this ad spot is a flexible spot. This field is optional and defaults to false. Flexible spots are allowed to have no max number of ads.

Returns
Type Description
bool

hasFlexible

clearFlexible

setFlexible

Optional. Whether this ad spot is a flexible spot. This field is optional and defaults to false. Flexible spots are allowed to have no max number of ads.

Parameter
Name Description
var bool
Returns
Type Description
$this

getMaxDuration

Optional. The maximum total duration for this AdSpot. This field is optional, defaults to 0, and supports precision to the nearest second.

Returns
Type Description
Google\Protobuf\Duration|null

hasMaxDuration

clearMaxDuration

setMaxDuration

Optional. The maximum total duration for this AdSpot. This field is optional, defaults to 0, and supports precision to the nearest second.

Parameter
Name Description
var Google\Protobuf\Duration
Returns
Type Description
$this

getMinAdDuration

Optional. The minimum allowed duration for ads in the AdSpot. This field is optional and defaults to 0.

Returns
Type Description
Google\Protobuf\Duration|null

hasMinAdDuration

clearMinAdDuration

setMinAdDuration

Optional. The minimum allowed duration for ads in the AdSpot. This field is optional and defaults to 0.

Parameter
Name Description
var Google\Protobuf\Duration
Returns
Type Description
$this

getMaxAdDuration

Required. The maximum allowed duration for ads in the AdSpot. This field is required and must be greater than min_ad_duration.

Returns
Type Description
Google\Protobuf\Duration|null

hasMaxAdDuration

clearMaxAdDuration

setMaxAdDuration

Required. The maximum allowed duration for ads in the AdSpot. This field is required and must be greater than min_ad_duration.

Parameter
Name Description
var Google\Protobuf\Duration
Returns
Type Description
$this

getMaxAds

Optional. The maximum number of ads allowed in the AdSpot. This field is optional and defaults to 0. A value of 0 means that there is no maximum for the number of ads in the ad spot. No max ads is only supported for ad spots that have flexible set to true.

Returns
Type Description
int

hasMaxAds

clearMaxAds

setMaxAds

Optional. The maximum number of ads allowed in the AdSpot. This field is optional and defaults to 0. A value of 0 means that there is no maximum for the number of ads in the ad spot. No max ads is only supported for ad spots that have flexible set to true.

Parameter
Name Description
var int
Returns
Type Description
$this

getTargetingType

Optional. The AdSpot TargetingType determines how this ad spot can be targeted. This field is required.

Returns
Type Description
int

hasTargetingType

clearTargetingType

setTargetingType

Optional. The AdSpot TargetingType determines how this ad spot can be targeted. This field is required.

Parameter
Name Description
var int
Returns
Type Description
$this

getBackfillBlocked

Optional. Whether backfill is blocked in this ad spot. This field is optional and defaults to false.

Returns
Type Description
bool

hasBackfillBlocked

clearBackfillBlocked

setBackfillBlocked

Optional. Whether backfill is blocked in this ad spot. This field is optional and defaults to false.

Parameter
Name Description
var bool
Returns
Type Description
$this

getAllowedLineItemTypes

Optional. The set of line item types that may appear in the ad spot. This field is optional and defaults to an empty set, which means that all types are allowed. Note, backfill reservation types are controlled by the backfillBlocked field.

Returns
Type Description
Google\Protobuf\RepeatedField<int>

setAllowedLineItemTypes

Optional. The set of line item types that may appear in the ad spot. This field is optional and defaults to an empty set, which means that all types are allowed. Note, backfill reservation types are controlled by the backfillBlocked field.

Parameter
Name Description
var int[]
Returns
Type Description
$this

getInventorySharingBlocked

Optional. Whether inventory sharing is blocked in this ad spot. This field is optional and defaults to false.

Returns
Type Description
bool

hasInventorySharingBlocked

clearInventorySharingBlocked

setInventorySharingBlocked

Optional. Whether inventory sharing is blocked in this ad spot. This field is optional and defaults to false.

Parameter
Name Description
var bool
Returns
Type Description
$this