Adunits

Deprecated: Due to the possibility of ambiguity, accounts with both an AdSense publisher account and an AdExchange account will throw an error when trying to use the default account. Always use accounts.list to check if there's more than one account and let the user choose in that case. After that, specify the account ID on every call using the /accounts/ namespace.

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.

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.



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

Methods

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

Send feedback about...

AdSense Management API
AdSense Management API