Use AccountService to create new AdSense accounts for
your publishers, associate existing publisher accounts with your site,
and update publisher account settings.
To create an AdSense account, use the
createAccount
request with input parameters that describe the publisher and
website. Parameters that describe the publisher are loginEmail,
entityType (Business or Individual), usersPreferredLocale,
emailPromotionsPreferences, and hasAcceptedTCs.
Parameters that describe the website are
synServiceTypes,
websiteUrl, and websiteLocale.
Note that each AdSense account is associated with a single website URL.
The response to creating an account is a SyndicationService_Data object, which holds the publisher ID. This ID uniquely identifies the publisher and is used as the synServiceId parameter in operations in related services.
You can view and make modifications to many of the values originally passed in when an account was created, such as the password and email preferences. AccountService has administrative operations:
and website operations:
After you have created a new AdSense account, you can use the other services to generate an ad code snippet, modify the ad style, layout and type, and set site filters.
The version 2 WSDL for this service is at https://www.google.com/api/adsense/v2/AccountService?wsdl.
The version 3 WSDL for this service is at https://www.google.com/api/adsense/v3/AccountService?wsdl.
Requests
Adds the SyndicationService corresponding to
synServiceType to the publisher's account.
| Parameter name | Parameter type | Parameter description |
|---|---|---|
| synServiceType | SyndicationService_Type |
type of the SyndicationService
Values are:
|
| Response type | Response description |
|---|---|
(none) |
SyndicationService| Error number | Error description |
|---|---|
| 332 | if the publisher is already signed up for synServiceType. |
Creates an association between the developer and the publisher. If an association already exists, the method does nothing. The loginEmail and one or both of postalCode and phone are required. Before creating the association this method does some sanity checks to match the account with the provided postal code and phone hints. If either of the hints match, then it sets up the MPM association. Otherwise returns an error.
| Parameter name | Parameter type | Parameter description |
|---|---|---|
| loginEmail | string |
the email address of the publisher |
| postalCode | string |
the postalCode hint |
| phone | string |
phone hint consisting of the last 5 digits of the
publisher's telephone number, excluding punctuation. For example,
the phone hint for (650)253-8000 would be "38000". |
| developerUrl | string |
the site to be associated with this publisher. |
| Response type | Response description |
|---|---|
SyndicationService_Data[] |
the SyndicationService_Data objects corresponding
to synServiceTypes.
A SyndicationService_Data
object contains a client ID and syndication type. For example:
<id>ca-pub-9644922955003912</id> <type>ContentAds</type> |
| Error number | Error description |
|---|---|
| 105 | if loginEmail does not correspond to an AdSense account. |
| 112 | if none of the hints match the data from the AdSense account corresponding to loginEmail. |
| 205 | if loginEmail corresponds to a Disapproved AdSense account. |
| 321 | if loginEmail is not a valid email address. |
| 323 | if postalCode is not of a valid format. |
| 324 | if the phone hint is not a 5 digit number. |
| 325 | if both the phone and postalCode are nil or empty strings. |
Deprecated. Use associateAccount.
Creates an association between the developer and the publisher. If an association already exists, the method does nothing. The loginEmail and one or both of postalCode and phone are required.
Before creating the association this method does some sanity checks to match the account with the provided postal code and phone hints. If either of the hints match, then it sets up the MPM association. Otherwise returns an error.
| Parameter name | Parameter type | Parameter description |
|---|---|---|
| loginEmail | string |
the email address of the publisher |
| postalCode | string |
the postalCode hint |
| phone | string |
phone hint consisting of the last 5 digits of the
publisher's telephone number, excluding punctuation. For example,
the phone hint for (650)253-8000 would be "38000". |
| Response type | Response description |
|---|---|
SyndicationService_Data[] |
the SyndicationService_Data objects corresponding
to synServiceTypes.
A SyndicationService_Data
object contains a client ID and syndication type. For example:
<id>ca-pub-9644922955003912</id> <type>ContentAds</type> |
| Error number | Error description |
|---|---|
| 105 | if loginEmail does not correspond to an AdSense account. |
| 112 | if none of the hints match the data from the AdSense account corresponding to loginEmail. |
| 205 | if loginEmail corresponds to a Disapproved AdSense account. |
| 321 | if loginEmail is not a valid email address. |
| 323 | if postalCode is not of a valid format. |
| 324 | if the phone hint is not a 5 digit number. |
| 325 | if both the phone and postalCode are nil or empty strings. |
Creates a new AdSense account.
| Parameter name | Parameter type | Parameter description |
|---|---|---|
| loginEmail | string |
The login email for the new account. Email promotions
will be sent to this email. |
| entityType | EntityType |
The entity type.
Values are:
|
| websiteUrl | string |
the url of the primary website of the publisher. |
| websiteLocale | string |
The locale of the website. This must be a
Google supported locale. |
| usersPreferredLocale | string |
All correspondence with the user will occur
in this locale. This must be a
Google supported locale. |
| emailPromotionsPreferences | boolean |
Email promotions preferences for the new
account. These are enabled if true. |
| synServiceTypes | SyndicationService_Type[] |
the AdSense services requested.
Values are:
|
| developerUrl | string |
the site to be associated with this publisher. You
can retreve your site URLs using getDeveloperSiteData. |
| Response type | Response description |
|---|---|
SyndicationService_Data[] |
an array of SyndicationService_Data objects
corresponding to synServiceTypes.
A SyndicationService_Data object contains a client ID
and syndication type. For example:
<id>ca-pub-9644922955003912</id> <type>ContentAds</type> |
| Error number | Error description |
|---|---|
| 302 | if no syndication services are specified |
| 303 | if loginEmail is already in use by another user |
| 311 | if usersPreferredLocale is not valid |
| 312 | if websiteLocale is not valid |
| 313 | if websiteUrl is not valid |
| 314 | if any of the elements of synServiceTypes is not valid |
| 316 | if entityType is not valid |
| 317 | if the login email is valid but the user
has already specified a different EntityType |
| 321 | if loginEmail is not valid |
| 326 | if any of the elements of synServiceTypes is repeated |
| 327 | if websiteLocale is not supported by one or more of the synServiceTypes |
Deprecated. Use createAccount.
Creates a new AdSense account.
| Parameter name | Parameter type | Parameter description |
|---|---|---|
| loginEmail | string |
The login email for the new account. Email promotions
will be sent to this email. |
| entityType | EntityType |
The entity type.
Values are:
|
| websiteUrl | string |
the url of the primary website of the publisher. |
| websiteLocale | string |
The locale of the website. This must be a
Google supported locale. |
| usersPreferredLocale | string |
All correspondence with the user will occur
in this locale. This must be a
Google supported locale. |
| emailPromotionsPreferences | boolean |
Email promotions preferences for the new
account. These are enabled if true. |
| synServiceTypes | SyndicationService_Type[] |
the AdSense services requested.
Values are:
|
| hasAcceptedTCs | boolean |
this parameter is deprecated and will be ignored.
However, the parameter is still required in the current version of the API. |
| Response type | Response description |
|---|---|
SyndicationService_Data[] |
an array of SyndicationService_Data objects
corresponding to synServiceTypes.
A SyndicationService_Data object contains a client ID
and syndication type. For example:
<id>ca-pub-9644922955003912</id> <type>ContentAds</type> |
| Error number | Error description |
|---|---|
| 302 | if no syndication services are specified |
| 303 | if loginEmail is already in use by another user |
| 311 | if usersPreferredLocale is not valid |
| 312 | if websiteLocale is not valid |
| 313 | if websiteUrl is not valid |
| 314 | if any of the elements of synServiceTypes is not valid |
| 315 | if the user has not accepted the terms and conditions |
| 316 | if entityType is not valid |
| 317 | if the login email is valid but the user
has already specified a different EntityType |
| 321 | if loginEmail is not valid |
| 326 | if any of the elements of synServiceTypes is repeated |
| 327 | if websiteLocale is not supported by one or more of the synServiceTypes |
Returns data about all the SyndicationService
services subscribed to by the publisher.
| Parameter name | Parameter type | Parameter description |
|---|---|---|
| dummy | int |
ignored. This parameter is present because some SOAP
toolkits cannot deal with functions that have headers but no
parameters. |
| Response type | Response description |
|---|---|
SyndicationService_Data[] |
data about all of the SyndicationServices.
A SyndicationService_Data object contains a client ID
and syndication type. For example:
<id>ca-pub-9644922955003912</id> <type>ContentAds</type> |
SyndicationServiceReturns the ApprovalStatus of this account.
| Parameter name | Parameter type | Parameter description |
|---|---|---|
| dummy | int |
ignored. This parameter is present because some SOAP
toolkits cannot deal with functions that have headers but no
parameters. |
| Response type | Response description |
|---|---|
ApprovalStatus |
status the ApprovalStatus of this account
Values are:
|
Returns the publisher's association status with the developer. Returned
values could be one of NotAssociated, Pending,
Refused, or Active.
| Parameter name | Parameter type | Parameter description |
|---|---|---|
| dummy | int |
ignored. This parameter is present because some SOAP
toolkits cannot deal with functions that have headers but no
parameters. |
| Response type | Response description |
|---|---|
MpmStatus |
the publisher's association status with the developer.
Values are:
|
Returns the ApprovalStatus for the provided list of clients.
| Parameter name | Parameter type | Parameter description |
|---|---|---|
| clientIds | string[] |
the list of client ids to provide approval status for. |
| Response type | Response description |
|---|---|
PublisherApprovalStatus[] |
a list of PublisherApprovalStatus objects which connect
the requested client id to the returned approval status. Client ids which
have a failure condition will be omitted from the returned list. To
obtain more specific information about why they failed, use the
getApprovalStatus(int) api call. |
| Error number | Error description |
|---|---|
| 334 | if the list of client ids is missing |
Returns the MpmStatus for the provided list of clients.
| Parameter name | Parameter type | Parameter description |
|---|---|---|
| clientIds | string[] |
the list of client ids to provide association status for. |
| Response type | Response description |
|---|---|
PublisherAssociationStatus[] |
a list of PublisherAssociationStatus objects which connect
the request client id to the returned association status. Client ids which
have a failure condition will be omitted from the returned list. To obtain
more specific information about why they failed, use the
getAssociationStatus(int) api call. |
| Error number | Error description |
|---|---|
| 334 | if the list of client ids is missing |
Gets the developer site data.
| Response type | Response description |
|---|---|
DeveloperSiteData[] |
an array of DeveloperSiteData objects that
contain the developer's site information. |
Returns whether email promotions are enabled for the account.
| Parameter name | Parameter type | Parameter description |
|---|---|---|
| dummy | int |
ignored. This parameter is present because some SOAP
toolkits cannot deal with functions that have headers but no
parameters. |
| Response type | Response description |
|---|---|
boolean |
the email promotions preference |
Returns the entity type for the account
| Parameter name | Parameter type | Parameter description |
|---|---|---|
| dummy | int |
ignored. This parameter is present because some SOAP
toolkits cannot deal with functions that have headers but no
parameters. |
| Response type | Response description |
|---|---|
EntityType |
the EntityType for this account.
Values are:
|
Returns the list of supported website locales.
| Parameter name | Parameter type | Parameter description |
|---|---|---|
| dummy | int |
ignored. This parameter is present because some SOAP toolkits
cannot deal with functions that have headers but no parameters. |
| Response type | Response description |
|---|---|
string[] |
the list of support website locales. These must be Google supported locales. |
Returns the list of supported website locales for a given type of
SyndicationService.
| Parameter name | Parameter type | Parameter description |
|---|---|---|
| synServiceType | SyndicationService_Type |
type of the SyndicationService
Values are:
|
| Response type | Response description |
|---|---|
string[] |
the list of supported website locales for a given type of SyndicationService. This must be Google supported locales. |
Returns the service data for the SyndicationService
corresponding to the synServiceType parameter.
| Parameter name | Parameter type | Parameter description |
|---|---|---|
| synServiceType | SyndicationService_Type |
type of the SyndicationService
Values are:
|
| Response type | Response description |
|---|---|
SyndicationService_Data |
SyndicationService_Data object corresponding to
the synServiceType parameter passed in.
A SyndicationService_Data object contains a client ID
and syndication type. For example:
<id>ca-pub-9644922955003912</id> <type>ContentAds</type> |
SyndicationService_Data| Error number | Error description |
|---|---|
| 204 | if the publisher is not signed up for the syndication service corresponding to synServiceType. |
| 314 | if synServiceType is not valid. |
Return the user's preferred locale.
| Parameter name | Parameter type | Parameter description |
|---|---|---|
| dummy | int |
ignored. This parameter is present because some SOAP
toolkits cannot deal with functions that have headers but no
parameters. |
| Response type | Response description |
|---|---|
string |
the user's preferred locale. All correspondence with the user will occur in this locale. This must be a Google supported locale. |
Returns the website language setting for the account.
| Parameter name | Parameter type | Parameter description |
|---|---|---|
| dummy | int |
ignored. This parameter is present because some SOAP
toolkits cannot deal with functions that have headers but no
parameters. |
| Response type | Response description |
|---|---|
string |
The locale of the website. |
Returns the Website URL
| Parameter name | Parameter type | Parameter description |
|---|---|---|
| dummy | int |
ignored. This parameter is present because some SOAP
toolkits cannot deal with functions that have headers but no
parameters. |
| Response type | Response description |
|---|---|
string |
the website URL for this account. |
Resends the verification email. The verification email can be sent up to three times.
| Parameter name | Parameter type | Parameter description |
|---|---|---|
| developerUrl | string |
the developer site URL. |
| Response type | Response description |
|---|---|
(none) |
| Error number | Error description |
|---|---|
| 205 | if the account has been disapproved. |
| 335 | if developerUrl the developer site URL is invalid. |
| 338 | if the verification email has already been sent three times. |
| 339 | if the publisher is not in pending association status with this developer site. |
Set whether the account should receive email promotions or not
| Parameter name | Parameter type | Parameter description |
|---|---|---|
| enableEmailPromotions | boolean |
the email preferences |
| Response type | Response description |
|---|---|
(none) |
Set the user's preferred locale. All correspondence with the user will occur in this locale
| Parameter name | Parameter type | Parameter description |
|---|---|---|
| usersPreferredLocale | string |
the user's preferred locale.
This must be a
Google supported locale |
| Response type | Response description |
|---|---|
(none) |
| Error number | Error description |
|---|---|
| 311 | if usersPreferredLocale is not valid |