Tworzenie listy użytkowników

W przypadku expression_rule_user_list musisz wprowadzić dodatkowe rozróżnienie. Domyślnie Google Ads będzie łączyć wszystkie elementy reguły w grupie AND razem. Oznacza to, że aby reguła dodała użytkownika do listy, musi pasować każdy element reguły w co najmniej 1 grupie elementów reguły. Nazywa się to „dysjunkcyjną postacią normalną” lub OR_OF_ANDS.

Możesz też tak skonfigurować listę, aby dodawać do niej użytkowników tylko wtedy, gdy pasuje co najmniej 1 element reguły w każdej grupie elementów reguły. Nazywa się to „spójną postacią zwykłą” lub AND_OF_ORS. Jest dostępna w przypadku expression_rule_user_list za pomocą pola rule_type. Próba użycia właściwości AND_OF_ORS w przypadku elementu date_specific_rule_user_list zakończy się błędem.

Wystarczy połączyć powyższe grupy elementów reguł w nową listę użytkowników. W tym przypadku zostawimy domyślną funkcję OR_OF_ANDS, ponieważ dlatego opracowaliśmy te reguły.

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 => []});
      

Ogranicz według zakresu dat wizyt w witrynie

Element expression_rule_user_list spełnia Twoje potrzeby, ale co jeśli chcesz pozyskać tylko użytkowników, którzy spełniają warunki tej reguły, i odwiedzić Twoją witrynę między 1 października a 31 grudnia? Użyj formatu date_specific_rule_user_list.

Proces tworzenia date_specific_rule_user_list przebiega tak samo jak w przypadku expression_rule_user_list. Zamiast ustawiać pole expression_rule_user_list obiektu RuleBasedUserListInfo, ustaw pole date_specific_rule_user_list za pomocą obiektu DateSpecificRuleUserListInfo. Ten obiekt będzie zawierał pola start_date i 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();

Nowa lista będzie zawierać wszystkich użytkowników, którzy spełniają te same reguły co poprzednia lista, ale tylko wtedy, gdy odwiedzą Twoją witrynę między start_date (włącznie) a end_date (włącznie).

Uwzględnij wcześniejszych użytkowników na liście

Możesz też uwzględnić wcześniejszych użytkowników w opartej na regułach liście użytkowników, ustawiając parametr prepopulation_status listy na REQUESTED, a także monitorować postęp asynchronicznego procesu wstępnego wypełniania, okresowo sprawdzając stan tego pola.

Dodane zostaną tylko użytkownicy z ostatnich 30 dni, w zależności od okresu członkostwa na liście i daty dodania tagu remarketingowego. Po przetworzeniu żądania stan zostanie zmieniony na FINISHED lub na FAILED, jeśli żądanie się nie powiedzie.