@datafire/google_adsensehost v6.0.0
@datafire/google_adsensehost
Client library for AdSense Host API
Installation and Usage
npm install --save @datafire/google_adsensehost
let google_adsensehost = require('@datafire/google_adsensehost').create({
access_token: "",
refresh_token: "",
client_id: "",
client_secret: "",
redirect_uri: ""
});
.then(data => {
console.log(data);
});
Description
Generates performance reports, generates ad codes, and provides publisher management capabilities for AdSense Hosts.
Actions
oauthCallback
Exchange the code passed to your redirect URI for an access_token
google_adsensehost.oauthCallback({
"code": ""
}, context)
Input
- input
object
- code required
string
- code required
Output
- output
object
- access_token
string
- refresh_token
string
- token_type
string
- scope
string
- expiration
string
- access_token
oauthRefresh
Exchange a refresh_token for an access_token
google_adsensehost.oauthRefresh(null, context)
Input
This action has no parameters
Output
- output
object
- access_token
string
- refresh_token
string
- token_type
string
- scope
string
- expiration
string
- access_token
adsensehost.accounts.list
List hosted accounts associated with this AdSense account by ad client id.
google_adsensehost.adsensehost.accounts.list({
"filterAdClientId": []
}, context)
Input
- input
object
- filterAdClientId required
array
: Ad clients to list accounts for. - alt
string
(values: csv, json): Data format for the response. - fields
string
: Selector specifying which fields to include in a partial response. - key
string
: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - oauth_token
string
: OAuth 2.0 token for the current user. - prettyPrint
boolean
: Returns response with indentations and line breaks. - quotaUser
string
: An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - userIp
string
: Deprecated. Please use quotaUser instead.
- filterAdClientId required
Output
- output Accounts
adsensehost.accounts.get
Get information about the selected associated AdSense account.
google_adsensehost.adsensehost.accounts.get({
"accountId": ""
}, context)
Input
- input
object
- accountId required
string
: Account to get information about. - alt
string
(values: csv, json): Data format for the response. - fields
string
: Selector specifying which fields to include in a partial response. - key
string
: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - oauth_token
string
: OAuth 2.0 token for the current user. - prettyPrint
boolean
: Returns response with indentations and line breaks. - quotaUser
string
: An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - userIp
string
: Deprecated. Please use quotaUser instead.
- accountId required
Output
- output Account
adsensehost.accounts.adclients.list
List all hosted ad clients in the specified hosted account.
google_adsensehost.adsensehost.accounts.adclients.list({
"accountId": ""
}, context)
Input
- input
object
- accountId required
string
: Account for which to list ad clients. - maxResults
integer
: The maximum number of ad clients to include in the response, used for paging. - pageToken
string
: A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - alt
string
(values: csv, json): Data format for the response. - fields
string
: Selector specifying which fields to include in a partial response. - key
string
: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - oauth_token
string
: OAuth 2.0 token for the current user. - prettyPrint
boolean
: Returns response with indentations and line breaks. - quotaUser
string
: An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - userIp
string
: Deprecated. Please use quotaUser instead.
- accountId required
Output
- output AdClients
adsensehost.accounts.adclients.get
Get information about one of the ad clients in the specified publisher's AdSense account.
google_adsensehost.adsensehost.accounts.adclients.get({
"accountId": "",
"adClientId": ""
}, context)
Input
- input
object
- accountId required
string
: Account which contains the ad client. - adClientId required
string
: Ad client to get. - alt
string
(values: csv, json): Data format for the response. - fields
string
: Selector specifying which fields to include in a partial response. - key
string
: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - oauth_token
string
: OAuth 2.0 token for the current user. - prettyPrint
boolean
: Returns response with indentations and line breaks. - quotaUser
string
: An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - userIp
string
: Deprecated. Please use quotaUser instead.
- accountId required
Output
- output AdClient
adsensehost.accounts.adunits.list
List all ad units in the specified publisher's AdSense account.
google_adsensehost.adsensehost.accounts.adunits.list({
"accountId": "",
"adClientId": ""
}, context)
Input
- input
object
- accountId required
string
: Account which contains the ad client. - adClientId required
string
: Ad client for which to list ad units. - includeInactive
boolean
: Whether to include inactive ad units. Default: true. - maxResults
integer
: The maximum number of ad units to include in the response, used for paging. - pageToken
string
: A continuation token, used to page through ad units. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - alt
string
(values: csv, json): Data format for the response. - fields
string
: Selector specifying which fields to include in a partial response. - key
string
: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - oauth_token
string
: OAuth 2.0 token for the current user. - prettyPrint
boolean
: Returns response with indentations and line breaks. - quotaUser
string
: An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - userIp
string
: Deprecated. Please use quotaUser instead.
- accountId required
Output
- output AdUnits
adsensehost.accounts.adunits.patch
Update the supplied ad unit in the specified publisher AdSense account. This method supports patch semantics.
google_adsensehost.adsensehost.accounts.adunits.patch({
"accountId": "",
"adClientId": "",
"adUnitId": ""
}, context)
Input
- input
object
- accountId required
string
: Account which contains the ad client. - adClientId required
string
: Ad client which contains the ad unit. - adUnitId required
string
: Ad unit to get. - body AdUnit
- alt
string
(values: csv, json): Data format for the response. - fields
string
: Selector specifying which fields to include in a partial response. - key
string
: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - oauth_token
string
: OAuth 2.0 token for the current user. - prettyPrint
boolean
: Returns response with indentations and line breaks. - quotaUser
string
: An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - userIp
string
: Deprecated. Please use quotaUser instead.
- accountId required
Output
- output AdUnit
adsensehost.accounts.adunits.insert
Insert the supplied ad unit into the specified publisher AdSense account.
google_adsensehost.adsensehost.accounts.adunits.insert({
"accountId": "",
"adClientId": ""
}, context)
Input
- input
object
- accountId required
string
: Account which will contain the ad unit. - adClientId required
string
: Ad client into which to insert the ad unit. - body AdUnit
- alt
string
(values: csv, json): Data format for the response. - fields
string
: Selector specifying which fields to include in a partial response. - key
string
: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - oauth_token
string
: OAuth 2.0 token for the current user. - prettyPrint
boolean
: Returns response with indentations and line breaks. - quotaUser
string
: An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - userIp
string
: Deprecated. Please use quotaUser instead.
- accountId required
Output
- output AdUnit
adsensehost.accounts.adunits.update
Update the supplied ad unit in the specified publisher AdSense account.
google_adsensehost.adsensehost.accounts.adunits.update({
"accountId": "",
"adClientId": ""
}, context)
Input
- input
object
- accountId required
string
: Account which contains the ad client. - adClientId required
string
: Ad client which contains the ad unit. - body AdUnit
- alt
string
(values: csv, json): Data format for the response. - fields
string
: Selector specifying which fields to include in a partial response. - key
string
: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - oauth_token
string
: OAuth 2.0 token for the current user. - prettyPrint
boolean
: Returns response with indentations and line breaks. - quotaUser
string
: An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - userIp
string
: Deprecated. Please use quotaUser instead.
- accountId required
Output
- output AdUnit
adsensehost.accounts.adunits.delete
Delete the specified ad unit from the specified publisher AdSense account.
google_adsensehost.adsensehost.accounts.adunits.delete({
"accountId": "",
"adClientId": "",
"adUnitId": ""
}, context)
Input
- input
object
- accountId required
string
: Account which contains the ad unit. - adClientId required
string
: Ad client for which to get ad unit. - adUnitId required
string
: Ad unit to delete. - alt
string
(values: csv, json): Data format for the response. - fields
string
: Selector specifying which fields to include in a partial response. - key
string
: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - oauth_token
string
: OAuth 2.0 token for the current user. - prettyPrint
boolean
: Returns response with indentations and line breaks. - quotaUser
string
: An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - userIp
string
: Deprecated. Please use quotaUser instead.
- accountId required
Output
- output AdUnit
adsensehost.accounts.adunits.get
Get the specified host ad unit in this AdSense account.
google_adsensehost.adsensehost.accounts.adunits.get({
"accountId": "",
"adClientId": "",
"adUnitId": ""
}, context)
Input
- input
object
- accountId required
string
: Account which contains the ad unit. - adClientId required
string
: Ad client for which to get ad unit. - adUnitId required
string
: Ad unit to get. - alt
string
(values: csv, json): Data format for the response. - fields
string
: Selector specifying which fields to include in a partial response. - key
string
: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - oauth_token
string
: OAuth 2.0 token for the current user. - prettyPrint
boolean
: Returns response with indentations and line breaks. - quotaUser
string
: An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - userIp
string
: Deprecated. Please use quotaUser instead.
- accountId required
Output
- output AdUnit
adsensehost.accounts.adunits.getAdCode
Get ad code for the specified ad unit, attaching the specified host custom channels.
google_adsensehost.adsensehost.accounts.adunits.getAdCode({
"accountId": "",
"adClientId": "",
"adUnitId": ""
}, context)
Input
- input
object
- accountId required
string
: Account which contains the ad client. - adClientId required
string
: Ad client with contains the ad unit. - adUnitId required
string
: Ad unit to get the code for. - hostCustomChannelId
array
: Host custom channel to attach to the ad code. - alt
string
(values: csv, json): Data format for the response. - fields
string
: Selector specifying which fields to include in a partial response. - key
string
: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - oauth_token
string
: OAuth 2.0 token for the current user. - prettyPrint
boolean
: Returns response with indentations and line breaks. - quotaUser
string
: An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - userIp
string
: Deprecated. Please use quotaUser instead.
- accountId required
Output
- output AdCode
adsensehost.accounts.reports.generate
Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify "alt=csv" as a query parameter.
google_adsensehost.adsensehost.accounts.reports.generate({
"accountId": "",
"startDate": "",
"endDate": ""
}, context)
Input
- input
object
- accountId required
string
: Hosted account upon which to report. - startDate required
string
: Start of the date range to report on in "YYYY-MM-DD" format, inclusive. - endDate required
string
: End of the date range to report on in "YYYY-MM-DD" format, inclusive. - dimension
array
: Dimensions to base the report on. - filter
array
: Filters to be run on the report. - locale
string
: Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. - maxResults
integer
: The maximum number of rows of report data to return. - metric
array
: Numeric columns to include in the report. - sort
array
: The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending. - startIndex
integer
: Index of the first row of report data to return. - alt
string
(values: csv, json): Data format for the response. - fields
string
: Selector specifying which fields to include in a partial response. - key
string
: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - oauth_token
string
: OAuth 2.0 token for the current user. - prettyPrint
boolean
: Returns response with indentations and line breaks. - quotaUser
string
: An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - userIp
string
: Deprecated. Please use quotaUser instead.
- accountId required
Output
- output Report
adsensehost.adclients.list
List all host ad clients in this AdSense account.
google_adsensehost.adsensehost.adclients.list({}, context)
Input
- input
object
- maxResults
integer
: The maximum number of ad clients to include in the response, used for paging. - pageToken
string
: A continuation token, used to page through ad clients. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - alt
string
(values: csv, json): Data format for the response. - fields
string
: Selector specifying which fields to include in a partial response. - key
string
: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - oauth_token
string
: OAuth 2.0 token for the current user. - prettyPrint
boolean
: Returns response with indentations and line breaks. - quotaUser
string
: An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - userIp
string
: Deprecated. Please use quotaUser instead.
- maxResults
Output
- output AdClients
adsensehost.adclients.get
Get information about one of the ad clients in the Host AdSense account.
google_adsensehost.adsensehost.adclients.get({
"adClientId": ""
}, context)
Input
- input
object
- adClientId required
string
: Ad client to get. - alt
string
(values: csv, json): Data format for the response. - fields
string
: Selector specifying which fields to include in a partial response. - key
string
: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - oauth_token
string
: OAuth 2.0 token for the current user. - prettyPrint
boolean
: Returns response with indentations and line breaks. - quotaUser
string
: An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - userIp
string
: Deprecated. Please use quotaUser instead.
- adClientId required
Output
- output AdClient
adsensehost.customchannels.list
List all host custom channels in this AdSense account.
google_adsensehost.adsensehost.customchannels.list({
"adClientId": ""
}, context)
Input
- input
object
- adClientId required
string
: Ad client for which to list custom channels. - maxResults
integer
: The maximum number of custom channels to include in the response, used for paging. - pageToken
string
: A continuation token, used to page through custom channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - alt
string
(values: csv, json): Data format for the response. - fields
string
: Selector specifying which fields to include in a partial response. - key
string
: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - oauth_token
string
: OAuth 2.0 token for the current user. - prettyPrint
boolean
: Returns response with indentations and line breaks. - quotaUser
string
: An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - userIp
string
: Deprecated. Please use quotaUser instead.
- adClientId required
Output
- output CustomChannels
adsensehost.customchannels.patch
Update a custom channel in the host AdSense account. This method supports patch semantics.
google_adsensehost.adsensehost.customchannels.patch({
"adClientId": "",
"customChannelId": ""
}, context)
Input
- input
object
- adClientId required
string
: Ad client in which the custom channel will be updated. - customChannelId required
string
: Custom channel to get. - body CustomChannel
- alt
string
(values: csv, json): Data format for the response. - fields
string
: Selector specifying which fields to include in a partial response. - key
string
: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - oauth_token
string
: OAuth 2.0 token for the current user. - prettyPrint
boolean
: Returns response with indentations and line breaks. - quotaUser
string
: An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - userIp
string
: Deprecated. Please use quotaUser instead.
- adClientId required
Output
- output CustomChannel
adsensehost.customchannels.insert
Add a new custom channel to the host AdSense account.
google_adsensehost.adsensehost.customchannels.insert({
"adClientId": ""
}, context)
Input
- input
object
- adClientId required
string
: Ad client to which the new custom channel will be added. - body CustomChannel
- alt
string
(values: csv, json): Data format for the response. - fields
string
: Selector specifying which fields to include in a partial response. - key
string
: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - oauth_token
string
: OAuth 2.0 token for the current user. - prettyPrint
boolean
: Returns response with indentations and line breaks. - quotaUser
string
: An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - userIp
string
: Deprecated. Please use quotaUser instead.
- adClientId required
Output
- output CustomChannel
adsensehost.customchannels.update
Update a custom channel in the host AdSense account.
google_adsensehost.adsensehost.customchannels.update({
"adClientId": ""
}, context)
Input
- input
object
- adClientId required
string
: Ad client in which the custom channel will be updated. - body CustomChannel
- alt
string
(values: csv, json): Data format for the response. - fields
string
: Selector specifying which fields to include in a partial response. - key
string
: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - oauth_token
string
: OAuth 2.0 token for the current user. - prettyPrint
boolean
: Returns response with indentations and line breaks. - quotaUser
string
: An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - userIp
string
: Deprecated. Please use quotaUser instead.
- adClientId required
Output
- output CustomChannel
adsensehost.customchannels.delete
Delete a specific custom channel from the host AdSense account.
google_adsensehost.adsensehost.customchannels.delete({
"adClientId": "",
"customChannelId": ""
}, context)
Input
- input
object
- adClientId required
string
: Ad client from which to delete the custom channel. - customChannelId required
string
: Custom channel to delete. - alt
string
(values: csv, json): Data format for the response. - fields
string
: Selector specifying which fields to include in a partial response. - key
string
: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - oauth_token
string
: OAuth 2.0 token for the current user. - prettyPrint
boolean
: Returns response with indentations and line breaks. - quotaUser
string
: An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - userIp
string
: Deprecated. Please use quotaUser instead.
- adClientId required
Output
- output CustomChannel
adsensehost.customchannels.get
Get a specific custom channel from the host AdSense account.
google_adsensehost.adsensehost.customchannels.get({
"adClientId": "",
"customChannelId": ""
}, context)
Input
- input
object
- adClientId required
string
: Ad client from which to get the custom channel. - customChannelId required
string
: Custom channel to get. - alt
string
(values: csv, json): Data format for the response. - fields
string
: Selector specifying which fields to include in a partial response. - key
string
: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - oauth_token
string
: OAuth 2.0 token for the current user. - prettyPrint
boolean
: Returns response with indentations and line breaks. - quotaUser
string
: An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - userIp
string
: Deprecated. Please use quotaUser instead.
- adClientId required
Output
- output CustomChannel
adsensehost.urlchannels.list
List all host URL channels in the host AdSense account.
google_adsensehost.adsensehost.urlchannels.list({
"adClientId": ""
}, context)
Input
- input
object
- adClientId required
string
: Ad client for which to list URL channels. - maxResults
integer
: The maximum number of URL channels to include in the response, used for paging. - pageToken
string
: A continuation token, used to page through URL channels. To retrieve the next page, set this parameter to the value of "nextPageToken" from the previous response. - alt
string
(values: csv, json): Data format for the response. - fields
string
: Selector specifying which fields to include in a partial response. - key
string
: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - oauth_token
string
: OAuth 2.0 token for the current user. - prettyPrint
boolean
: Returns response with indentations and line breaks. - quotaUser
string
: An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - userIp
string
: Deprecated. Please use quotaUser instead.
- adClientId required
Output
- output UrlChannels
adsensehost.urlchannels.insert
Add a new URL channel to the host AdSense account.
google_adsensehost.adsensehost.urlchannels.insert({
"adClientId": ""
}, context)
Input
- input
object
- adClientId required
string
: Ad client to which the new URL channel will be added. - body UrlChannel
- alt
string
(values: csv, json): Data format for the response. - fields
string
: Selector specifying which fields to include in a partial response. - key
string
: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - oauth_token
string
: OAuth 2.0 token for the current user. - prettyPrint
boolean
: Returns response with indentations and line breaks. - quotaUser
string
: An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - userIp
string
: Deprecated. Please use quotaUser instead.
- adClientId required
Output
- output UrlChannel
adsensehost.urlchannels.delete
Delete a URL channel from the host AdSense account.
google_adsensehost.adsensehost.urlchannels.delete({
"adClientId": "",
"urlChannelId": ""
}, context)
Input
- input
object
- adClientId required
string
: Ad client from which to delete the URL channel. - urlChannelId required
string
: URL channel to delete. - alt
string
(values: csv, json): Data format for the response. - fields
string
: Selector specifying which fields to include in a partial response. - key
string
: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - oauth_token
string
: OAuth 2.0 token for the current user. - prettyPrint
boolean
: Returns response with indentations and line breaks. - quotaUser
string
: An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - userIp
string
: Deprecated. Please use quotaUser instead.
- adClientId required
Output
- output UrlChannel
adsensehost.associationsessions.start
Create an association session for initiating an association with an AdSense user.
google_adsensehost.adsensehost.associationsessions.start({
"productCode": [],
"websiteUrl": ""
}, context)
Input
- input
object
- productCode required
array
: Products to associate with the user. - websiteUrl required
string
: The URL of the user's hosted website. - callbackUrl
string
: The URL to redirect the user to once association is completed. It receives a token parameter that can then be used to retrieve the associated account. - userLocale
string
: The preferred locale of the user. - websiteLocale
string
: The locale of the user's hosted website. - alt
string
(values: csv, json): Data format for the response. - fields
string
: Selector specifying which fields to include in a partial response. - key
string
: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - oauth_token
string
: OAuth 2.0 token for the current user. - prettyPrint
boolean
: Returns response with indentations and line breaks. - quotaUser
string
: An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - userIp
string
: Deprecated. Please use quotaUser instead.
- productCode required
Output
- output AssociationSession
adsensehost.associationsessions.verify
Verify an association session after the association callback returns from AdSense signup.
google_adsensehost.adsensehost.associationsessions.verify({
"token": ""
}, context)
Input
- input
object
- token required
string
: The token returned to the association callback URL. - alt
string
(values: csv, json): Data format for the response. - fields
string
: Selector specifying which fields to include in a partial response. - key
string
: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - oauth_token
string
: OAuth 2.0 token for the current user. - prettyPrint
boolean
: Returns response with indentations and line breaks. - quotaUser
string
: An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - userIp
string
: Deprecated. Please use quotaUser instead.
- token required
Output
- output AssociationSession
adsensehost.reports.generate
Generate an AdSense report based on the report request sent in the query parameters. Returns the result as JSON; to retrieve output in CSV format specify "alt=csv" as a query parameter.
google_adsensehost.adsensehost.reports.generate({
"startDate": "",
"endDate": ""
}, context)
Input
- input
object
- startDate required
string
: Start of the date range to report on in "YYYY-MM-DD" format, inclusive. - endDate required
string
: End of the date range to report on in "YYYY-MM-DD" format, inclusive. - dimension
array
: Dimensions to base the report on. - filter
array
: Filters to be run on the report. - locale
string
: Optional locale to use for translating report output to a local language. Defaults to "en_US" if not specified. - maxResults
integer
: The maximum number of rows of report data to return. - metric
array
: Numeric columns to include in the report. - sort
array
: The name of a dimension or metric to sort the resulting report on, optionally prefixed with "+" to sort ascending or "-" to sort descending. If no prefix is specified, the column is sorted ascending. - startIndex
integer
: Index of the first row of report data to return. - alt
string
(values: csv, json): Data format for the response. - fields
string
: Selector specifying which fields to include in a partial response. - key
string
: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. - oauth_token
string
: OAuth 2.0 token for the current user. - prettyPrint
boolean
: Returns response with indentations and line breaks. - quotaUser
string
: An opaque string that represents a user for quota purposes. Must not exceed 40 characters. - userIp
string
: Deprecated. Please use quotaUser instead.
- startDate required
Output
- output Report
Definitions
Account
- Account
object
- id
string
: Unique identifier of this account. - kind
string
: Kind of resource this is, in this case adsensehost#account. - name
string
: Name of this account. - status
string
: Approval status of this account. One of: PENDING, APPROVED, DISABLED.
- id
Accounts
- Accounts
object
- etag
string
: ETag of this response for caching purposes. - items
array
: The accounts returned in this list response.- items Account
- kind
string
: Kind of list this is, in this case adsensehost#accounts.
- etag
AdClient
- AdClient
object
- arcOptIn
boolean
: Whether this ad client is opted in to ARC. - id
string
: Unique identifier of this ad client. - kind
string
: Kind of resource this is, in this case adsensehost#adClient. - productCode
string
: This ad client's product code, which corresponds to the PRODUCT_CODE report dimension. - supportsReporting
boolean
: Whether this ad client supports being reported on.
- arcOptIn
AdClients
- AdClients
object
- etag
string
: ETag of this response for caching purposes. - items
array
: The ad clients returned in this list response.- items AdClient
- kind
string
: Kind of list this is, in this case adsensehost#adClients. - nextPageToken
string
: Continuation token used to page through ad clients. To retrieve the next page of results, set the next request's "pageToken" value to this.
- etag
AdCode
- AdCode
object
- adCode
string
: The ad code snippet. - kind
string
: Kind this is, in this case adsensehost#adCode.
- adCode
AdStyle
- AdStyle
object
- 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.- background
string
: The color of the ad background. - border
string
: The color of the ad border. - text
string
: The color of the ad text. - title
string
: The color of the ad title. - url
string
: The color of the ad url.
- background
- corners
string
: The style of the corners in the ad (deprecated: never populated, ignored). - font
object
: The font which is included in the style.- family
string
: The family of the font. Possible values are: ACCOUNT_DEFAULT_FAMILY, ADSENSE_DEFAULT_FAMILY, ARIAL, TIMES and VERDANA. - size
string
: The size of the font. Possible values are: ACCOUNT_DEFAULT_SIZE, ADSENSE_DEFAULT_SIZE, SMALL, MEDIUM and LARGE.
- family
- kind
string
: Kind this is, in this case adsensehost#adStyle.
- colors
AdUnit
- AdUnit
object
- 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).- backupOption
object
: The backup option to be used in instances where no ad is available.- 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. - type
string
: Type of the backup option. Possible values are BLANK, COLOR and URL. - url
string
: URL to use when type is set to URL.
- color
- size
string
: Size of this ad unit. Size values are in the form SIZE{width}{height}. - type
string
: Type of this ad unit. Possible values are TEXT, TEXT_IMAGE, IMAGE and LINK.
- backupOption
- customStyle 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).- markupLanguage
string
: The markup language to use for this ad unit. - scriptingLanguage
string
: The scripting language to use for this ad unit. - size
string
: Size of this ad unit. - type
string
: Type of this ad unit.
- markupLanguage
- name
string
: Name of this ad unit. - status
string
: Status of this ad unit. Possible values are:
- code
AdUnits
- AdUnits
object
- etag
string
: ETag of this response for caching purposes. - items
array
: The ad units returned in this list response.- items AdUnit
- kind
string
: Kind of list this is, in this case adsensehost#adUnits. - nextPageToken
string
: Continuation token used to page through ad units. To retrieve the next page of results, set the next request's "pageToken" value to this.
- etag
AssociationSession
- AssociationSession
object
- accountId
string
: Hosted account id of the associated publisher after association. Present if status is ACCEPTED. - id
string
: Unique identifier of this association session. - kind
string
: Kind of resource this is, in this case adsensehost#associationSession. - productCodes
array
: The products to associate with the user. Options: AFC, AFG, AFV, AFS (deprecated), AFMC (deprecated)- items
string
- items
- redirectUrl
string
: Redirect URL of this association session. Used to redirect users into the AdSense association flow. - status
string
: Status of the completed association, available once the association callback token has been verified. One of ACCEPTED, REJECTED, or ERROR. - userLocale
string
: The preferred locale of the user themselves when going through the AdSense association flow. - websiteLocale
string
: The locale of the user's hosted website. - websiteUrl
string
: The URL of the user's hosted website.
- accountId
CustomChannel
- CustomChannel
object
- code
string
: Code of this custom channel, not necessarily unique across ad clients. - id
string
: Unique identifier of this custom channel. 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#customChannel. - name
string
: Name of this custom channel.
- code
CustomChannels
- CustomChannels
object
- etag
string
: ETag of this response for caching purposes. - items
array
: The custom channels returned in this list response.- items CustomChannel
- kind
string
: Kind of list this is, in this case adsensehost#customChannels. - nextPageToken
string
: Continuation token used to page through custom channels. To retrieve the next page of results, set the next request's "pageToken" value to this.
- etag
Report
- Report
object
- averages
array
: The averages of the report. This is the same length as any other row in the report; cells corresponding to dimension columns are empty.- items
string
- items
- headers
array
: The header information of the columns requested in the report. This is a list of headers; one for each dimension in the request, followed by one for each metric in the request.- items
object
- currency
string
: The currency of this column. Only present if the header type is METRIC_CURRENCY. - name
string
: The name of the header. - type
string
: The type of the header; one of DIMENSION, METRIC_TALLY, METRIC_RATIO, or METRIC_CURRENCY.
- currency
- items
- kind
string
: Kind this is, in this case adsensehost#report. - rows
array
: The output rows of the report. Each row is a list of cells; one for each dimension in the request, followed by one for each metric in the request. The dimension cells contain strings, and the metric cells contain numbers.- items
array
- items
string
- items
- items
- totalMatchedRows
string
: The total number of rows matched by the report request. Fewer rows may be returned in the response due to being limited by the row count requested or the report row limit. - totals
array
: The totals of the report. This is the same length as any other row in the report; cells corresponding to dimension columns are empty.- items
string
- items
- warnings
array
: Any warnings associated with generation of the report.- items
string
- items
- averages
UrlChannel
- UrlChannel
object
- id
string
: Unique identifier of this URL channel. 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#urlChannel. - urlPattern
string
: URL Pattern of this URL channel. Does not include "http://" or "https://". Example: www.example.com/home
- id
UrlChannels
- UrlChannels
object
- etag
string
: ETag of this response for caching purposes. - items
array
: The URL channels returned in this list response.- items UrlChannel
- kind
string
: Kind of list this is, in this case adsensehost#urlChannels. - nextPageToken
string
: Continuation token used to page through URL channels. To retrieve the next page of results, set the next request's "pageToken" value to this.
- etag