
Google has recently launched a new AdSense Management API. This goes from version version 1.4 all the way jumping to version 2.0 with this update. Version 1.4 will stop working on October 12, 2021. Google also made updates to the AdSense Host API.
Google has launched version 2 of the AdSense Management API. Please note that the current version of the AdSense Management API, version 1.4, will stop returning responses on October 12, 2021. Here is a list of features added or changed in version 2.0:
General
- All deprecated methods in v1.4 have been removed. This includes resource
methods that did not require an
accountId. In v2, theaccountIdis specified in theparentfield. - Per Google API standards, resources are now identified by a
namefield. For example, an AdClient’s name would look likeaccounts/{accountId}/adclients/{adClientId}. Additionally, in v1.4 the resource ID was used as a reporting dimension, but in v2 that value is now available through areporting_dimension_idfield on several resources. - The
kindfield has been removed from all resources.
Account
- The
namefield has been changed todisplay_name. - The
timezonefield has been changed from a string to agoogle.type.TimeZone. - The
creation_timefield (type int64) has been changed tocreate_time(typegoogle.protobuf.Timestamp). - Added a
pending_tasksfield which is a list of outstanding tasks that need to be completed as part of the sign-up process for a new account. For example, tasks could be related to your billing profile or phone verification. - The
sub_accountsfield has been removed. Similar functionality can be achieved in v2 with thelistChildAccountscustom method. The full child account tree can be generated in v2 by callinglistChildAccountsrecursively.
AdClient
- Removed the
arc_opt_infield since it has already been removed from the AdSense UI. - The
supports_reportingfield is replaced with thereporting_dimension_idfield, which represents the unique ID of the ad client as used in theAD_CLIENT_IDreporting dimension. Ifreporting_dimension_idis empty, then the AdClient doesn’t support reporting.
AdUnit
- The
statusfield has been renamed tostate. Also, theACTIVEstate no longer indicates whether there has been activity on this ad unit in the last seven days. In v2, it means the ad unit has been activated by the user and can serve ads. - The
codefield has been removed. This value can still be found at the end of thenamefield (after the last forward slash). - The
contentAdsSettings.backupOptionfield has been removed. - The
typefield has been restricted to the valuesTYPE_UNSPECIFIED,DISPLAY,FEED,ARTICLE,MATCHED_CONTENT, andLINK. - Other fields that have already been removed in the AdSense UI are also
removed:
custom_style,saved_style_id,mobile_content_ads_settings,feed_ads_settings.
Alert
- The
deletemethod has been removed. - The
is_dismissiblefield has been removed. - The
localefield has been renamed tolanguage_code.
CustomChannel
- The
codefield has been removed. This value can still be found at the end of thenamefield (after the last forward slash). - The
targeting_infofield has been removed since it has already been removed from the AdSense UI.
Payment
- The
payment_datefield has been renamed todateand changed from type string to typegoogle.type.Date. - The
payment_amountfield and thepayment_amount_currency_codefield have been combined into a singlepaymentfield (e.g., "¥1,235 JPY", "$1,234.57", "£87.65").
Report
- With v2, the AdSense Management API reporting data now aligns with the AdSense UI. This means that AdMob and YouTube properties are no longer supported. Additionally, the API will only support report data going back 3 years.
- The
Metadata.dimensionsresource and theMetadata.metricsresource have been removed. - New methods have been added to generate a CSV version of the report, replacing the query parameters in v1.4. Note: for compression, you can still use the HTTP header "Accept-Encoding: gzip".
-
Some fields have been changed on ad-hoc report generation.
- The
account_idfield has been renamed toaccount. - The
dimensionfield has been renamed todimensions. - The
metricfield has been renamed tometrics. - The
filterfield has been renamed tofilters. - The
sortfield has been renamed toorder_by. - The
localefield has been renamed tolanguage_code. - The
currencyfield has been renamed tocurrency_code. - You can now specify several common ranges with
date_range(e.g.,TODAY,YESTERDAY,MONTH_TO_DATE,YEAR_TO_DATE,LAST_7_DAYS, andLAST_30_DAYS), or you can specify astart_dateandend_dateby settingdate_rangetoCUSTOM. - The
start_dateandend_datefields have been changed from type string to typegoogle.type.Date. Note: as a result, relative date keywords (e.g., "today-6d") are no longer supported. - The boolean field
use_timezone_reportinghas been replaced withreporting_time_zone, which can have one of two values:ACCOUNT_TIME_ZONEorGOOGLE_TIME_ZONE(which means PST/PDT). The default in v2 isACCOUNT_TIME_ZONE, which differs from the default in v1.4. - The
start_indexfield has been removed. - The
max_resultsfield has been renamed tolimit.
- The
-
Some fields have been changed on saved report generation.
- Added date fields (
date_range,start_date,end_date,reporting_time_zone). - Added a
currency_codefield. - The
localefield has been renamed tolanguage_code. - The
start_indexfield has been removed. - The
max_resultsfield has been removed.
- Added date fields (
SavedAdStyle
SavedAdStylehas been removed since it has already been removed from the AdSense UI.
Site
-
Siteshave been added to fetch data about websites you've added to your AdSense account. - The
statefield represents whether the site is any of the following states:REQUIRES_REVIEW,GETTING_READY,READY,NEEDS_ATTENTION. - The
auto_ads_enabledfield is a boolean that represents whether auto ads have been enabled on a particular site.
Forum discussion at Twitter.

