Reference documentation and code samples for the Google Ads Ad Manager V1 Client class AdUnit.
The AdUnit resource.
Generated from protobuf message google.ads.admanager.v1.AdUnit
Namespace
Google \ Ads \ AdManager \ V1Methods
__construct
Constructor.
data
array
Optional. Data for populating the Message object.
↳ name
string
Identifier. The resource name of the AdUnit. Format: networks/{network_code}/adUnits/{ad_unit_id}
↳ ad_unit_id
int|string
Output only. AdUnit ID.
↳ parent_ad_unit
string
Required. Immutable. The AdUnit's parent. Every ad unit has a parent except for the root ad unit, which is created by Google. Format: "networks/{network_code}/adUnits/{ad_unit_id}"
↳ parent_path
array< AdUnitParent
>
Output only. The path to this AdUnit in the ad unit hierarchy represented as a list from the root to this ad unit's parent. For root ad units, this list is empty.
↳ display_name
string
Required. The display name of the ad unit. Its maximum length is 255 characters.
↳ ad_unit_code
string
Immutable. A string used to uniquely identify the ad unit for the purposes of serving the ad. This attribute is optional and can be set during ad unit creation. If it is not provided, it will be assigned by Google based on the ad unit ID.
↳ status
int
Output only. The status of this ad unit. It defaults to ACTIVE.
↳ applied_target_window
int
Optional. The target window directly applied to this AdUnit. If this field is not set, this AdUnit uses the target window specified in effectiveTargetWindow.
↳ effective_target_window
int
Output only. Non-empty default. The target window of this AdUnit. This value is inherited from ancestor AdUnits and defaults to TOP if no AdUnit in the hierarchy specifies it.
↳ applied_teams
array
Optional. The resource names of Teams directly applied to this AdUnit. Format: "networks/{network_code}/teams/{team_id}"
↳ teams
array
Output only. The resource names of all Teams that this AdUnit is on as well as those inherited from parent AdUnits. Format: "networks/{network_code}/teams/{team_id}"
↳ description
string
Optional. A description of the ad unit. The maximum length is 65,535 characters.
↳ explicitly_targeted
bool
Optional. If this field is set to true, then the AdUnit will not be implicitly targeted when its parent is. Traffickers must explicitly target such an AdUnit or else no line items will serve to it. This feature is only available for Ad Manager 360 accounts.
↳ has_children
bool
Output only. This field is set to true if the ad unit has any children.
↳ update_time
↳ ad_unit_sizes
↳ external_set_top_box_channel_id
string
Optional. Determines what set top box video on demand channel this ad unit corresponds to in an external set top box ad campaign system.
↳ refresh_delay
Google\Protobuf\Duration
Optional. The duration after which an Ad Unit will automatically refresh. This is only valid for ad units in mobile apps. If not set, the ad unit will not refresh.
↳ applied_labels
↳ effective_applied_labels
array< AppliedLabel
>
Output only. Contains the set of labels applied directly to the ad unit as well as those inherited from the parent ad units. If a label has been negated, only the negated label is returned. This field is readonly and is assigned by Google.
↳ applied_label_frequency_caps
array< LabelFrequencyCap
>
Optional. The set of label frequency caps applied directly to this ad unit. There is a limit of 10 label frequency caps per ad unit.
↳ effective_label_frequency_caps
array< LabelFrequencyCap
>
Output only. The label frequency caps applied directly to the ad unit as well as those inherited from parent ad units.
↳ smart_size_mode
int
Optional. The smart size mode for this ad unit. This attribute is optional and defaults to SmartSizeMode.NONE for fixed sizes.
↳ applied_adsense_enabled
bool
Optional. The value of AdSense enabled directly applied to this ad unit. This attribute is optional and if not specified this ad unit will inherit the value of effectiveAdsenseEnabled from its ancestors.
↳ effective_adsense_enabled
bool
Output only. Specifies whether or not the AdUnit is enabled for serving ads from the AdSense content network. This attribute defaults to the ad unit's parent or ancestor's setting if one has been set. If no ancestor of the ad unit has set appliedAdsenseEnabled, the attribute is defaulted to true.
getName
Identifier. The resource name of the AdUnit.
Format: networks/{network_code}/adUnits/{ad_unit_id}
string
setName
Identifier. The resource name of the AdUnit.
Format: networks/{network_code}/adUnits/{ad_unit_id}
var
string
$this
getAdUnitId
Output only. AdUnit ID.
int|string
setAdUnitId
Output only. AdUnit ID.
var
int|string
$this
getParentAdUnit
Required. Immutable. The AdUnit's parent. Every ad unit has a parent except for the root ad unit, which is created by Google. Format: "networks/{network_code}/adUnits/{ad_unit_id}"
string
setParentAdUnit
Required. Immutable. The AdUnit's parent. Every ad unit has a parent except for the root ad unit, which is created by Google. Format: "networks/{network_code}/adUnits/{ad_unit_id}"
var
string
$this
getParentPath
Output only. The path to this AdUnit in the ad unit hierarchy represented as a list from the root to this ad unit's parent. For root ad units, this list is empty.
setParentPath
Output only. The path to this AdUnit in the ad unit hierarchy represented as a list from the root to this ad unit's parent. For root ad units, this list is empty.
$this
getDisplayName
Required. The display name of the ad unit. Its maximum length is 255 characters.
string
setDisplayName
Required. The display name of the ad unit. Its maximum length is 255 characters.
var
string
$this
getAdUnitCode
Immutable. A string used to uniquely identify the ad unit for the purposes of serving the ad. This attribute is optional and can be set during ad unit creation. If it is not provided, it will be assigned by Google based on the ad unit ID.
string
setAdUnitCode
Immutable. A string used to uniquely identify the ad unit for the purposes of serving the ad. This attribute is optional and can be set during ad unit creation. If it is not provided, it will be assigned by Google based on the ad unit ID.
var
string
$this
getStatus
Output only. The status of this ad unit. It defaults to ACTIVE.
int
setStatus
Output only. The status of this ad unit. It defaults to ACTIVE.
var
int
$this
getAppliedTargetWindow
Optional. The target window directly applied to this AdUnit.
If this field is not set, this AdUnit uses the target window specified in effectiveTargetWindow.
int
setAppliedTargetWindow
Optional. The target window directly applied to this AdUnit.
If this field is not set, this AdUnit uses the target window specified in effectiveTargetWindow.
var
int
$this
getEffectiveTargetWindow
Output only. Non-empty default. The target window of this AdUnit. This value is inherited from ancestor AdUnits and defaults to TOP if no AdUnit in the hierarchy specifies it.
int
setEffectiveTargetWindow
Output only. Non-empty default. The target window of this AdUnit. This value is inherited from ancestor AdUnits and defaults to TOP if no AdUnit in the hierarchy specifies it.
var
int
$this
getAppliedTeams
Optional. The resource names of Teams directly applied to this AdUnit.
Format: "networks/{network_code}/teams/{team_id}"
setAppliedTeams
Optional. The resource names of Teams directly applied to this AdUnit.
Format: "networks/{network_code}/teams/{team_id}"
var
string[]
$this
getTeams
Output only. The resource names of all Teams that this AdUnit is on as well as those inherited from parent AdUnits. Format: "networks/{network_code}/teams/{team_id}"
setTeams
Output only. The resource names of all Teams that this AdUnit is on as well as those inherited from parent AdUnits. Format: "networks/{network_code}/teams/{team_id}"
var
string[]
$this
getDescription
Optional. A description of the ad unit. The maximum length is 65,535 characters.
string
setDescription
Optional. A description of the ad unit. The maximum length is 65,535 characters.
var
string
$this
getExplicitlyTargeted
Optional. If this field is set to true, then the AdUnit will not be implicitly targeted when its parent is. Traffickers must explicitly target such an AdUnit or else no line items will serve to it. This feature is only available for Ad Manager 360 accounts.
bool
setExplicitlyTargeted
Optional. If this field is set to true, then the AdUnit will not be implicitly targeted when its parent is. Traffickers must explicitly target such an AdUnit or else no line items will serve to it. This feature is only available for Ad Manager 360 accounts.
var
bool
$this
getHasChildren
Output only. This field is set to true if the ad unit has any children.
bool
setHasChildren
Output only. This field is set to true if the ad unit has any children.
var
bool
$this
getUpdateTime
Output only. The time this AdUnit was last modified.
hasUpdateTime
clearUpdateTime
setUpdateTime
Output only. The time this AdUnit was last modified.
$this
getAdUnitSizes
Optional. The sizes that can be served inside this ad unit.
setAdUnitSizes
Optional. The sizes that can be served inside this ad unit.
$this
getExternalSetTopBoxChannelId
Optional. Determines what set top box video on demand channel this ad unit corresponds to in an external set top box ad campaign system.
string
setExternalSetTopBoxChannelId
Optional. Determines what set top box video on demand channel this ad unit corresponds to in an external set top box ad campaign system.
var
string
$this
getRefreshDelay
Optional. The duration after which an Ad Unit will automatically refresh.
This is only valid for ad units in mobile apps. If not set, the ad unit will not refresh.
hasRefreshDelay
clearRefreshDelay
setRefreshDelay
Optional. The duration after which an Ad Unit will automatically refresh.
This is only valid for ad units in mobile apps. If not set, the ad unit will not refresh.
$this
getAppliedLabels
Optional. The set of labels applied directly to this ad unit.
setAppliedLabels
Optional. The set of labels applied directly to this ad unit.
$this
getEffectiveAppliedLabels
Output only. Contains the set of labels applied directly to the ad unit as well as those inherited from the parent ad units. If a label has been negated, only the negated label is returned. This field is readonly and is assigned by Google.
setEffectiveAppliedLabels
Output only. Contains the set of labels applied directly to the ad unit as well as those inherited from the parent ad units. If a label has been negated, only the negated label is returned. This field is readonly and is assigned by Google.
$this
getAppliedLabelFrequencyCaps
Optional. The set of label frequency caps applied directly to this ad unit.
There is a limit of 10 label frequency caps per ad unit.
setAppliedLabelFrequencyCaps
Optional. The set of label frequency caps applied directly to this ad unit.
There is a limit of 10 label frequency caps per ad unit.
$this
getEffectiveLabelFrequencyCaps
Output only. The label frequency caps applied directly to the ad unit as well as those inherited from parent ad units.
setEffectiveLabelFrequencyCaps
Output only. The label frequency caps applied directly to the ad unit as well as those inherited from parent ad units.
$this
getSmartSizeMode
Optional. The smart size mode for this ad unit. This attribute is optional and defaults to SmartSizeMode.NONE for fixed sizes.
int
setSmartSizeMode
Optional. The smart size mode for this ad unit. This attribute is optional and defaults to SmartSizeMode.NONE for fixed sizes.
var
int
$this
getAppliedAdsenseEnabled
Optional. The value of AdSense enabled directly applied to this ad unit.
This attribute is optional and if not specified this ad unit will inherit the value of effectiveAdsenseEnabled from its ancestors.
bool
hasAppliedAdsenseEnabled
clearAppliedAdsenseEnabled
setAppliedAdsenseEnabled
Optional. The value of AdSense enabled directly applied to this ad unit.
This attribute is optional and if not specified this ad unit will inherit the value of effectiveAdsenseEnabled from its ancestors.
var
bool
$this
getEffectiveAdsenseEnabled
Output only. Specifies whether or not the AdUnit is enabled for serving ads from the AdSense content network. This attribute defaults to the ad unit's parent or ancestor's setting if one has been set. If no ancestor of the ad unit has set appliedAdsenseEnabled, the attribute is defaulted to true.
bool
setEffectiveAdsenseEnabled
Output only. Specifies whether or not the AdUnit is enabled for serving ads from the AdSense content network. This attribute defaults to the ad unit's parent or ancestor's setting if one has been set. If no ancestor of the ad unit has set appliedAdsenseEnabled, the attribute is defaulted to true.
var
bool
$this