Version 1.2 of the API has been sunset, please move to version 1.4. Version 1.3 will be removed in February 2017.

Accounts.adunits

An Ad Unit Resource represents a saved ad unit with a specific set of ad settings that you've customized within your account.

For a list of methods for this resource, see the end of this page.

Resource representations

{
  "code": string,
  "id": string,
  "kind": "adsense#adUnit",
  "name": string,
  "status": string,
  "customStyle": {
    "kind": "adsense#adStyle",
    "colors": {
      "border": string,
      "title": string,
      "background": string,
      "text": string,
      "url": string
    },
    "corners": string,
    "font": {
      "family": string,
      "size": string
    }
  },
  "savedStyleId": string,
  "contentAdsSettings": {
    "type": string,
    "size": string,
    "backupOption": {
      "type": string,
      "color": string,
      "url": string
    }
  },
  "mobileContentAdsSettings": {
    "type": string,
    "size": string,
    "markupLanguage": string,
    "scriptingLanguage": string
  },
  "feedAdsSettings": {
    "type": string,
    "minimumWordCount": integer,
    "frequency": integer,
    "adPosition": string
  }
}
Property name Value Description Notes
code string Identity code of this ad unit, not necessarily unique across ad clients.
contentAdsSettings object Settings specific to content ads (AFC) and highend mobile content ads (AFMC - deprecated).
contentAdsSettings.backupOption object The backup option to be used in instances where no ad is available.
contentAdsSettings.backupOption.color string Color to use when type is set to COLOR.
contentAdsSettings.backupOption.type string Type of the backup option. Possible values are BLANK, COLOR and URL.

Acceptable values are:
  • "BLANK"
  • "COLOR"
  • "URL"
contentAdsSettings.backupOption.url string URL to use when type is set to URL.
contentAdsSettings.size string Size of this ad unit.
contentAdsSettings.type string Type of this ad unit.
customStyle nested object Custom style information specific to this ad unit.
customStyle.colors object The colors which are included in the style. These are represented as six hexadecimal characters, similar to HTML color codes, but without the leading hash.
customStyle.colors.background string The color of the ad background.
customStyle.colors.border string The color of the ad border.
customStyle.colors.text string The color of the ad text.
customStyle.colors.title string The color of the ad title.
customStyle.colors.url string The color of the ad url.
customStyle.corners string The style of the corners in the ad.

Acceptable values are:
  • "SLIGHTLY_ROUNDED"
  • "SQUARE"
  • "VERY_ROUNDED"
customStyle.font object The font which is included in the style.
customStyle.font.family string The family of the font.

Acceptable values are:
  • "ACCOUNT_DEFAULT_FAMILY"
  • "ADSENSE_DEFAULT_FAMILY"
  • "ARIAL"
  • "LORA"
  • "OPEN_SANS"
  • "OPEN_SANS_LIGHT"
  • "ROBOTO_LIGHT"
  • "SLABO_27"
  • "TIMES"
  • "UBUNTU_LIGHT"
  • "VERDANA"
customStyle.font.size string The size of the font.

Acceptable values are:
  • "ACCOUNT_DEFAULT_SIZE"
  • "ADSENSE_DEFAULT_SIZE"
  • "LARGE"
  • "MEDIUM"
  • "SMALL"
customStyle.kind string Kind this is, in this case adsense#adStyle.
feedAdsSettings object Settings specific to feed ads (AFF) - deprecated.
feedAdsSettings.adPosition string The position of the ads relative to the feed entries.

Acceptable values are:
  • "BOTTOM"
  • "TOP"
feedAdsSettings.frequency integer The frequency at which ads should appear in the feed (i.e. every N entries).
feedAdsSettings.minimumWordCount integer The minimum length an entry should be in order to have attached ads.
feedAdsSettings.type string The type of ads which should appear.
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.
kind string Kind of resource this is, in this case adsense#adUnit.
mobileContentAdsSettings object Settings specific to WAP mobile content ads (AFMC) - deprecated.
mobileContentAdsSettings.markupLanguage string The markup language to use for this ad unit.

Acceptable values are:
  • "CHTML"
  • "WML"
  • "XHTML"
mobileContentAdsSettings.scriptingLanguage string The scripting language to use for this ad unit.

Acceptable values are:
  • "ASP"
  • "CGI"
  • "JSP"
  • "PHP"
mobileContentAdsSettings.size string Size of this ad unit.
mobileContentAdsSettings.type string Type of this ad unit.
name string Name of this ad unit.
savedStyleId string ID of the saved ad style which holds this ad unit's style information.
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.



Acceptable values are:
  • "ACTIVE"
  • "INACTIVE"
  • "NEW"

Methods

get
Gets the specified ad unit in the specified ad client for the specified account.
list
List all ad units in the specified ad client for the specified account.

Send feedback about...

AdSense Management API
AdSense Management API