Title: Cohort Rules Locale: en URL: https://sensorswave.com/en/docs/user-operation/cohort-rules/ Description: Learn about cohort rule types, operators, and combination methods in detail Cohort rules are the core of cohorts, determining which users will be selected into a cohort. Sensors Wave provides a powerful rule engine that supports three rule types — user properties, user behavior, and existing cohorts — along with flexible rule combination capabilities. ## Rule Types ### 1. User Property Filter Filter users based on their property values. **Use cases**: - Group by inherent user characteristics: gender, age, region - Group by business attributes: membership level, registration channel - Group by device information: operating system, device model **Configuration steps**: 1. Select rule type: **User Property** 2. Select the property name, e.g., "Membership Level" 3. Select the operator, e.g., "Equals" 4. Enter or select the property value, e.g., "Gold Member" **Examples**: ``` Membership Level equals Gold Member Registration Date greater than 2025-01-01 Region in [Beijing, Shanghai, Guangzhou, Shenzhen] Phone Number Is Not Null ``` ### 2. User Behavior Filter Filter users based on behavioral metrics. **Use cases**: - Group by behavior frequency: Logged in more than 3 times in the past 7 days - Group by behavior amount: Spent more than 1,000 in the past 30 days - Group by behavior content: Browsed products in a specific category **Configuration steps**: 1. Select rule type: **User Behavior** 2. Select the event name, e.g., "Payment Successful" 3. Select the aggregation method, e.g., "Sum of property values" 4. Select the aggregation property (if applicable), e.g., "Order Amount" 5. Set the time range, e.g., "Past 30 days" 6. Select the operator and threshold, e.g., "Greater than 1000" **Aggregation methods**: | Aggregation | Description | Use cases | |-------------|-------------|-----------| | **Total count** | Number of times the event occurred | Login count, page view count | | **Sum of property values** | Sum of event property values | Spending amount, browsing duration | | **Average of property values** | Average of event property values | Average order amount | | **Max/Min of property values** | Maximum/minimum event property value | Largest single purchase | | **Distinct count of property** | Distinct count of event property values | Number of product categories browsed | | **Active days** | Number of days with event occurrences | Active days | **Examples**: ``` Past 7 days Login Total count greater than 3 Past 30 days Payment Successful Order Amount sum greater than 1000 Past 30 days Browse Product Product Category distinct count greater than 5 Past 7 days Any Event Active days greater than or equal to 5 ``` ### 3. Existing Cohort Filter Use previously created cohorts directly as rules. **Use cases**: - Cohort intersection: Belongs to Cohort A AND belongs to Cohort B - Cohort difference: Belongs to Cohort A BUT does not belong to Cohort B - Cohort union: Belongs to Cohort A OR belongs to Cohort B **Configuration steps**: 1. Select rule type: **Cohort** 2. Select the operation: **Belongs to** or **Does not belong to** 3. Select the target cohort **Examples**: ``` Belongs to High-Value Users cohort Does not belong to Refunded Users cohort Belongs to VIP Users AND Does not belong to Churned Users ``` ## Supported Operators ### General Operators | Operator | Applicable Types | Description | Example | |----------|-----------------|-------------|---------| | **Equals** | All types | Exact match of specified value | Membership Level equals Gold Member | | **Not equals** | All types | Excludes specified value | Membership Level not equals Regular Member | | **Is Not Null** | All types | Property exists and is not empty | Phone Number Is Not Null | | **Is Null** | All types | Property does not exist or is empty | Email Is Null | ### Numeric Operators | Operator | Description | Example | |----------|-------------|---------| | **Greater than** | Greater than specified value (exclusive) | Age greater than 18 | | **Greater than or equal to** | Greater than or equal to specified value | Spending amount greater than or equal to 1000 | | **Less than** | Less than specified value (exclusive) | Order count less than 10 | | **Less than or equal to** | Less than or equal to specified value | Active days less than or equal to 3 | | **Between** | Within specified range (inclusive) | Age Between 18 and 35 | ### String Operators | Operator | Description | Example | |----------|-------------|---------| | **Contains** | Contains specified text | Email Contains @gmail.com | | **Not Contains** | Does not contain specified text | Username Not Contains test | ### List Operators | Operator | Description | Example | |----------|-------------|---------| | **In** | Matches any value in the list | Region in [Beijing, Shanghai] | | **Not in** | Does not match any value in the list | Channel not in [Test, Internal] | ### Time Operators | Operator | Description | Example | |----------|-------------|---------| | **Before** | Earlier than specified time | Registration date before 2025-01-01 | | **After** | Later than specified time | Registration date after 2025-01-01 | | **Within the last N days** | Within the specified number of recent days | Last active time within the last 7 days | | **More than N days ago** | More than specified number of days | Last active time more than 30 days ago | ## Rule Combinations ### AND Relationship Only users who meet all conditions will be selected: ``` Membership Level equals Gold Member AND Spending in the past 30 days greater than 1000 ``` **Result**: Gold Members who spent more than 1,000 in the past 30 days ### OR Relationship Users who meet any condition will be selected: ``` Membership Level equals Gold Member OR Membership Level equals Platinum Member ``` **Result**: Gold Members or Platinum Members ### Nested Combinations Supports up to two levels of nested complex rules: **Example 1: High-value mobile users** ``` (Device Type equals iOS OR Device Type equals Android) AND (Spending in the past 30 days greater than 1000) ``` **Example 2: Active high-tier members** ``` (Membership Level equals Gold Member OR Membership Level equals Platinum Member) AND (Past 7 days Login Total count greater than 3) ``` **Example 3: At-risk churn users (previously active but recently inactive)** ``` (Past 90 days Login Total count greater than 10) AND (Past 30 days Login Total count equals 0) ``` ### Rule Configuration Interface In the configuration interface: 1. Click **Add Condition** to add a new rule 2. Click the connector between conditions to toggle between "AND/OR" 3. Click **Add Condition Group** to create a nested combination 4. Drag conditions to adjust order 5. Click the delete button to the right of a condition to remove it ## Rule Configuration Examples ### Example 1: High-Value Users **Definition**: Users who spent more than 1,000 in the past 30 days or have cumulative spending exceeding 5,000 ``` User Behavior: Past 30 days Payment Successful Order Amount sum greater than 1000 OR User Property: Cumulative spending greater than 5000 ``` ### Example 2: At-Risk Churn Users **Definition**: Users who were once active (registered more than 30 days ago) but have not visited in the past 14 days ``` User Property: Registration date more than 30 days ago AND User Behavior: Past 14 days Any Event Total count equals 0 AND User Behavior: Historical Any Event Total count greater than 10 ``` ### Example 3: Potential Conversion Users **Definition**: Users who browsed frequently in the past 7 days but did not make a purchase ``` User Behavior: Past 7 days Browse Product Total count greater than 10 AND User Behavior: Past 7 days Payment Successful Total count equals 0 ``` ### Example 4: VIP Exclusive Users **Definition**: VIP members or users who have reached the VIP spending threshold ``` User Property: Membership Level equals VIP OR ( User Property: Cumulative spending greater than 10000 AND User Behavior: Past 90 days Any Event Active days greater than 30 ) ``` ### Example 5: Gradual Rollout Users **Definition**: Internal employees or Beta testers, excluding known problematic users ``` ( User Property: Email Contains @company.com OR Cohort: Belongs to Beta Testers ) AND Cohort: Does not belong to Problematic Users Blocklist ``` ### Example 6: Re-engagement Target Users **Definition**: Users who have paid before but have churned and are not in other re-engagement campaigns ``` User Behavior: Historical Payment Successful Total count greater than 0 AND User Behavior: Past 60 days Any Event Total count equals 0 AND Cohort: Does not belong to Already Re-engaged Users AND Cohort: Does not belong to Marketing Opt-out Users ``` ## Notes ### Rule Limits - A single cohort supports a maximum of 20 rule conditions - Nesting supports a maximum of 2 levels - Behavior filter time ranges can be up to 365 days - Cohort references cannot form circular dependencies ### Performance Considerations - The more rule conditions, the longer the computation time - Behavior filters consume more resources than property filters - Dynamic Cohorts are computed on a daily schedule - For large data volumes, we recommend keeping rules reasonably simple ### Data Accuracy - The size of Dynamic Cohorts changes over time - There may be a 1–5 minute data delay ## Next Steps Now that you understand how to configure cohort rules, you can: 1. **[Cohort Management](cohort-management.mdx)**: Learn how to create, manage, and apply cohorts 2. **[Integration with Analytics](integration-with-analytics.mdx)**: Learn how cohorts are used in analytics 3. **[Best Practices](best-practices.mdx)**: Reference cohort design and optimization tips --- **Last updated**: January 19, 2026