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
ReportJob
object using ReportService.getReportJob. - Continue to poll the
ReportJob
object until the ReportJob.reportJobStatus field 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/v202002/ReportService?wsdl
- Namespace
-
https://www.google.com/apis/ads/publisher/v202002
- 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
Field | Type | Description |
---|---|---|
reportJobId
|
|
the ID of the ReportJob |
exportFormat
|
|
the ExportFormat for the report
file Enumerations
|
Response
Field | Type | Description |
---|---|---|
rval
|
|
the URL for report file download |
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
|
|
the ID of the ReportJob |
reportDownloadOptions
|
|
the ReportDownloadOptions for the request |
Response
Field | Type | Description |
---|---|---|
rval
|
|
the URL for report file download |
getReportJobStatus
Returns the ReportJobStatus of the report job with the specified ID.
Parameters
Field | Type | Description |
---|---|---|
reportJobId
|
|
Response
Field | Type | Description |
---|---|---|
rval
|
|
Enumerations |
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
|
|
a Publisher Query Language statement used to filter which saved queries should be returned. |
Response
Field | Type | Description |
---|---|---|
rval
|
|
a SavedQueryPage that contains all SavedQuery instances which satisfy the given statement. |
runReportJob
Initiates the execution of a ReportQuery on the server.
The following fields are required:
Parameters
Field | Type | Description |
---|---|---|
reportJob
|
|
the report job to run |
Response
Field | Type | Description |
---|---|---|
rval
|
|
the report job with its ID filled in |
Errors
Error | Reasons |
---|---|
ApiVersionError
|
Errors related to the usage of API versions.
Enumerations
|
AuthenticationError
|
An error for an exception that occurred when authenticating.
Enumerations
|
CollectionSizeError
|
Error for the size of the collection being too large
Enumerations
|
CommonError
|
A place for common errors that can be used across services.
Enumerations
|
CurrencyCodeError
|
Errors related to currency codes.
Enumerations
|
FeatureError
|
Errors related to feature management. If you attempt using a feature that is not available to
the current network you'll receive a FeatureError with the missing feature as the trigger.
Enumerations
|
InternalApiError
|
Indicates that a server-side error has occured. InternalApiError s
are generally not the result of an invalid request or message sent by the
client.
Enumerations
|
NotNullError
|
Caused by supplying a null value for an attribute that cannot be null.
Enumerations
|
ParseError
|
Lists errors related to parsing.
Enumerations
|
PermissionError
|
Errors related to incorrect permission.
Enumerations
|
PublisherQueryLanguageContextError
|
An error that occurs while executing a PQL query contained in
a Statement object.
Enumerations
|
PublisherQueryLanguageSyntaxError
|
An error that occurs while parsing a PQL query contained in a
Statement object.
Enumerations
|
QuotaError
|
Describes a client-side error on which a user is attempting
to perform an action to which they have no quota remaining.
Enumerations
|
ReportError
|
An error for an exception that occurred while running the report.
Enumerations
|
RequiredCollectionError
|
A list of all errors to be used for validating sizes of collections.
Enumerations
|
RequiredError
|
Errors due to missing required field.
Enumerations
|
ServerError
|
Errors related to the server.
Enumerations
|
StatementError
|
An error that occurs while parsing Statement objects.
Enumerations
|
StringFormatError
|
A list of error code for reporting invalid content of input strings.
Enumerations
|
StringLengthError
|
Errors for Strings which do not meet given length constraints.
Enumerations
|