expression_rule_user_list
には、もう 1 つ違いがあります。デフォルトでは、ルール項目グループ内のルール項目はすべて AND
にまとめられます。つまり、訪問者をリストに追加するには、少なくとも 1 つのルール項目グループのすべてのルール項目が一致する必要があります。これは「分離句の標準形式」(OR_OF_ANDS
)と呼ばれます。
あるいは、各ルール項目グループで少なくとも 1 つのルール項目が一致する場合に、リストに訪問者を追加するように設定することもできます。これは「接続標準形」(AND_OF_ORS
)と呼ばれ、rule_type
フィールドを使用して expression_rule_user_list
で使用できます。date_specific_rule_user_list
に AND_OF_ORS
を使用しようとすると、エラーが発生します。
最後に、以上のルール項目グループを組み合わせて新しいユーザーリストを作成します。ここでは、ルールの作成目的から、デフォルトの 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
はニーズを満たしていますが、そのリストのルールを満たし、10 月 1 日から 12 月 31 日までにサイトを訪問したユーザーのみをキャプチャしたい場合はどうすればよいでしょうか。date_specific_rule_user_list
を使用します。
date_specific_rule_user_list
の作成は、expression_rule_user_list
の場合と同じプロセスで行います。RuleBasedUserListInfo
オブジェクトの expression_rule_user_list
フィールドを設定する代わりに、DateSpecificRuleUserListInfo
オブジェクトを使用して date_specific_rule_user_list
フィールドを設定します。このオブジェクトには、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
に更新されます。