MatchingFunction

与 CustomerFeed、CampaignFeed 或 AdGroupFeed 相关联的匹配函数。匹配函数用于过滤所选的一组 Feed 项。

JSON 表示法
{
  "operator": enum (MatchingFunctionOperator),
  "leftOperands": [
    {
      object (Operand)
    }
  ],
  "rightOperands": [
    {
      object (Operand)
    }
  ],
  "functionString": string
}
字段
operator

enum (MatchingFunctionOperator)

函数的运算符。

leftOperands[]

object (Operand)

等式左侧的操作数。这也是将用于单个操作数表达式(如 NOT)的操作数。

rightOperands[]

object (Operand)

等式右侧的操作数。

functionString

string

函数的字符串表示法。

示例:

  1. IDENTITY(true) 或 IDENTITY(false)。投放全部或未投放 Feed 项。
  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"))

如需了解详情,请访问 https://developers.google.com/google-ads/api/docs/extensions/feeds/matching-functions

请注意,由于多个字符串可能表示相同的基础函数(例如,空格以及单引号和双引号),因此返回的值可能与 mutate 请求中发送的字符串不完全相同。

MatchingFunctionOperator

匹配函数中可能的运算符。

枚举
UNSPECIFIED 未指定。
UNKNOWN 仅用于返回值。表示此版本中的未知值。
IN IN 运算符。
IDENTITY IDENTITY 运算符。
EQUALS EQUALS 运算符
AND 该运算符接受两个或更多个类型为 FunctionFunction 的运算数,并检查所有运算数的计算结果是否均为 true。对于与广告格式相关的函数,所有运算数都必须位于 leftINDEX 中。
CONTAINS_ANY 如果 leftINDEXs 中的元素包含 rightINDEXs 中的任何元素,则返回 true。否则,返回 false。正确的操作数必须包含至少 1 个且不超过 3 个 ConstantNumber。

操作数

匹配函数中的操作数。

JSON 表示法
{

  // 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.
}
字段
联合字段 function_argument_operand。可以在匹配函数中使用的不同运算数。必需。function_argument_operand 只能是下列其中一项:
constantOperand

object (ConstantOperand)

匹配函数中的常量运算数。

feedAttributeOperand

object (FeedAttributeOperand)

此运算数用于指定 Feed 中的 Feed 属性。

functionOperand

object (FunctionOperand)

匹配函数中的函数运算数。用于表示嵌套函数。

requestContextOperand

object (RequestContextOperand)

引用请求上下文中的值的函数中的操作数。

ConstantOperand

匹配函数中的常量运算数。

JSON 表示法
{

  // 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.
}
字段
联合字段 constant_operand_value。常量运算数值。必需。constant_operand_value 只能是下列其中一项:
stringValue

string

操作数的字符串值(如果是字符串类型)。

longValue

string (int64 format)

操作数的 Int64 值(如果操作数为 int64 类型)。

booleanValue

boolean

操作数的布尔值(如果操作数为布尔值类型)。

doubleValue

number

如果操作数为双精度类型,则为双精度值。

FeedAttributeOperand

匹配函数中的 Feed 属性运算数。用于表示 Feed 中的 Feed 属性。

JSON 表示法
{
  "feedId": string,
  "feedAttributeId": string
}
字段
feedId

string (int64 format)

关联的 Feed。必填。

feedAttributeId

string (int64 format)

引用的 Feed 属性的 ID。必填。

FunctionOperand

匹配函数中的函数运算数。用于表示嵌套函数。

JSON 表示法
{
  "matchingFunction": {
    object (MatchingFunction)
  }
}
字段
matchingFunction

object (MatchingFunction)

此运算数中存储的匹配函数。

RequestContextOperand

引用请求上下文中的值的函数中的操作数。

JSON 表示法
{
  "contextType": enum (MatchingFunctionContextType)
}
字段
contextType

enum (MatchingFunctionContextType)

要在请求上下文中引用的值的类型。

MatchingFunctionContextType

匹配函数中操作数的可能上下文类型。

枚举
UNSPECIFIED 未指定。
UNKNOWN 仅用于返回值。表示此版本中的未知值。
FEED_ITEM_ID 请求上下文中的 Feed 项 ID。
DEVICE_NAME 使用的设备(可能的值为“Desktop”或“Mobile”)。
FEED_ITEM_SET_ID 请求上下文中的 Feed 项组 ID。