Tạo danh sách người dùng

Bạn có thể sử dụng danh sách người dùng trong chiến dịch tái tiếp thị để thu hút lại những người dùng đã thực hiện các hành động cụ thể trên trang web hoặc ứng dụng của bạn. API Google Ads hỗ trợ một số loại danh sách người dùng. Hướng dẫn này tập trung vào việc tạo danh sách người dùng dựa trên quy tắc bằng cách sử dụng các nhóm mặt hàng quy tắc được xác định trong phần Tạo nhóm mục quy tắc.

Danh sách người dùng dựa trên quy tắc

Danh sách người dùng dựa trên quy tắc được tạo bằng flexible_rule_user_list có thể chứa nhiều quy tắc (inclusive_rule và exclusive_rule, được kết hợp bằng inclusive_rule_operator). Mỗi quy tắc được biểu thị bằng một thông báo UserListRuleInfo, có trường rule_type cho biết cách kết hợp các mục quy tắc trong nhóm mặt hàng quy tắc.

Mặc dù UserListRuleTypeEnum xác định cả OR_OF_ANDS (dạng chuẩn tuyển) và AND_OF_ORS (dạng chuẩn hội), nhưng OR_OF_ANDS là rule_type duy nhất được hỗ trợ cho FlexibleRuleUserListInfo (việc đặt AND_OF_ORS sẽ trả về UserListError.RULE_TYPE_IS_NOT_SUPPORTED). Với OR_OF_ANDS, Google Ads sẽ AND tất cả các mục quy tắc trong một nhóm mục quy tắc, tức là đối với một quy tắc nhất định, mọi mục quy tắc trong ít nhất một nhóm mục quy tắc phải khớp thì quy tắc đó mới được đáp ứng.

Sau khi xác định hai đối tượng UserListRuleItemGroupInfo trong phần Tạo nhóm mặt hàng quy tắc, hãy kết hợp chúng thành một danh sách người dùng mới. Ví dụ về mã sau đây giữ nguyên loại quy tắc OR_OF_ANDS mặc định, thêm cả hai nhóm mặt hàng quy tắc vào FlexibleRuleOperandInfo trên FlexibleRuleUserListInfo và thay đổi danh sách người dùng:

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: FlexibleRuleUserListInfo = (
    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: FlexibleRuleOperandInfo = 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::V26::Common::FlexibleRuleUserListInfo->new({
    inclusiveRuleOperator => AND,
    inclusiveOperands     => [
      Google::Ads::GoogleAds::V26::Common::FlexibleRuleOperandInfo->new({
          rule => Google::Ads::GoogleAds::V26::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 => []});
      

curl

Thêm người dùng trước đây vào danh sách dựa trên quy tắc

Bạn cũng có thể đưa khách truy cập trang web hoặc người dùng ứng dụng trước đây vào danh sách người dùng dựa trên quy tắc (chỉ được hỗ trợ trên Mạng Hiển thị) bằng cách đặt prepopulation_status của danh sách người dùng thành REQUESTED, đồng thời theo dõi tiến trình của quy trình điền sẵn không đồng bộ bằng cách kiểm tra định kỳ trạng thái của trường này.

Tính năng điền sẵn chỉ thêm những người dùng trước đây trong vòng 30 ngày qua, tuỳ thuộc vào membership_life_span của danh sách (từ 1 đến 540 ngày) và ngày thêm thẻ tái tiếp thị. Trạng thái sẽ chuyển thành FINISHED sau khi yêu cầu được xử lý hoặc FAILED nếu yêu cầu không thành công.

Nhắm đến danh sách người dùng và điều chỉnh giá thầu

Sau khi bạn tạo UserList, hãy đính kèm tên tài nguyên của tiêu chí đó vào AdGroupCriterion hoặc CampaignCriterion và đặt bid_modifier (ví dụ: 1.25 để tăng giá thầu thêm 25%). Để xem các ví dụ về mã minh hoạ cách nhắm mục tiêu danh sách người dùng và sửa đổi giá thầu, hãy xem phần Nhắm mục tiêu danh sách.