Show / Hide Table of Contents

Class AdUnit

The AdUnit resource.

Inheritance
object
AdUnit
Implements
IMessage<AdUnit>
IEquatable<AdUnit>
IDeepCloneable<AdUnit>
IBufferMessage
IMessage
Inherited Members
object.GetHashCode()
object.GetType()
object.ToString()
Namespace: Google.Ads.AdManager.V1
Assembly: Google.Ads.AdManager.V1.dll
Syntax
public sealed class AdUnit : IMessage<AdUnit>, IEquatable<AdUnit>, IDeepCloneable<AdUnit>, IBufferMessage, IMessage

Constructors

AdUnit()

Declaration
public AdUnit()

AdUnit(AdUnit)

Declaration
public AdUnit(AdUnit other)
Parameters
Type Name Description
AdUnit other

Properties

AdUnitCode

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.

Declaration
public string AdUnitCode { get; set; }
Property Value
Type Description
string

AdUnitId

Output only. AdUnit ID.

Declaration
public long AdUnitId { get; set; }
Property Value
Type Description
long

AdUnitName

AdUnitName-typed view over the Name resource name property.

Declaration
public AdUnitName AdUnitName { get; set; }
Property Value
Type Description
AdUnitName

AdUnitSizes

Optional. The sizes that can be served inside this ad unit.

Declaration
public RepeatedField<AdUnitSize> AdUnitSizes { get; }
Property Value
Type Description
RepeatedField<AdUnitSize>

AppliedAdsenseEnabled

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.

Declaration
public bool AppliedAdsenseEnabled { get; set; }
Property Value
Type Description
bool

AppliedLabelFrequencyCaps

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.

Declaration
public RepeatedField<LabelFrequencyCap> AppliedLabelFrequencyCaps { get; }
Property Value
Type Description
RepeatedField<LabelFrequencyCap>

AppliedLabels

Optional. The set of labels applied directly to this ad unit.

Declaration
public RepeatedField<AppliedLabel> AppliedLabels { get; }
Property Value
Type Description
RepeatedField<AppliedLabel>

AppliedTargetWindow

Optional. The target window directly applied to this AdUnit. If this field is not set, this AdUnit uses the target window specified in effectiveTargetWindow.

Declaration
public TargetWindowEnum.Types.TargetWindow AppliedTargetWindow { get; set; }
Property Value
Type Description
TargetWindowEnum.Types.TargetWindow

AppliedTeams

Optional. The resource names of Teams directly applied to this AdUnit. Format: "networks/{network_code}/teams/{team_id}"

Declaration
public RepeatedField<string> AppliedTeams { get; }
Property Value
Type Description
RepeatedField<string>

AppliedTeamsAsTeamNames

TeamName-typed view over the AppliedTeams resource name property.

Declaration
public ResourceNameList<TeamName> AppliedTeamsAsTeamNames { get; }
Property Value
Type Description
ResourceNameList<TeamName>

Description

Optional. A description of the ad unit. The maximum length is 65,535 characters.

Declaration
public string Description { get; set; }
Property Value
Type Description
string

DisplayName

Required. The display name of the ad unit. Its maximum length is 255 characters.

Declaration
public string DisplayName { get; set; }
Property Value
Type Description
string

EffectiveAdsenseEnabled

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.

Declaration
public bool EffectiveAdsenseEnabled { get; set; }
Property Value
Type Description
bool

EffectiveAppliedLabels

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.

Declaration
public RepeatedField<AppliedLabel> EffectiveAppliedLabels { get; }
Property Value
Type Description
RepeatedField<AppliedLabel>

EffectiveLabelFrequencyCaps

Output only. The label frequency caps applied directly to the ad unit as well as those inherited from parent ad units.

Declaration
public RepeatedField<LabelFrequencyCap> EffectiveLabelFrequencyCaps { get; }
Property Value
Type Description
RepeatedField<LabelFrequencyCap>

EffectiveTargetWindow

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.

Declaration
public TargetWindowEnum.Types.TargetWindow EffectiveTargetWindow { get; set; }
Property Value
Type Description
TargetWindowEnum.Types.TargetWindow

ExplicitlyTargeted

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.

Declaration
public bool ExplicitlyTargeted { get; set; }
Property Value
Type Description
bool

ExternalSetTopBoxChannelId

Optional. Determines what set top box video on demand channel this ad unit corresponds to in an external set top box ad campaign system.

Declaration
public string ExternalSetTopBoxChannelId { get; set; }
Property Value
Type Description
string

HasAppliedAdsenseEnabled

Gets whether the "applied_adsense_enabled" field is set

Declaration
public bool HasAppliedAdsenseEnabled { get; }
Property Value
Type Description
bool

HasChildren

Output only. This field is set to true if the ad unit has any children.

Declaration
public bool HasChildren { get; set; }
Property Value
Type Description
bool

Name

Identifier. The resource name of the AdUnit. Format: networks/{network_code}/adUnits/{ad_unit_id}

Declaration
public string Name { get; set; }
Property Value
Type Description
string

ParentAdUnit

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}"

Declaration
public string ParentAdUnit { get; set; }
Property Value
Type Description
string

ParentAdUnitAsAdUnitName

AdUnitName-typed view over the ParentAdUnit resource name property.

Declaration
public AdUnitName ParentAdUnitAsAdUnitName { get; set; }
Property Value
Type Description
AdUnitName

ParentPath

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.

Declaration
public RepeatedField<AdUnitParent> ParentPath { get; }
Property Value
Type Description
RepeatedField<AdUnitParent>

RefreshDelay

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.

Declaration
public Duration RefreshDelay { get; set; }
Property Value
Type Description
Duration

SmartSizeMode

Optional. The smart size mode for this ad unit. This attribute is optional and defaults to SmartSizeMode.NONE for fixed sizes.

Declaration
public SmartSizeModeEnum.Types.SmartSizeMode SmartSizeMode { get; set; }
Property Value
Type Description
SmartSizeModeEnum.Types.SmartSizeMode

Status

Output only. The status of this ad unit. It defaults to ACTIVE.

Declaration
public AdUnitStatusEnum.Types.AdUnitStatus Status { get; set; }
Property Value
Type Description
AdUnitStatusEnum.Types.AdUnitStatus

Teams

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}"

Declaration
public RepeatedField<string> Teams { get; }
Property Value
Type Description
RepeatedField<string>

TeamsAsTeamNames

TeamName-typed view over the Teams resource name property.

Declaration
public ResourceNameList<TeamName> TeamsAsTeamNames { get; }
Property Value
Type Description
ResourceNameList<TeamName>

UpdateTime

Output only. The time this AdUnit was last modified.

Declaration
public Timestamp UpdateTime { get; set; }
Property Value
Type Description
Timestamp
In this article
Back to top Generated by DocFX