创建用户名单

对于expression_rule_user_list: 还需要进行额外的区分修改者 默认情况下,Google Ads 会对规则项中的所有规则项一并进行 AND 操作 。这意味着,至少一个规则项目组中的每个规则项目 必须匹配,相应规则才能将访问者添加到列表中。这称为 “析取范式”或 OR_OF_ANDS

或者,如果各个规则项目组至少一个规则项目符合条件,您可以将列表设置为仅向其中添加一位访问者。这个 叫做“合取范式”,或 AND_OF_ORS、 适用于expression_rule_user_list 使用 rule_type 字段。正在尝试 使用 AND_OF_ORS date_specific_rule_user_list 会导致错误。

现在,只要将上述规则项目组合并成新的用户列表即可。在本例中,我们将保留默认的 OR_OF_ANDS 功能, 因为这就是我们制定这些规则的目的

Java

FlexibleRuleUserListInfo flexibleRuleUserListInfo =
    FlexibleRuleUserListInfo.newBuilder()
        .setInclusiveRuleOperator(UserListFlexibleRuleOperator.AND)
        .addInclusiveOperands(
            FlexibleRuleOperandInfo.newBuilder()
                .setRule(
                    // The default rule_type for a UserListRuleInfo object is OR of ANDs
                    // (disjunctive normal form). That is, rule items will be ANDed together
                    // within rule item groups and the groups themselves will be ORed together.
                    UserListRuleInfo.newBuilder()
                        .addRuleItemGroups(checkoutDateRuleGroup)
                        .addRuleItemGroups(checkoutAndCartSizeRuleGroup))
                // Optional: includes a lookback window for this rule, in days.
                .setLookbackWindowDays(7L))
        .build();
      

C#

FlexibleRuleUserListInfo flexibleRuleUserListInfo = new FlexibleRuleUserListInfo();
FlexibleRuleOperandInfo flexibleRuleOperandInfo = new FlexibleRuleOperandInfo() {
    Rule = new UserListRuleInfo()
};
flexibleRuleOperandInfo.Rule.RuleItemGroups.Add(checkoutAndCartSizeRuleGroup);
flexibleRuleOperandInfo.Rule.RuleItemGroups.Add(checkoutDateRuleGroup);
flexibleRuleUserListInfo.InclusiveOperands.Add(flexibleRuleOperandInfo);
      

PHP

$flexibleRuleUserListInfo = new FlexibleRuleUserListInfo([
    'inclusive_rule_operator' => UserListFlexibleRuleOperator::PBAND,
    'inclusive_operands' => [
        new FlexibleRuleOperandInfo([
            'rule' => new UserListRuleInfo([
                // The default rule_type for a UserListRuleInfo object is OR of ANDs
                // (disjunctive normal form). That is, rule items will be ANDed together
                // within rule item groups and the groups themselves will be ORed together.
                'rule_item_groups' => [
                    $checkoutAndCartSizeRuleGroup,
                    $checkoutDateRuleGroup
                ]
            ]),
            // Optionally add a lookback window for this rule, in days.
            'lookback_window_days' => 7
        ])
    ],
    'exclusive_operands' => []
]);
      

Python

# Create a FlexibleRuleUserListInfo object, or a flexible rule
# representation of visitors with one or multiple actions.
# FlexibleRuleUserListInfo wraps UserListRuleInfo in a
# FlexibleRuleOperandInfo object that represents which user lists to
# include or exclude.
flexible_rule_user_list_info = (
    rule_based_user_list_info.flexible_rule_user_list
)
flexible_rule_user_list_info.inclusive_rule_operator = (
    client.enums.UserListFlexibleRuleOperatorEnum.AND
)
# The default rule_type for a UserListRuleInfo object is OR of
# ANDs (disjunctive normal form). That is, rule items will be
# ANDed together within rule item groups and the groups
# themselves will be ORed together.
rule_operand = client.get_type("FlexibleRuleOperandInfo")
rule_operand.rule.rule_item_groups.extend(
    [
        checkout_and_cart_size_rule_group,
        checkout_date_rule_group,
    ]
)
rule_operand.lookback_window_days = 7
flexible_rule_user_list_info.inclusive_operands.append(rule_operand)
      

Ruby

r.flexible_rule_user_list = client.resource.flexible_rule_user_list_info do |frul|
  frul.inclusive_rule_operator = :AND
  frul.inclusive_operands << client.resource.flexible_rule_operand_info do |froi|
    froi.rule = client.resource.user_list_rule_info do |info|
      info.rule_item_groups += [checkout_date_rule_group, checkout_and_cart_size_rule_group]
    end
    # Optionally include a lookback window for this rule, in days.
    froi.lookback_window_days = 7
  end
end
      

Perl

my $flexible_rule_user_list_info =
  Google::Ads::GoogleAds::V17::Common::FlexibleRuleUserListInfo->new({
    inclusiveRuleOperator => AND,
    inclusiveOperands     => [
      Google::Ads::GoogleAds::V17::Common::FlexibleRuleOperandInfo->new({
          rule => Google::Ads::GoogleAds::V17::Common::UserListRuleInfo->new({
              # The default rule_type for a UserListRuleInfo object is OR of
              # ANDs (disjunctive normal form). That is, rule items will be
              # ANDed together within rule item groups and the groups
              # themselves will be ORed together.
              ruleItemGroups => [
                $checkout_date_rule_group, $checkout_and_cart_size_rule_group
              ]}
          ),
          # Optionally include a lookback window for this rule, in days.
          lookback_window_days => 7
        })
    ],
    exclusiveOperands => []});
      

通过网站访问日期范围加以限制

expression_rule_user_list 能满足您的需求,但如果只是 希望捕获符合该名单中相应规则并访问您的网站的用户 会发生什么呢?使用 date_specific_rule_user_list

创建date_specific_rule_user_list的过程与创建 (针对 expression_rule_user_list)。您不必将 expression_rule_user_list字段 RuleBasedUserListInfo 对象,请设置 date_specific_rule_user_list 字段,其中包含 DateSpecificRuleUserListInfo 对象。 此对象将包含start_date的字段 和 end_date

DateSpecificRuleUserListInfo dateSpecificRuleUserListInfo =
    DateSpecificRuleUserListInfo.newBuilder()
        .setRule(
            UserListRuleInfo.newBuilder()
                .addAllRuleItemGroups(
                    ImmutableList.of(checkoutAndCartSizeRuleGroup, checkoutDateRuleGroup)))
        .setStartDate(StringValue.of("2019-10-01"))
        .setEndDate(StringValue.of("2019-12-31"))
        .build();

新列表将包含与旧列表符合相同规则的所有用户 列表,但仅限于在 start_date期间访问您的网站时 (含)和 end_date(含)。

在列表中加入过往用户

您还可以将以前的用户添加到基于规则的用户列表中,方法是设置 prepopulation_status 添加到用户列表中 REQUESTED, 并监控异步预填充过程的进度, 定期检查此字段的状态。

此操作只会添加过去 30 天内的过往用户,具体取决于 再营销名单的成员资格有效期以及添加再营销代码的日期。通过 状态将更新为FINISHED 请求处理完毕后,该值为 FAILED(如果 请求失败