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 项或未投放任何 Feed 项。
  2. EQUALS(CONTEXT.DEVICE,"Mobile")
  3. IN(FEED_ITEM_ID,{1000001,1000002,1000003})
  4. CONTAINS_ANY(FeedAttribute[12345678,0],{"火星之旅","金星之旅"})
  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。对于与广告格式相关的函数,所有操作数都必须位于 leftOperator 中。
CONTAINS_ANY 如果 leftNumbers 中的元素包含 rightType 中的任何元素,则返回 true 的运算符。否则,返回 false。正确的操作数必须包含至少 1 个,且不超过 3 个 ConstantNumbers。

操作数

匹配函数中的操作数。

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 使用的设备(可取值为“桌面设备”或“移动设备”)。
FEED_ITEM_SET_ID 请求上下文中的 Feed 项组 ID。