การสร้างรายชื่อผู้ใช้

แต่สำหรับ expression_rule_user_list โปรดทราบว่ามีข้อแตกต่างเพิ่มเติม โดยค่าเริ่มต้น Google Ads จะANDรวมรายการกฎทั้งหมดในกลุ่มรายการกฎ ซึ่งหมายความว่าทุกรายการของกฎในกลุ่มรายการของกฎอย่างน้อย 1 กลุ่มต้องตรงกัน จึงจะเพิ่มผู้เข้าชมลงในรายการได้ ซึ่งเรียกว่า "รูปแบบปกติที่ไม่ต่อเนื่อง" หรือ OR_OF_ANDS

หรือจะตั้งค่ารายการเพื่อเพิ่มผู้เข้าชมลงในรายการเฉพาะเมื่อรายการกฎอย่างน้อย 1 รายการในกลุ่มรายการกฎแต่ละกลุ่มตรงกันเท่านั้น วิธีนี้เรียกว่า "แบบฟอร์มปกติ" หรือ 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::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 => []});
      

จำกัดตามช่วงวันที่เข้าชมเว็บไซต์

expression_rule_user_list ข้างต้นตรงกับความต้องการของคุณ แต่จะทำอย่างไรหากคุณต้องการจะแสดงเฉพาะผู้ใช้ที่มีคุณสมบัติตามกฎในรายการและเข้าชมเว็บไซต์ระหว่างวันที่ 1 ตุลาคมถึง 31 ธันวาคม ใช้ 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 หากคำขอล้มเหลว