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, "status": 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. | |
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. These are represented as six hexadecimal characters, similar to HTML color codes, but without the leading hash. | |
contentAdsSettings.backupOption.type |
string |
Type of the backup option.
Acceptable values are:
|
|
contentAdsSettings.backupOption.url |
string |
URL to use when type is set to URL. | |
contentAdsSettings.size |
string |
Size of this ad unit. Size values are in the form SIZE_{width}_{height}. | |
contentAdsSettings.type |
string |
Type of this ad unit. Possible values are TEXT, TEXT_IMAGE, IMAGE and LINK. | |
customStyle |
nested object |
Custom style information specific to this ad unit. | |
customStyle.colors |
object |
The colors 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:
|
|
customStyle.font |
object |
The font which is included in the style. | |
customStyle.font.family |
string |
The family of the font.
Acceptable values are:
|
|
customStyle.font.size |
string |
The size of the font.
Acceptable values are:
|
|
customStyle.kind |
string |
Kind this is, in this case adsensehost#adStyle. | |
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. | |
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:
|
|
mobileContentAdsSettings.scriptingLanguage |
string |
The scripting language to use for this ad unit.
Acceptable values are:
|
|
mobileContentAdsSettings.size |
string |
Size of this ad unit. | |
mobileContentAdsSettings.type |
string |
Type of this ad unit. | |
name |
string |
Name of this ad unit. | |
status |
string |
Status of this ad unit.
Acceptable values are:
|
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.