Provides methods for executing a ReportJob and retrieving performance and statistics about ad campaigns, networks, inventory and sales.
Follow the steps outlined below:
- Create the
ReportJob
object by invoking ReportService.runReportJob . - Poll the report job status using ReportService.getReportJobStatus .
- Continue to poll until the status is equal to ReportJobStatus.COMPLETED or ReportJobStatus.FAILED .
- If successful, fetch the URL for downloading the report by invoking ReportService.getReportDownloadURL .
Test network behavior
The networks created using NetworkService.makeTestNetwork are unable to provide reports that would be comparable to the production environment because reports require traffic history. In the test networks, reports will consistently return no data for all reports.
- Production WSDL
-
https://ads.google.com/apis/ads/publisher/v202508/ReportService?wsdl
- Namespace
-
https://www.google.com/apis/ads/publisher/v202508
- Operations
- Errors
-
- ApiVersionError
- AuthenticationError
- CollectionSizeError
- CommonError
- CurrencyCodeError
- FeatureError
- InternalApiError
- NotNullError
- ParseError
- PermissionError
- PublisherQueryLanguageContextError
- PublisherQueryLanguageSyntaxError
- QuotaError
- ReportError
- RequiredCollectionError
- RequiredError
- ServerError
- StatementError
- StringFormatError
- StringLengthError
getReportDownloadURL
Returns the URL at which the report file can be downloaded.
The report will be generated as a gzip archive, containing the report file itself.
Parameters
reportJobId
xsd:
long
exportFormat
Enumerations
-
TSV
- The report file is generated as a list of Tab Separated Values.
-
TSV_EXCEL
- The report file is generated as a list of tab-separated values for Excel.
-
CSV_DUMP
- The report file is generated as a list of Comma Separated Values,
to be used with automated machine processing.
- There is no pretty printing for the output, and no total row.
- Column headers are the qualified name e.g. "Dimension.ORDER_NAME".
- Network currency Monetary amounts are represented as micros in the currency of the network .
- Starting from v201705, local currency Monetary amounts are represented as currency symbol + ' ' + micros.
- Dates are formatted according to the ISO 8601 standard YYYY-MM-DD
- DateTimes are formatted according to the ISO 8601 standard YYYY-MM-DDThh:mm:ss[+-]hh:mm
-
XML
- The report file is generated as XML.
-
XLSX
- The report file is generated as an Office Open XML spreadsheet designed for Excel 2007+.
Response
Field | Type | Description |
---|---|---|
rval
|
|
getReportDownloadUrlWithOptions
Returns the URL at which the report file can be downloaded, and allows for customization of the downloaded report.
By default, the report will be generated as a gzip archive, containing the report file itself. This can be changed by setting ReportDownloadOptions.useGzipCompression to false.
Parameters
Field | Type | Description |
---|---|---|
reportJobId
|
|
|
reportDownloadOptions
|
|
Response
Field | Type | Description |
---|---|---|
rval
|
|
getReportJobStatus
Returns the ReportJobStatus of the report job with the specified ID.
Parameters
Field | Type | Description |
---|---|---|
reportJobId
|
|
Response
rval
getSavedQueriesByStatement
Retrieves a page of the saved queries either created by or shared with the current user. Each SavedQuery in the page, if it is compatible with the current API version, will contain a ReportQuery object which can be optionally modified and used to create a ReportJob . This can then be passed to ReportService.runReportJob . The following fields are supported for filtering:
PQL Property | Object Property |
---|---|
id
|
SavedQuery.id |
name
|
SavedQuery.name |
Parameters
Field | Type | Description |
---|---|---|
filterStatement
|
|
Response
Field | Type | Description |
---|---|---|
rval
|
|
runReportJob
Initiates the execution of a ReportQuery on the server.
The following fields are required:
Parameters
Field | Type | Description |
---|---|---|
reportJob
|
|
Response
Field | Type | Description |
---|---|---|
rval
|
|
Errors
Enumerations
-
UPDATE_TO_NEWER_VERSION
- Indicates that the operation is not allowed in the version the request was made in.
-
UNKNOWN
- The value returned if the actual value is not exposed by the requested API version.
Enumerations
-
AMBIGUOUS_SOAP_REQUEST_HEADER
- The SOAP message contains a request header with an ambiguous definition of the authentication
header fields. This means either the
authToken
andoAuthToken
fields were both null or both were specified. Exactly one value should be specified with each request. -
INVALID_EMAIL
- The login provided is invalid.
-
AUTHENTICATION_FAILED
- Tried to authenticate with provided information, but failed.
-
INVALID_OAUTH_SIGNATURE
- The OAuth provided is invalid.
-
INVALID_SERVICE
- The specified service to use was not recognized.
-
MISSING_SOAP_REQUEST_HEADER
- The SOAP message is missing a request header with an
authToken
and optionalnetworkCode
. -
MISSING_AUTHENTICATION_HTTP_HEADER
- The HTTP request is missing a request header with an
authToken
-
MISSING_AUTHENTICATION
- The request is missing an
authToken
-
NETWORK_API_ACCESS_DISABLED
- The network does not have API access enabled.
-
NO_NETWORKS_TO_ACCESS
- The user is not associated with any network.
-
NETWORK_NOT_FOUND
- No network for the given
networkCode
was found. -
NETWORK_CODE_REQUIRED
- The user has access to more than one network, but did not provide a
networkCode
. -
CONNECTION_ERROR
- An error happened on the server side during connection to authentication service.
-
GOOGLE_ACCOUNT_ALREADY_ASSOCIATED_WITH_NETWORK
- The user tried to create a test network using an account that already is associated with a network.
-
UNDER_INVESTIGATION
- The account is blocked and under investigation by the collections team. Please contact Google for more information.
-
UNKNOWN
- The value returned if the actual value is not exposed by the requested API version.
Enumerations
-
TOO_LARGE
-
UNKNOWN
- The value returned if the actual value is not exposed by the requested API version.
Enumerations
-
NOT_FOUND
- Indicates that an attempt was made to retrieve an entity that does not exist.
-
ALREADY_EXISTS
- Indicates that an attempt was made to create an entity that already exists.
-
NOT_APPLICABLE
- Indicates that a value is not applicable for given use case.
-
DUPLICATE_OBJECT
- Indicates that two elements in the collection were identical.
-
CANNOT_UPDATE
- Indicates that an attempt was made to change an immutable field.
-
UNSUPPORTED_OPERATION
- Indicates that the requested operation is not supported.
-
CONCURRENT_MODIFICATION
- Indicates that another request attempted to update the same data in the same network at about the same time. Please wait and try the request again.
-
UNKNOWN
- The value returned if the actual value is not exposed by the requested API version.
Enumerations
-
INVALID
- The currency code is invalid and does not follow ISO 4217.
-
UNSUPPORTED
- The currency code is valid, but is not supported.
-
DEPRECATED_CURRENCY_USED
- The currency has been used for entity creation after its deprecation
Enumerations
-
MISSING_FEATURE
- A feature is being used that is not enabled on the current network.
-
UNKNOWN
- The value returned if the actual value is not exposed by the requested API version.
InternalApiError
s
are generally not the result of an invalid request or message sent by the
client.Enumerations
-
UNEXPECTED_INTERNAL_API_ERROR
- API encountered an unexpected internal error.
-
TRANSIENT_ERROR
- A temporary error occurred during the request. Please retry.
-
UNKNOWN
- The cause of the error is not known or only defined in newer versions.
-
DOWNTIME
- The API is currently unavailable for a planned downtime.
-
ERROR_GENERATING_RESPONSE
- Mutate succeeded but server was unable to build response. Client should not retry mutate.
Enumerations
-
ARG1_NULL
- Assuming that a method will not have more than 3 arguments, if it does, return NULL
-
ARG2_NULL
-
ARG3_NULL
-
NULL
-
UNKNOWN
- The value returned if the actual value is not exposed by the requested API version.
Enumerations
-
UNPARSABLE
- Indicates an error in parsing an attribute.
-
UNKNOWN
- The value returned if the actual value is not exposed by the requested API version.
Enumerations
-
PERMISSION_DENIED
- User does not have the required permission for the request.
-
UNKNOWN
- The value returned if the actual value is not exposed by the requested API version.
Enumerations
-
UNEXECUTABLE
- Indicates that there was an error executing the PQL.
-
UNKNOWN
- The value returned if the actual value is not exposed by the requested API version.
Enumerations
-
UNPARSABLE
- Indicates that there was a PQL syntax error.
-
UNKNOWN
- The value returned if the actual value is not exposed by the requested API version.
Enumerations
-
EXCEEDED_QUOTA
- The number of requests made per second is too high and has exceeded
the allowable limit. The recommended approach to handle this error
is to wait about 5 seconds and then retry the request. Note that
this does not guarantee the request will succeed. If it fails
again, try increasing the wait time.
Another way to mitigate this error is to limit requests to 8 per second for Ad Manager 360 accounts, or 2 per second for Ad Manager accounts. Once again this does not guarantee that every request will succeed, but may help reduce the number of times you receive this error.
-
UNKNOWN
- The value returned if the actual value is not exposed by the requested API version.
-
REPORT_JOB_LIMIT
- This user has exceeded the allowed number of new report requests
per hour (this includes both reports run via the UI and reports run
via ReportService.runReportJob
). The recommended approach to handle this error
is to wait about 10 minutes and then retry the request. Note that
this does not guarantee the request will succeed. If it fails
again, try increasing the wait time.
Another way to mitigate this error is to limit the number of new report requests to 250 per hour per user. Once again, this does not guarantee that every request will succeed, but may help reduce the number of times you receive this error.
-
SEGMENT_POPULATION_LIMIT
- This network has exceeded the allowed number of identifiers uploaded within a 24 hour period. The recommended approach to handle this error is to wait 30 minutes and then retry the request. Note that this does not guarantee the request will succeed. If it fails again, try increasing the wait time.
Enumerations
-
DEFAULT
- Default
ReportError
when the reason is not among any already defined. -
REPORT_ACCESS_NOT_ALLOWED
- User does not have permission to access the report.
-
DIMENSION_VIEW_NOT_ALLOWED
- User does not have permission to view one or more Dimension .
-
ATTRIBUTE_VIEW_NOT_ALLOWED
- User has no permission to view one or more attributes.
-
COLUMN_VIEW_NOT_ALLOWED
- User does not have permission to view one or more Column .
-
REPORT_QUERY_TOO_LONG
- The report query exceeds the maximum allowed number of characters.
-
INVALID_OPERATION_FOR_REPORT_STATE
- Invalid report job state for the given operation.
-
INVALID_DIMENSIONS
- Invalid Dimension objects specified.
-
INVALID_ATTRIBUTES
- The attribute ID(s) are not valid.
-
INVALID_CMS_METADATA_DIMENSIONS
- The API error when running the report with
CmsMetadataKeyDimension
. There are three reasons for this error.- ReportQuery.dimensions contains Dimension.CONTENT_CMS_METADATA , but ReportQuery.cmsMetadataKeyIds is empty.
- ReportQuery.cmsMetadataKeyIds is non-empty, but ReportQuery.dimensions does not contain Dimension.CONTENT_CMS_METADATA .
- The ReportQuery.cmsMetadataKeyIds specified along with the Dimension.CONTENT_CMS_METADATA are not valid, i.e., these IDs are not reportable cms metadata key defined by the publisher.
-
INVALID_COLUMNS
- Invalid Column objects specified.
-
INVALID_DIMENSION_FILTERS
- Invalid
DimensionFilter
objects specified. -
INVALID_DATE
- Invalid date.
-
END_DATE_TIME_NOT_AFTER_START_TIME
- The start date for running the report should not be later than the end date.
-
START_DATE_MORE_THAN_THREE_YEARS_AGO
- The start date for running the report should not be more than three years before now.
-
NOT_NULL
- The list of Dimension and Column objects cannot be empty.
-
ATTRIBUTES_NOT_SUPPORTED_FOR_REQUEST
- Attribute has to be selected in combination with dimensions.
-
COLUMNS_NOT_SUPPORTED_FOR_REQUESTED_DIMENSIONS
- The provided report violates one or more constraints, which govern
incompatibilities and requirements between different report
properties. Some reasons for constraint violations include:
- Not all Column objects requested are supported for the given set of Dimension objects.
- The report's date range is not compatible with the given set of Column objects.
- The report's TimeZoneType is not compatible with the given set of Column and Dimension objects (version 201802 and later).
- The report's currency is not compatible with the given set of Column objects.
-
DATE_RANGE_NOT_SUPPORTED_FOR_REQUESTED_REPORT
- The report's date range is not compatible with the requested Dimension and Column objects.
-
TIME_ZONE_TYPE_NOT_SUPPORTED_FOR_REQUESTED_REPORT
- The report's TimeZoneType is not compatible with the requested Column and Dimension objects.
-
CURRENCY_CODE_NOT_SUPPORTED_FOR_REQUESTED_REPORT
- The report's currency is not compatible with the requested Column objects.
-
FAILED_TO_STORE_REPORT
- Failed to store/cache a report.
-
REPORT_NOT_FOUND
- The requested report does not exist.
-
SR_CANNOT_RUN_REPORT_IN_ANOTHER_NETWORK
- User has no permission to view in another network.
-
AD_UNIT_VIEW_NOT_SUPPORTED_FOR_REQUESTED_REPORT
- The report's
AdUnitView
is not compatible with the requested Dimension and Column objects. -
REPORT_FIELD_TEMPORARILY_DISABLED
- The report uses a field that has been temporarily disabled. See more details at https://ads.google.com/status/publisher.
-
UNKNOWN
- The value returned if the actual value is not exposed by the requested API version.
Enumerations
-
REQUIRED
- A required collection is missing.
-
TOO_LARGE
- Collection size is too large.
-
TOO_SMALL
- Collection size is too small.
-
UNKNOWN
- The value returned if the actual value is not exposed by the requested API version.
Enumerations
-
REQUIRED
- Missing required field.
Enumerations
-
SERVER_ERROR
- Indicates that an unexpected error occured.
-
SERVER_BUSY
- Indicates that the server is currently experiencing a high load. Please wait and try your request again.
-
UNKNOWN
- The value returned if the actual value is not exposed by the requested API version.
Enumerations
-
VARIABLE_NOT_BOUND_TO_VALUE
- A bind variable has not been bound to a value.
-
UNKNOWN
- The value returned if the actual value is not exposed by the requested API version.
Enumerations
-
UNKNOWN
-
ILLEGAL_CHARS
- The input string value contains disallowed characters.
-
INVALID_FORMAT
- The input string value is invalid for the associated field.
Enumerations
-
TOO_LONG
-
TOO_SHORT
-
UNKNOWN
- The value returned if the actual value is not exposed by the requested API version.