MatchingFunction

Matching function associated with a CustomerFeed, CampaignFeed, or AdGroupFeed. The matching function is used to filter the set of feed items selected.

JSON representation
{
  "operator": enum (MatchingFunctionOperator),
  "leftOperands": [
    {
      object (Operand)
    }
  ],
  "rightOperands": [
    {
      object (Operand)
    }
  ],
  "functionString": string
}
Fields
operator

enum (MatchingFunctionOperator)

Operator for a function.

leftOperands[]

object (Operand)

The operands on the left hand side of the equation. This is also the operand to be used for single operand expressions such as NOT.

rightOperands[]

object (Operand)

The operands on the right hand side of the equation.

functionString

string

String representation of the Function.

Examples:

  1. IDENTITY(true) or IDENTITY(false). All or no feed items served.
  2. EQUALS(CONTEXT.DEVICE,"Mobile")
  3. IN(FEED_ITEM_ID,{1000001,1000002,1000003})
  4. CONTAINS_ANY(FeedAttribute[12345678,0],{"Mars cruise","Venus cruise"})
  5. AND(IN(FEED_ITEM_ID,{10001,10002}),EQUALS(CONTEXT.DEVICE,"Mobile"))

For more details, visit https://developers.google.com/google-ads/api/docs/extensions/feeds/matching-functions

Note that because multiple strings may represent the same underlying function (whitespace and single versus double quotation marks, for example), the value returned may not be identical to the string sent in a mutate request.

MatchingFunctionOperator

Possible operators in a matching function.

Enums
UNSPECIFIED Not specified.
UNKNOWN Used for return value only. Represents value unknown in this version.
IN The IN operator.
IDENTITY The IDENTITY operator.
EQUALS The EQUALS operator
AND Operator that takes two or more operands that are of type FunctionOperand and checks that all the operands evaluate to true. For functions related to ad formats, all the operands must be in leftOperands.
CONTAINS_ANY Operator that returns true if the elements in leftOperands contain any of the elements in rightOperands. Otherwise, return false. The rightOperands must contain at least 1 and no more than 3 ConstantOperands.

Operand

An operand in a matching function.

JSON representation
{

  // Union field function_argument_operand can be only one of the following:
  "constantOperand": {
    object (ConstantOperand)
  },
  "feedAttributeOperand": {
    object (FeedAttributeOperand)
  },
  "functionOperand": {
    object (FunctionOperand)
  },
  "requestContextOperand": {
    object (RequestContextOperand)
  }
  // End of list of possible types for union field function_argument_operand.
}
Fields
Union field function_argument_operand. Different operands that can be used in a matching function. Required. function_argument_operand can be only one of the following:
constantOperand

object (ConstantOperand)

A constant operand in a matching function.

feedAttributeOperand

object (FeedAttributeOperand)

This operand specifies a feed attribute in feed.

functionOperand

object (FunctionOperand)

A function operand in a matching function. Used to represent nested functions.

requestContextOperand

object (RequestContextOperand)

An operand in a function referring to a value in the request context.

ConstantOperand

A constant operand in a matching function.

JSON representation
{

  // Union field constant_operand_value can be only one of the following:
  "stringValue": string,
  "longValue": string,
  "booleanValue": boolean,
  "doubleValue": number
  // End of list of possible types for union field constant_operand_value.
}
Fields
Union field constant_operand_value. Constant operand values. Required. constant_operand_value can be only one of the following:
stringValue

string

String value of the operand if it is a string type.

longValue

string (int64 format)

Int64 value of the operand if it is a int64 type.

booleanValue

boolean

Boolean value of the operand if it is a boolean type.

doubleValue

number

Double value of the operand if it is a double type.

FeedAttributeOperand

A feed attribute operand in a matching function. Used to represent a feed attribute in feed.

JSON representation
{
  "feedId": string,
  "feedAttributeId": string
}
Fields
feedId

string (int64 format)

The associated feed. Required.

feedAttributeId

string (int64 format)

Id of the referenced feed attribute. Required.

FunctionOperand

A function operand in a matching function. Used to represent nested functions.

JSON representation
{
  "matchingFunction": {
    object (MatchingFunction)
  }
}
Fields
matchingFunction

object (MatchingFunction)

The matching function held in this operand.

RequestContextOperand

An operand in a function referring to a value in the request context.

JSON representation
{
  "contextType": enum (MatchingFunctionContextType)
}
Fields
contextType

enum (MatchingFunctionContextType)

Type of value to be referred in the request context.

MatchingFunctionContextType

Possible context types for an operand in a matching function.

Enums
UNSPECIFIED Not specified.
UNKNOWN Used for return value only. Represents value unknown in this version.
FEED_ITEM_ID Feed item id in the request context.
DEVICE_NAME The device being used (possible values are 'Desktop' or 'Mobile').
FEED_ITEM_SET_ID Feed item set id in the request context.