Note: Version v201902 will be sunset soon. All users of those versions must migrate to a newer one.

CustomTargetingService (v201905)

Provides operations for creating, updating and retrieving CustomTargetingKey and CustomTargetingValue objects.


Production WSDL
https://ads.google.com/apis/ads/publisher/v201905/CustomTargetingService?wsdl
Namespace
https://www.google.com/apis/ads/publisher/v201905
Operations
Errors

createCustomTargetingKeys

Creates new CustomTargetingKey objects. The following fields are required:

Parameters

Field Type Description
keys CustomTargetingKey[] the custom targeting keys to update

Response

Field Type Description
rval CustomTargetingKey[] the updated custom targeting keys

createCustomTargetingValues

Creates new CustomTargetingValue objects. The following fields are required:

Parameters

Field Type Description
values CustomTargetingValue[] the custom targeting values to update

Response

Field Type Description
rval CustomTargetingValue[] the updated custom targeting keys

getCustomTargetingKeysByStatement

Gets a CustomTargetingKeyPage of CustomTargetingKey objects that satisfy the given Statement.query. The following fields are supported for filtering:

PQL Property Object Property
id CustomTargetingKey.id
name CustomTargetingKey.name
displayName CustomTargetingKey.displayName
type CustomTargetingKey.type

Parameters

Field Type Description
filterStatement Statement a Publisher Query Language statement used to filter a set of custom targeting keys

Response

Field Type Description
rval CustomTargetingKeyPage the custom targeting keys that match the given filter

getCustomTargetingValuesByStatement

Gets a CustomTargetingValuePage of CustomTargetingValue objects that satisfy the given Statement.query.

The WHERE clause in the Statement.query must always contain CustomTargetingValue.customTargetingKeyId as one of its columns in a way that it is AND'ed with the rest of the query. So, if you want to retrieve values for a known set of key ids, valid Statement.query would look like:

  1. "WHERE customTargetingKeyId IN ('17','18','19')" retrieves all values that are associated with keys having ids 17, 18, 19.
  2. "WHERE customTargetingKeyId = '17' AND name = 'red'" retrieves values that are associated with keys having id 17 and value name is 'red'.

The following fields are supported for filtering:

PQL Property Object Property
id CustomTargetingValue.id
customTargetingKeyId CustomTargetingValue.customTargetingKeyId
name CustomTargetingValue.name
displayName CustomTargetingValue.displayName
matchType CustomTargetingValue.matchType

Parameters

Field Type Description
filterStatement Statement a Publisher Query Language statement used to filter a set of custom targeting values

Response

Field Type Description
rval CustomTargetingValuePage the custom targeting values that match the given filter

performCustomTargetingKeyAction

Performs actions on CustomTargetingKey objects that match the given Statement.query.

Parameters

Field Type Description
customTargetingKeyAction
  1. CustomTargetingKeyAction
    1. ActivateCustomTargetingKeys
    2. DeleteCustomTargetingKeys
the action to perform
filterStatement Statement a Publisher Query Language statement used to filter a set of custom targeting keys

Response

Field Type Description
rval UpdateResult the result of the action performed

performCustomTargetingValueAction

Performs actions on CustomTargetingValue objects that match the given Statement.query.

Parameters

Field Type Description
customTargetingValueAction
  1. CustomTargetingValueAction
    1. ActivateCustomTargetingValues
    2. DeleteCustomTargetingValues
the action to perform
filterStatement Statement a Publisher Query Language statement used to filter a set of ad units

Response

Field Type Description
rval UpdateResult the result of the action performed

updateCustomTargetingKeys

Updates the specified CustomTargetingKey objects.

Parameters

Field Type Description
keys CustomTargetingKey[] the custom targeting keys to update

Response

Field Type Description
rval CustomTargetingKey[] the updated custom targeting keys

updateCustomTargetingValues

Updates the specified CustomTargetingValue objects.

Parameters

Field Type Description
values CustomTargetingValue[] the custom targeting values to update

Response

Field Type Description
rval CustomTargetingValue[] the updated custom targeting values

Errors

Error Reasons
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.
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.
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.
CustomTargetingError Lists all errors related to CustomTargetingKey and CustomTargetingValue objects.
Enumerations
KEY_NOT_FOUND
Requested CustomTargetingKey is not found.
KEY_COUNT_TOO_LARGE
Number of CustomTargetingKey objects created exceeds the limit allowed for the network.
KEY_NAME_DUPLICATE
CustomTargetingKey with the same CustomTargetingKey.name already exists.
KEY_NAME_EMPTY
CustomTargetingKey.name is empty.
KEY_NAME_INVALID_LENGTH
CustomTargetingKey.name is too long.
KEY_NAME_INVALID_CHARS
CustomTargetingKey.name contains unsupported or reserved characters.
KEY_NAME_RESERVED
CustomTargetingKey.name matches one of the reserved custom targeting key names.
KEY_DISPLAY_NAME_INVALID_LENGTH
CustomTargetingKey.displayName is too long.
VALUE_NOT_FOUND
Requested CustomTargetingValue is not found.
GET_VALUES_BY_STATEMENT_MUST_CONTAIN_KEY_ID
The WHERE clause in the Statement.query must always contain CustomTargetingValue.customTargetingKeyId as one of its columns in a way that it is AND'ed with the rest of the query.
VALUE_COUNT_FOR_KEY_TOO_LARGE
The number of CustomTargetingValue objects associated with a CustomTargetingKey exceeds the network limit. This is only applicable for keys of type CustomTargetingKey.Type#PREDEFINED.
VALUE_NAME_DUPLICATE
CustomTargetingValue with the same CustomTargetingValue.name already exists.
VALUE_NAME_EMPTY
CustomTargetingValue.name is empty.
VALUE_NAME_INVALID_LENGTH
CustomTargetingValue.name is too long.
VALUE_NAME_INVALID_CHARS
CustomTargetingValue.name contains unsupported or reserved characters.
VALUE_DISPLAY_NAME_INVALID_LENGTH
CustomTargetingValue.displayName is too long.
VALUE_MATCH_TYPE_NOT_ALLOWED
Only Ad Manager 360 networks can have CustomTargetingValue.matchType other than CustomTargetingValue.MatchType.EXACT.
VALUE_MATCH_TYPE_NOT_EXACT_FOR_PREDEFINED_KEY
You can only create CustomTargetingValue objects with match type CustomTargetingValue.MatchType.EXACT when associating with CustomTargetingKey objects of type CustomTargetingKey.Type.PREDEFINED
SUFFIX_MATCH_TYPE_NOT_ALLOWED
CustomTargetingValue object cannot have match type of CustomTargetingValue.MatchType.SUFFIX when adding a CustomTargetingValue to a line item.
CONTAINS_MATCH_TYPE_NOT_ALLOWED
CustomTargetingValue object cannot have match type of CustomTargetingValue.MatchType.CONTAINS when adding a CustomTargetingValue to targeting expression of a line item.
KEY_WITH_MISSING_VALUES
The CustomTargetingKey does not have any CustomTargetingValue associated with it.
INVALID_VALUE_FOR_KEY
The CustomTargetingKey has a CustomTargetingValue specified for which the value is not a valid child.
CANNOT_OR_DIFFERENT_KEYS
CustomCriteriaSet.LogicalOperator.OR operation cannot be applied to values with different keys.
INVALID_TARGETING_EXPRESSION
Targeting expression is invalid. This can happen if the sequence of operators is wrong, or a node contains invalid number of children.
DELETED_KEY_CANNOT_BE_USED_FOR_TARGETING
The key has been deleted. CustomCriteria cannot have deleted keys.
DELETED_VALUE_CANNOT_BE_USED_FOR_TARGETING
The value has been deleted. CustomCriteria cannot have deleted values.
VIDEO_BROWSE_BY_KEY_CANNOT_BE_USED_FOR_CUSTOM_TARGETING
The key is set as the video browse-by key, which cannot be used for custom targeting.
CANNOT_DELETE_CUSTOM_KEY_USED_IN_CONTENT_METADATA_MAPPING
Only active custom-criteria keys are supported in content metadata mapping.
CANNOT_DELETE_CUSTOM_VALUE_USED_IN_CONTENT_METADATA_MAPPING
Only active custom-criteria values are supported in content metadata mapping.
CANNOT_DELETE_CUSTOM_KEY_USED_IN_PARTNER_ASSIGNMENT_TARGETING
Cannot delete a custom criteria key that is targeted by an active partner assignment.
CANNOT_DELETE_CUSTOM_VALUE_USED_IN_PARTNER_ASSIGNMENT_TARGETING
Cannot delete a custom criteria value that is targeted by an active partner assignment.
CANNOT_TARGET_AUDIENCE_SEGMENT
AudienceSegment object cannot be targeted.
CANNOT_TARGET_INACTIVE_AUDIENCE_SEGMENT
Inactive Au