AdSense Management API

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.
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.
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 nested object Custom style information specific to this ad unit.
customStyle.kind string Kind this is, in this case adsense#adStyle.
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.border string The color of the ad border.
customStyle.colors.title string The color of the ad title.
customStyle.colors.background string The color of the ad background.
customStyle.colors.text string The color of the ad text.
customStyle.colors.url string The color of the ad url.
customStyle.corners string The style of the corners in the ad.
customStyle.font object The font which is included in the style.
customStyle.font.family string The family of the font.
customStyle.font.size string The size of the font.
savedStyleId string ID of the saved ad style which holds this ad unit's style information.
contentAdsSettings object Settings specific to content ads (AFC) and highend mobile content ads (AFMC).
contentAdsSettings.type string Type of this ad unit.
contentAdsSettings.size string Size of this ad unit.
contentAdsSettings.backupOption object The backup option to be used in instances where no ad is available.
contentAdsSettings.backupOption.type string Type of the backup option. Possible values are BLANK, COLOR and URL.
contentAdsSettings.backupOption.color string Color to use when type is set to COLOR.
contentAdsSettings.backupOption.url string URL to use when type is set to URL.
mobileContentAdsSettings object Settings specific to WAP mobile content ads (AFMC).
mobileContentAdsSettings.type string Type of this ad unit.
mobileContentAdsSettings.size string Size of this ad unit.
mobileContentAdsSettings.markupLanguage string The markup language to use for this ad unit.
mobileContentAdsSettings.scriptingLanguage string The scripting language to use for this ad unit.
feedAdsSettings object Settings specific to feed ads (AFF).
feedAdsSettings.type string The type of ads which should appear.
feedAdsSettings.minimumWordCount integer The minimum length an entry should be in order to have attached ads.
feedAdsSettings.frequency integer The frequency at which ads should appear in the feed (i.e. every N entries).
feedAdsSettings.adPosition string The position of the ads relative to the feed entries.

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.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.