REST Resource: accounts.adUnits
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
資源:AdUnit
JSON 表示法 |
{
"name": string,
"adUnitId": string,
"appId": string,
"displayName": string,
"adFormat": string,
"adTypes": [
string
],
"rewardSettings": {
object (RewardSettings )
}
} |
欄位 |
name |
string
此廣告單元的資源名稱。格式為 accounts/{publisherId}/adUnits/{ad_unit_id_fragment} 範例:accounts/pub-9876543210987654/adUnits/0123456789
|
adUnitId |
string
廣告單元的外部可見 ID,可用來整合 AdMob SDK。這是唯讀屬性。範例:ca-app-pub-9876543210987654/0123456789
|
appId |
string
這個廣告單元相關應用程式的外部可見 ID。範例:ca-app-pub-9876543210987654~0123456789
|
displayName |
string
AdMob UI 中顯示的廣告單元顯示名稱,由使用者提供。長度上限為 80 個半形字元。
|
adFormat |
string
廣告單元的廣告格式。可能的值如下: 「APP_OPEN」- 應用程式開啟頁面廣告格式。「橫幅」- 橫幅廣告格式。「BANNER_INTERSTITIAL」- 舊格式,可做為橫幅廣告或插頁式廣告。您無法再建立這個格式,但可以由中介服務群組指定。「INTERSTITIAL」- 全螢幕廣告。支援的廣告類型為「RICH_MEDIA」和「VIDEO」「NATIVE」- 原生廣告格式。「已獲得獎勵」- 廣告會在使用者觀看廣告時獲得驗證檢視畫面的回呼,以便獎勵給使用者。支援的廣告類型為「RICH_MEDIA」(互動式) 以及影片無法排除的影片。「REWARDED_INTERSTITIAL」- 插頁式獎勵廣告格式。僅支援影片廣告類型。詳情請參閱 https://support.google.com/admob/answer/9884467。
|
adTypes[] |
string
此廣告單元支援的廣告媒體類型。可能的值如下: 「RICH_MEDIA」- 文字、圖像和其他非影片媒體。「影片」- 影片媒體。
|
rewardSettings |
object (RewardSettings )
選用設定。獎勵廣告單元的設定。只有在廣告格式為「REWARDED」時,您才能設定或取消設定。
|
RewardSettings
JSON 表示法 |
{
"unitAmount": string,
"unitType": string
} |
欄位 |
unitAmount |
string (int64 format)
此廣告單元的獎勵金額。
|
unitType |
string
此廣告單元的獎勵項目。
|
方法 |
|
在指定的 AdMob 帳戶中建立廣告單元。 |
|
列出指定 AdMob 帳戶下的廣告單元。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-21 (世界標準時間)。
[null,null,["上次更新時間:2025-08-21 (世界標準時間)。"],[[["\u003cp\u003eThe AdUnit resource describes an AdMob ad unit, containing properties like name, ID, format, and reward settings.\u003c/p\u003e\n"],["\u003cp\u003eAdUnits support various ad formats, including banner, interstitial, rewarded, and native, each with specific properties and functionalities.\u003c/p\u003e\n"],["\u003cp\u003eRewardSettings, applicable to rewarded ad units, define the reward amount and type for users upon viewing an ad.\u003c/p\u003e\n"],["\u003cp\u003eYou can manage AdUnits using the AdMob API to create new units and list existing ones under your account.\u003c/p\u003e\n"]]],["The core content details AdUnit and RewardSettings resources, including their JSON representations and fields. AdUnit describes an AdMob ad unit with properties like name, ID, app association, display name, format (e.g., banner, interstitial, rewarded), and supported ad types (e.g., rich media, video). RewardSettings defines settings for rewarded ad units, specifying the reward amount and item. Key methods are to create and list ad units under a given AdMob account.\n"],null,["# REST Resource: accounts.adUnits\n\n- [Resource: AdUnit](#AdUnit)\n - [JSON representation](#AdUnit.SCHEMA_REPRESENTATION)\n- [RewardSettings](#RewardSettings)\n - [JSON representation](#RewardSettings.SCHEMA_REPRESENTATION)\n- [Methods](#METHODS_SUMMARY)\n\nResource: AdUnit\n----------------\n\nDescribes an AdMob ad unit.\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"name\": string, \"adUnitId\": string, \"appId\": string, \"displayName\": string, \"adFormat\": string, \"adTypes\": [ string ], \"rewardSettings\": { object (/admob/api/reference/rest/v1beta/accounts.adUnits#RewardSettings) } } ``` |\n\n| Fields ||\n|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `name` | `string` Resource name for this ad unit. Format is accounts/{publisherId}/adUnits/{ad_unit_id_fragment} Example: accounts/pub-9876543210987654/adUnits/0123456789 |\n| `adUnitId` | `string` The externally visible ID of the ad unit which can be used to integrate with the AdMob SDK. This is a read only property. Example: ca-app-pub-9876543210987654/0123456789 |\n| `appId` | `string` The externally visible ID of the app this ad unit is associated with. Example: ca-app-pub-9876543210987654\\~0123456789 |\n| `displayName` | `string` The display name of the ad unit as shown in the AdMob UI, which is provided by the user. The maximum length allowed is 80 characters. |\n| `adFormat` | `string` AdFormat of the ad unit. Possible values are as follows: \"APP_OPEN\" - App Open ad format. \"BANNER\" - Banner ad format. \"BANNER_INTERSTITIAL\" - Legacy format that can be used as either banner or interstitial. This format can no longer be created but can be targeted by mediation groups. \"INTERSTITIAL\" - A full screen ad. Supported ad types are \"RICH_MEDIA\" and \"VIDEO\". \"NATIVE\" - Native ad format. \"REWARDED\" - An ad that, once viewed, gets a callback verifying the view so that a reward can be given to the user. Supported ad types are \"RICH_MEDIA\" (interactive) and video where video can not be excluded. \"REWARDED_INTERSTITIAL\" - Rewarded Interstitial ad format. Only supports video ad type. See \u003chttps://support.google.com/admob/answer/9884467\u003e. |\n| `adTypes[]` | `string` Ad media type supported by this ad unit. Possible values as follows: \"RICH_MEDIA\" - Text, image, and other non-video media. \"VIDEO\" - Video media. |\n| `rewardSettings` | `object (`[RewardSettings](/admob/api/reference/rest/v1beta/accounts.adUnits#RewardSettings)`)` Optional. Settings for a rewarded ad unit. This can be set or unset only when the adFormat is \"REWARDED\". |\n\nRewardSettings\n--------------\n\nSettings for a rewarded ad unit.\n\n| JSON representation |\n|------------------------------------------------------|\n| ``` { \"unitAmount\": string, \"unitType\": string } ``` |\n\n| Fields ||\n|--------------|---------------------------------------------------------------------------------------------------------------------|\n| `unitAmount` | `string (`[int64](https://developers.google.com/discovery/v1/type-format)` format)` Reward amount for this ad unit. |\n| `unitType` | `string` Reward item for this ad unit. |\n\n| Methods ------- ||\n|------------------------------------------------------------------------|-------------------------------------------------------|\n| ### [create](/admob/api/reference/rest/v1beta/accounts.adUnits/create) | Creates an ad unit under the specified AdMob account. |\n| ### [list](/admob/api/reference/rest/v1beta/accounts.adUnits/list) | List the ad units under the specified AdMob account. |"]]