Adsense Host API

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

An Ad Unit resource includes several identifying properties for the ad unit.

{
  "code": string,
  "id": string,
  "kind": "adsensehost#adUnit",
  "name": string,
  "customStyle": {
    "kind": "adsensehost#adStyle",
    "colors": {
      "border": string,
      "title": string,
      "background": string,
      "text": string,
      "url": string
    },
    "corners": string,
    "font": {
      "family": string,
      "size": string
    }
  },
  "contentAdsSettings": {
    "type": string,
    "size": string,
    "backupOption": {
      "type": string,
      "color": string,
      "url": string
    }
  },
  "mobileContentAdsSettings": {
    "type": string,
    "size": string,
    "markupLanguage": string,
    "scriptingLanguage": 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 adsensehost#adUnit.
name string Name of this ad unit.
customStyle nested object Custom style information specific to this ad unit.
customStyle.kind string Kind this is, in this case adsensehost#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.
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.

Methods

delete
Delete the specified ad unit from the specified publisher AdSense account.
get
Get the specified host ad unit in this AdSense account.
getAdCode
Get ad code for the specified ad unit, attaching the specified host custom channels.
insert
Insert the supplied ad unit into the specified publisher AdSense account.
list
List all ad units in the specified publisher's AdSense account.
patch
Update the supplied ad unit in the specified publisher AdSense account. This method supports patch semantics.
update
Update the supplied ad unit in the specified publisher 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.