Membuat Daftar Pengguna

Untuk expression_rule_user_list, ada perbedaan tambahan yang harus dibuat. Secara default, Google Ads akan AND menggabungkan semua item aturan dalam grup item aturan. Artinya, setiap item aturan di setidaknya satu grup item aturan harus cocok agar aturan dapat menambahkan pengunjung ke daftar. Ini disebut "bentuk normal disjungtif", atau OR_OF_ANDS.

Cara lain, Anda dapat menyiapkan daftar untuk hanya menambahkan pengunjung ke daftar jika setidaknya satu item aturan di setiap grup item aturan cocok. Ini disebut "bentuk normal konjungtif", atau AND_OF_ORS, dan tersedia untuk expression_rule_user_list menggunakan kolom rule_type. Mencoba menggunakan AND_OF_ORS untuk date_specific_rule_user_list akan menghasilkan error.

Langkah selanjutnya adalah menggabungkan grup item aturan di atas ke dalam daftar pengguna baru. Dalam hal ini, kita akan membiarkan fungsi OR_OF_ANDS default, karena kita membuat aturan ini.

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

Batasi menurut rentang tanggal kunjungan situs

expression_rule_user_list di atas memenuhi kebutuhan Anda, tetapi bagaimana jika Anda hanya ingin mendapatkan pengguna yang memenuhi aturan dalam daftar tersebut dan mengunjungi situs Anda antara 1 Oktober hingga 31 Desember? Gunakan date_specific_rule_user_list.

Pembuatan date_specific_rule_user_list mengikuti proses yang sama dengan yang Anda ikuti untuk expression_rule_user_list. Daripada menetapkan kolom expression_rule_user_list untuk objek RuleBasedUserListInfo, tetapkan kolom date_specific_rule_user_list dengan objek DateSpecificRuleUserListInfo. Objek ini akan berisi kolom untuk start_date dan 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();

Daftar baru akan berisi semua pengguna yang memenuhi aturan yang sama seperti daftar sebelumnya, tetapi hanya jika mereka mengunjungi situs Anda antara start_date (inklusif) dan end_date (inklusif).

Sertakan pengguna sebelumnya ke dalam daftar

Anda juga dapat menyertakan pengguna sebelumnya dalam daftar pengguna berbasis aturan dengan menetapkan prepopulation_status daftar pengguna ke REQUESTED, dan memantau progres proses pengisian otomatis asinkron dengan memeriksa status kolom ini secara berkala.

Tindakan ini hanya akan menambahkan pengguna sebelumnya dari dalam 30 hari terakhir, bergantung pada durasi keanggotaan daftar dan tanggal ketika tag pemasaran ulang ditambahkan. Status akan diperbarui menjadi FINISHED setelah permintaan diproses, atau FAILED jika permintaan gagal.