v1.4 of the AdSense Management API is now deprecated. This version will stop returning data on October 12, 2021. Please migrate to v2 as soon as possible.

REST Resource: accounts.adunits

Resource: AdUnit

JSON representation
{
  "id": string,
  "code": string,
  "name": string,
  "status": string,
  "customStyle": {
    object (AdStyle)
  },
  "savedStyleId": string,
  "kind": string,
  "contentAdsSettings": {
    object (ContentAdsSettings)
  },
  "mobileContentAdsSettings": {
    object (MobileContentAdsSettings)
  },
  "feedAdsSettings": {
    object (FeedAdsSettings)
  }
}
Fields
id

string

Unique identifier of this ad unit. This should be considered an opaque identifier; it is not safe to rely on it being in any particular format.

code

string

Identity code of this ad unit, not necessarily unique across ad clients.

name

string

Name of this ad unit.

status

string

Status of this ad unit. Possible values are:

NEW: Indicates that the ad unit was created within the last seven days and does not yet have any activity associated with it.

ACTIVE: Indicates that there has been activity on this ad unit in the last seven days.

INACTIVE: Indicates that there has been no activity on this ad unit in the last seven days.

customStyle

object (AdStyle)

Custom style information specific to this ad unit.

savedStyleId

string

ID of the saved ad style which holds this ad unit's style information.

kind

string

Kind of resource this is, in this case adsense#adUnit.

contentAdsSettings

object (ContentAdsSettings)

Settings specific to content ads (AFC) and highend mobile content ads (AFMC - deprecated).

mobileContentAdsSettings

object (MobileContentAdsSettings)

Settings specific to WAP mobile content ads (AFMC) - deprecated.

feedAdsSettings

object (FeedAdsSettings)

Settings specific to feed ads (AFF) - deprecated.

ContentAdsSettings

JSON representation
{
  "size": string,
  "type": string,
  "backupOption": {
    object (BackupOption)
  }
}
Fields
size

string

Size of this ad unit.

type

string

Type of this ad unit.

backupOption

object (BackupOption)

The backup option to be used in instances where no ad is available.

BackupOption

JSON representation
{
  "type": string,
  "color": string,
  "url": string
}
Fields
type

string

Type of the backup option. Possible values are BLANK, COLOR and URL.

color

string

Color to use when type is set to COLOR.

url

string

URL to use when type is set to URL.

MobileContentAdsSettings

JSON representation
{
  "markupLanguage": string,
  "scriptingLanguage": string,
  "size": string,
  "type": string
}
Fields
markupLanguage

string

The markup language to use for this ad unit.

scriptingLanguage

string

The scripting language to use for this ad unit.

size

string

Size of this ad unit.

type

string

Type of this ad unit.

FeedAdsSettings

JSON representation
{
  "minimumWordCount": integer,
  "frequency": integer,
  "adPosition": string,
  "type": string
}
Fields
minimumWordCount

integer

The minimum length an entry should be in order to have attached ads.

frequency

integer

The frequency at which ads should appear in the feed (i.e. every N entries).

adPosition

string

The position of the ads relative to the feed entries.

type

string

The type of ads which should appear.

Methods

get

Gets the specified ad unit in the specified ad client for the specified account.

getAdCode

Get ad code for the specified ad unit.

list

List all ad units in the specified ad client for the specified account.