Provides methods for executing a PQL Statement to retrieve
information from the system. In order to support the selection of columns of
interest from various tables, Statement objects support a "select"
clause.
An example query text might be "select CountryCode, Name from
Geo_Target"
, where CountryCode
and Name
are
columns of interest and Geo_Target
is the table.
The following tables are supported:
Geo_Target
Column Name |
Description |
Id |
Unique identifier for the Geo target |
Name |
The name of the Geo target |
CanonicalParentId |
The criteria ID of the direct parent that defines the canonical name of the geo target.
For example, if the current geo target is "San Francisco", its canonical name would be
"San Francisco, California, United States" thus the canonicalParentId would be the criteria ID
of California and the canonicalParentId of California would be the criteria ID of United states
|
ParentIds |
A comma separated list of criteria IDs of all parents of the geo target ordered by ascending
size |
CountryCode |
Country code as defined by ISO 3166-1 alpha-2 |
Type |
Allowable values:
- Airport
- Autonomous_Community
- Canton
- City
- Congressional_District
- Country
- County
- Department
- DMA_Region
- Governorate
- Municipality
- Neighborhood
- Postal_Code
- Prefecture
- Province
- Region
- State
- Territory
- Tv_Region
- Union_Territory
|
Targetable |
Indicates whether geographical targeting is allowed |
Bandwidth_Group
Column Name |
Description |
Id |
Unique identifier for the bandwidth group |
BandwidthName |
Name of the bandwidth group |
Browser
Column Name |
Description |
Id |
Unique identifier for the browser |
BrowserName |
Name of the browser |
MajorVersion |
Major version of the browser |
MinorVersion |
Minor version of the browser |
Browser_Language
Column Name |
Description |
Id |
Unique identifier for the browser language |
BrowserLanguageName |
Browser's language |
Device_Capability
Column Name |
Description |
Id |
Unique identifier for the device capability |
DeviceCapabilityName |
Name of the device capability |
Device_Category
Column Name |
Description |
Id |
Unique identifier for the device category |
DeviceCategoryName |
Name of the device category |
Device_Manufacturer
Column Name |
Description |
Id |
Unique identifier for the device manufacturer |
MobileDeviceManufacturerName |
Name of the device manufacturer |
Mobile_Carrier
Column Name |
Description |
Id |
Unique identifier for the mobile carrier |
CountryCode |
The country code of the mobile carrier |
MobileCarrierName |
Name of the mobile carrier |
Mobile_Device
Column Name |
Description |
Id |
Unique identifier for the mobile device |
MobileDeviceManufacturerId |
Id of the device manufacturer |
MobileDeviceName |
Name of the mobile device |
Mobile_Device_Submodel
Column Name |
Description |
Id |
Unique identifier for the mobile device submodel |
MobileDeviceId |
Id of the mobile device |
MobileDeviceSubmodelName |
Name of the mobile device submodel |
Operating_System
Column Name |
Description |
Id |
Unique identifier for the operating system |
OperatingSystemName |
Name of the operating system |
Operating_System_Version
Column Name |
Description |
Id |
Unique identifier for the operating system version |
OperatingSystemId |
Id of the operating system |
MajorVersion |
The operating system major version |
MinorVersion |
The operating system minor version |
MicroVersion |
The operating system micro version |
Third_Party_Company
Column Name |
Description |
Id |
Unique identifier for the third party company |
Name |
The third party company name |
Type |
The third party company type |
Status |
The status of the third party company |
Line_Item
Column name |
Type |
Description |
CostType |
Text
|
The method used for billing this LineItem . |
CreationDateTime |
Datetime
|
The date and time this LineItem was last created. This attribute may be null for LineItem s created before this feature was introduced. |
DeliveryRateType |
Text
|
The strategy for delivering ads over the course of the LineItem 's duration. This attribute is optional and defaults to DeliveryRateType.EVENLY. Starting in v201306, it may default to DeliveryRateType.FRONTLOADED if specifically configured to on the network. |
EndDateTime |
Datetime
|
The date and time on which the LineItem stops serving. |
ExternalId |
Text
|
An identifier for the LineItem that is meaningful to the publisher. |
Id |
Number
|
Uniquely identifies the LineItem . This attribute is read-only and is assigned by Google when a line item is created. |
IsMissingCreatives |
Boolean
|
Indicates if a LineItem is missing any creatives for the creativePlaceholders specified. |
IsSetTopBoxEnabled |
Boolean
|
Whether or not this line item is set-top box enabled. |
LastModifiedDateTime |
Datetime
|
The date and time this LineItem was last modified. |
LineItemType |
Text
|
Indicates the line item type of a LineItem . |
Name |
Text
|
The name of the LineItem . |
OrderId |
Number
|
The ID of the Order to which the LineItem belongs. |
StartDateTime |
Datetime
|
The date and time on which the LineItem is enabled to begin serving. |
Status |
Text
|
The status of the LineItem . |
Targeting |
Targeting
|
The targeting criteria for the ad campaign. |
UnitsBought |
Number
|
The total number of impressions or clicks that will be reserved for the LineItem . If the line item is of type LineItemType.SPONSORSHIP, then it represents the percentage of available impressions reserved. |
Ad_Unit
Column name |
Type |
Description |
AdUnitCode |
Text
|
A string used to uniquely identify the ad unit for the purposes of serving the ad. This attribute is read-only and is assigned by Google when an ad unit is created. |
ExternalSetTopBoxChannelId |
Text
|
The channel ID for set-top box enabled ad units. |
Id |
Number
|
Uniquely identifies the ad unit. This value is read-only and is assigned by Google when an ad unit is created. |
LastModifiedDateTime |
Datetime
|
The date and time this ad unit was last modified. |
Name |
Text
|
The name of the ad unit. |
ParentId |
Number
|
The ID of the ad unit's parent. Every ad unit has a parent except for the root ad unit, which is created by Google. |
User
Column name |
Type |
Description |
Email |
Text
|
The email or login of the user. |
ExternalId |
Text
|
An identifier for the user that is meaningful to the publisher. |
Id |
Number
|
The unique ID of the user. |
IsServiceAccount |
Boolean
|
True if this user is an OAuth2 service account user, false otherwise. |
Name |
Text
|
The name of the user. |
RoleId |
Number
|
The unique role ID of the user. Role objects that are created by Google will have negative IDs. |
RoleName |
Text
|
The name of the Role assigned to the user. |
Exchange_Rate
Column name |
Type |
Description |
CurrencyCode |
Text
|
The currency code that the exchange rate is related to. The exchange rate is between this currency and the network's currency. This attribute is required for creation and then is readonly. |
Direction |
Text
|
The direction that the exchange rate is in. It determines whether the exchange rate is from this currency to the network's currency, or from the network's currency to this currency. This attribute can be updated. |
ExchangeRate |
Number
|
The latest exchange rate at current refresh rate and in current direction. The value is stored as the exchange rate times 10,000,000,000 truncated to a long. Setting this attribute requires the refresh rate to be already set to ExchangeRateRefreshRate.FIXED. Otherwise an exception will be thrown. |
Id |
Number
|
The ID of the ExchangeRate . This attribute is readonly and is assigned by Google when an exchange rate is created. |
RefreshRate |
Text
|
The refresh rate at which the exchange rate is updated. Setting this attribute to ExchangeRateRefreshRate.FIXED without setting the exchange rate value will cause unknown exchange rate value returned in future queries. |
Programmatic_Buyer
Column name |
Type |
Description |
BuyerAccountId |
Number
|
The ID used by Adx to bill the appropriate buyer network for a programmatic order. |
EnabledForPreferredDeals |
Boolean
|
Whether the buyer is allowed to negotiate Preferred Deals. |
EnabledForProgrammaticGuaranteed |
Boolean
|
Whether the buyer is enabled for Programmatic Guaranteed deals. |
Name |
Text
|
Display name that references the buyer. |
ParentId |
Number
|
The ID of the programmatic buyer's sponsor. If the programmatic buyer has no sponsor, this field will be -1. |
Audience_Segment_Category
Column name |
Type |
Description |
Id |
Number
|
The unique identifier for the audience segment category. |
Name |
Text
|
The name of the audience segment category. |
ParentId |
Number
|
The unique identifier of the audience segment category's parent. |
Audience_Segment
Column name |
Type |
Description |
AdIdSize |
Number
|
The number of AdID users in the segment. |
CategoryIds |
Set of number
|
The ids of the categories that this audience segment belongs to. |
Id |
Number
|
The unique identifier for the audience segment. |
IdfaSize |
Number
|
The number of IDFA users in the segment. |
MobileWebSize |
Number
|
The number of mobile web users in the segment. |
Name |
Text
|
The name of the audience segment. |
OwnerAccountId |
Number
|
The owner account id of the audience segment. |
OwnerName |
Text
|
The owner name of the audience segment. |
PpidSize |
Number
|
The number of PPID users in the segment. |
SegmentType |
Text
|
The type of the audience segment. |
Proposal_Retraction_Reason
Column name |
Type |
Description |
Id |
Number
|
The ID of the ProposalRetractionReason . This attribute is readonly and is assigned by Google when a proposal retraction reason is created. |
IsActive |
Boolean
|
True if the ProposalRetractionReason is active. |
Name |
Text
|
The name of the ProposalRetractionReason . |
Time_Zone
Column name |
Type |
Description |
Id |
Text
|
The id of time zone in the form of America/New_York . |
StandardGmtOffset |
Text
|
The standard GMT offset in current time in the form of GMT-05:00 for America/New_York , excluding the Daylight Saving Time. |
Proposal_Terms_And_Conditions
Column name |
Type |
Description |
Content |
Text
|
The content of the terms and conditions. |
Id |
Number
|
Uniquely identifies the terms and conditions. |
IsDefault |
Boolean
|
Whether or not this set of terms and conditions are the default for a network. |
LastModifiedDateTime |
Datetime
|
The date and time this terms and conditions was last modified. |
Name |
Text
|
The name of the terms and conditions. |
Change_History
Restrictions: Only ordering by
ChangeDateTime
descending is supported.
OFFSET
is not supported. To page through results, filter on the earliest change
Id
as a continuation token. For example
"WHERE Id < :id"
. On each query, both an upper bound and a lower bound for the
ChangeDateTime
are required.
Column name |
Type |
Description |
ChangeDateTime |
Datetime
|
The date and time this change happened. |
EntityId |
Number
|
The ID of the entity that was changed. |
EntityType |
Text
|
The type of the entity that was changed. |
Id |
Text
|
The ID of this change. IDs may only be used with "<" operator for paging and are subject to change. Do not store IDs. Note that the "<" here does not compare the value of the ID but the row in the change history table it represents. |
Operation |
Text
|
The operation that was performed on this entity. |
UserId |
Number
|
The ID of the user that made this change. |
ad_category
Column name |
Type |
Description |
ChildIds |
Set of number
|
Child IDs of an Ad category. Only general categories have children |
Id |
Number
|
ID of an Ad category |
Name |
Text
|
Localized name of an Ad category |
ParentId |
Number
|
Parent ID of an Ad category. Only general categories have parents |
Type |
Text
|
Type of an Ad category. Only general categories have children |
- Production WSDL
-
https://ads.google.com/apis/ads/publisher/v201905/PublisherQueryLanguageService?wsdl
- Namespace
-
https://www.google.com/apis/ads/publisher/v201905
- Operations
-
- Errors
-
select
Retrieves rows of data that satisfy the given Statement.query from
the system.
Parameters
Field |
Type |
Description |
selectStatement
|
Statement
|
a Publisher Query Language statement used to
specify what data needs to returned |
Response
Field |
Type |
Description |
rval
|
ResultSet
|
a result set of data that matches the given filter |
Errors
Error |
Reasons |
AdUnitCodeError
|
Lists the generic errors associated with AdUnit.adUnitCode.
Enumerations
-
INVALID_CHARACTERS
- For AdUnit.adUnitCode, only alpha-numeric characters,
underscores, hyphens, periods, asterisks, double quotes, back slashes,
forward slashes, exclamations, left angle brackets, colons and
parentheses are allowed.
-
INVALID_CHARACTERS_WHEN_UTF_CHARACTERS_ARE_ALLOWED
- For AdUnit.adUnitCode, only letters, numbers,
underscores, hyphens, periods, asterisks, double quotes, back slashes,
forward slashes, exclamations, left angle brackets, colons and
parentheses are allowed.
-
INVALID_CHARACTERS_FOR_LEGACY_AD_EXCHANGE_TAG
- For AdUnit.adUnitCode representing slot codes, only alphanumeric characters,
underscores, hyphens, periods and colons are allowed.
-
LEADING_FORWARD_SLASH
- For AdUnit.adUnitCode, forward slashes are not allowed as
the first character.
-
RESERVED_CODE
- Specific codes matching ca-*pub-*-tag are reserved for "Web Property IUs"
generated as part of the SlotCode migration.
-
UNKNOWN
- The value returned if the actual value is not exposed by the requested API version.
|
AdUnitHierarchyError
|
Caused by creating an AdUnit object with an invalid hierarchy.
Enumerations
-
INVALID_DEPTH
- The depth of the AdUnit in the inventory hierarchy is greater
than is allowed. The maximum allowed depth is two below the effective
root ad unit for Ad Manager 360 accounts and is one level below the
effective root ad unit for Ad Manager accounts.
-
INVALID_PARENT
- The only valid AdUnit.parentId for an Ad Manager account is the
Network.effectiveRootAdUnitId, Ad Manager 360 accounts can specify an ad unit
hierarchy with more than two levels.
-
UNKNOWN
- The value returned if the actual value is not exposed by the requested API version.
|
ApiVersionError
|
Errors related to the usage of API versions.
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.
|
AudienceSegmentError
|
Errors that could occur on audience segment related requests.
Enumerations
-
FIRST_PARTY_AUDIENCE_SEGMENT_NOT_SUPPORTED
- First party audience segment is not supported.
-
ONLY_RULE_BASED_FIRST_PARTY_AUDIENCE_SEGMENTS_CAN_BE_CREATED
- Only rule-based first-party audience segments can be created.
-
AUDIENCE_SEGMENT_ID_NOT_FOUND
- Audience segment for the given id is not found.
-
INVALID_AUDIENCE_SEGMENT_RULE
- Audience segment rule is invalid.
-
AUDIENCE_SEGMENT_RULE_TOO_LONG
- Audience segment rule contains too many ad units and/or custom criteria.
-
INVALID_AUDIENCE_SEGMENT_NAME
- Audience segment name is invalid.
-
DUPLICATE_AUDIENCE_SEGMENT_NAME
- Audience segment with this name already exists.
-
INVALID_AUDIENCE_SEGMENT_DESCRIPTION
- Audience segment description is invalid.
-
INVALID_AUDIENCE_SEGMENT_PAGEVIEWS
- Audience segment pageviews value is invalid. It must be between 1 and 12.
-
INVALID_AUDIENCE_SEGMENT_RECENCY
- Audience segment recency value is invalid. It must be between 1 and 90 if pageviews > 1.
-
INVALID_AUDIENCE_SEGMENT_MEMBERSHIP_EXPIRATION
- Audience segment membership expiration value is invalid. It must be between 1 and 180.
-
INVALID_AUDIENCE_SEGMENT_CUSTOM_KEY_NAME
- The given custom key cannot be part of audience segment rule due to unsupported characters.
-
INVALID_AUDIENCE_SEGMENT_CUSTOM_VALUE_NAME
- The given custom value cannot be part of audience segment rule due to unsupported characters.
-
INVALID_AUDIENCE_SEGMENT_CUSTOM_VALUE_MATCH_TYPE
- Broad-match custom value cannot be part of audience segment rule.
-
INVALID_NESTED_FIRST_PARTY_AUDIENCE_SEGMENT
- Audience segment rule cannot contain itself.
-
INVALID_NESTED_THIRD_PARTY_AUDIENCE_SEGMENT
- Audience segment rule cannot contain a nested third-party segment.
-
INACTIVE_NESTED_AUDIENCE_SEGMENT
- Audience segment rule cannot contain a nested inactive segment.
-
AUDIENCE_SEGMENT_GLOBAL_LICENSE_ERROR
- An error occured when purchasing global licenses.
-
UNKNOWN
- The value returned if the actual value is not exposed by the requested API version.
|
AuthenticationError
|
An error for an exception that occurred when authenticating.
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 and oAuthToken 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 optional networkCode .
-
MISSING_AUTHENTICATION_HTTP_HEADER
- The HTTP request is missing a request header with an
authToken
-
MISSING_AUTHENTICATION
- The request is missing an
authToken
-
NOT_WHITELISTED_FOR_API_ACCESS
- The customer is not whitelisted for API access.
-
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.
|
CollectionSizeError
|
Error for the size of the collection being too large
Enumerations
-
TOO_LARGE
-
UNKNOWN
- The value returned if the actual value is not exposed by the requested API version.
|
CommonError
|
A place for common errors that can be used across services.
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.
|