REST Resource: networks.adUnits

Resource: AdUnit

The AdUnit resource.

JSON representation
{
  "name": string,
  "adUnitId": string,
  "parentAdUnit": string,
  "parentPath": [
    {
      object (AdUnitParent)
    }
  ],
  "displayName": string,
  "adUnitCode": string,
  "status": enum (AdUnitStatus),
  "appliedTargetWindow": enum (TargetWindow),
  "effectiveTargetWindow": enum (TargetWindow),
  "appliedTeams": [
    string
  ],
  "teams": [
    string
  ],
  "description": string,
  "explicitlyTargeted": boolean,
  "hasChildren": boolean,
  "updateTime": string,
  "adUnitSizes": [
    {
      object (AdUnitSize)
    }
  ],
  "externalSetTopBoxChannelId": string,
  "refreshDelay": string,
  "appliedLabels": [
    {
      object (AppliedLabel)
    }
  ],
  "effectiveAppliedLabels": [
    {
      object (AppliedLabel)
    }
  ],
  "appliedLabelFrequencyCaps": [
    {
      object (LabelFrequencyCap)
    }
  ],
  "effectiveLabelFrequencyCaps": [
    {
      object (LabelFrequencyCap)
    }
  ],
  "smartSizeMode": enum (SmartSizeMode),
  "effectiveAdsenseEnabled": boolean,
  "appliedAdsenseEnabled": boolean
}
Fields
name

string

Identifier. The resource name of the AdUnit. Format: networks/{networkCode}/adUnits/{adUnitId}

adUnitId

string (int64 format)

Output only. AdUnit ID.

parentAdUnit

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/{networkCode}/adUnits/{adUnitId}"

parentPath[]

object (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.

displayName

string

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

adUnitCode

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 off of the ad unit ID.

status

enum (AdUnitStatus)

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

appliedTargetWindow

enum (TargetWindow)

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

effectiveTargetWindow

enum (TargetWindow)

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.

appliedTeams[]

string

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

teams[]

string

Output only. The resource names of all Teams that this AdUnit is on as well as those inherited from parent AdUnits. Format: "networks/{networkCode}/teams/{teamId}"

description

string

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

explicitlyTargeted

boolean

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.

hasChildren

boolean

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

updateTime

string (Timestamp format)

Output only. The instant this AdUnit was last modified.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

adUnitSizes[]

object (AdUnitSize)

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

externalSetTopBoxChannelId

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.

refreshDelay

string (Duration format)

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.

A duration in seconds with up to nine fractional digits, ending with 's'. Example: "3.5s".

appliedLabels[]

object (AppliedLabel)

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

effectiveAppliedLabels[]

object (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.

appliedLabelFrequencyCaps[]

object (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.

effectiveLabelFrequencyCaps[]

object (LabelFrequencyCap)

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

smartSizeMode

enum (SmartSizeMode)

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

effectiveAdsenseEnabled

boolean

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.

appliedAdsenseEnabled

boolean

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.

AdUnitParent

The summary of a parent AdUnit.

JSON representation
{
  "parentAdUnit": string,
  "displayName": string,
  "adUnitCode": string
}
Fields
parentAdUnit

string

Output only. The parent of the current AdUnit Format: networks/{networkCode}/adUnits/{adUnitId}

displayName

string

Output only. The display name of the parent AdUnit.

adUnitCode

string

Output only. A string used to uniquely identify the ad unit for the purposes of serving the ad.

AdUnitStatus

The status of an AdUnit.

Enums
AD_UNIT_STATUS_UNSPECIFIED Default value. This value is unused.
ACTIVE The ad unit is active, available for targeting, and serving.
INACTIVE The ad unit will be visible in the UI, but ignored by serving.
ARCHIVED The ad unit will be hidden in the UI and ignored by serving.

TargetWindow

Corresponds to an HTML link's target attribute. See http://www.w3.org/TR/html401/present/frames.html#adef-target

Enums
TARGET_WINDOW_UNSPECIFIED Default value. This value is unused.
TOP Specifies that the link should open in the full body of the page.
BLANK Specifies that the link should open in a new window.

AdUnitSize

Represents the size, environment, and companions of an ad in an ad unit.

JSON representation
{
  "size": {
    object (Size)
  },
  "environmentType": enum (EnvironmentType),
  "companions": [
    {
      object (Size)
    }
  ]
}
Fields
size

object (Size)

Required. The Size of the AdUnit.

environmentType

enum (EnvironmentType)

Required. The EnvironmentType of the AdUnit

companions[]

object (Size)

The companions for this ad unit size. Companions are only valid if the environment is VIDEO_PLAYER.

Size

Represents the dimensions of an AdUnit, LineItem, or Creative.

JSON representation
{
  "width": integer,
  "height": integer,
  "sizeType": enum (SizeType)
}
Fields
width

integer

Required. The width of the Creative, AdUnit, or LineItem.

height

integer

Required. The height of the Creative, AdUnit, or LineItem.

sizeType

enum (SizeType)

Required. The SizeType of the Creative, AdUnit, or LineItem.

SizeType

The different Size types for an ad.

Enums
SIZE_TYPE_UNSPECIFIED Default value. This value is unused.
PIXEL Dimension based size, an actual height and width in pixels.
ASPECT_RATIO Size is expressed as a ratio. For example, 4:1 could be met by a 100 x 25 sized image.
INTERSTITIAL Out-of-page (Interstitial) size that is not related to the slot it is served. This must be used with 1x1 size.
IGNORED Size is ignored. This must be used with 1x1 size.
NATIVE Native size, which is a function of the how the client renders the creative. This must be used with 1x1 size.
FLUID Fluid size. Automatically sizes the ad by filling the width of the enclosing column and adjusting the height as appropriate. This must be used with 1x1 size.
AUDIO Audio size. Used with audio ads. This must be used with 1x1 size.

EnvironmentType

The different environments in which an ad can be shown.

Enums
ENVIRONMENT_TYPE_UNSPECIFIED No value specified
BROWSER A regular web browser.
VIDEO_PLAYER Video players.

LabelFrequencyCap

Frequency cap using a label.

JSON representation
{
  "label": string,
  "frequencyCap": {
    object (FrequencyCap)
  }
}
Fields
label

string

Required. The label to used for frequency capping. Format: "networks/{networkCode}/labels/{labelId}"

frequencyCap

object (FrequencyCap)

The frequency cap.

FrequencyCap

Represents a Frequency Cap that can be applied to an entity.

JSON representation
{
  "maxImpressions": string,
  "timeAmount": string,
  "timeUnit": enum (TimeUnit)
}
Fields
maxImpressions

string (int64 format)

The maximum number of impressions for this frequency cap.

timeAmount

string (int64 format)

The number of time units over which the frequency cap is effective.

timeUnit

enum (TimeUnit)

The units of time of this frequency cap.

TimeUnit

Unit of time for the frequency cap.

Enums
TIME_UNIT_UNSPECIFIED Default value. This value is unused.
MINUTE Minute
HOUR Hour
DAY Day
WEEK Week
MONTH Month
LIFETIME Lifetime
POD Per pod of ads in a video stream. Only valid for entities in a VIDEO_PLAYER environment.
STREAM Per video stream. Only valid for entities in a VIDEO_PLAYER environment.

SmartSizeMode

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

Enums
SMART_SIZE_MODE_UNSPECIFIED Default value. This value is unused.
NONE Fixed size mode (default).
SMART_BANNER The height is fixed for the request, the width is a range.
DYNAMIC_SIZE Height and width are ranges.

Methods

get

API to retrieve an AdUnit object.

list

API to retrieve a list of AdUnit objects.