---
schema_version: "1"
id: aaa5abcaee14d574375e64acb5008e127a4e0e0fb4345d72aa44b2df488adfe7
title: Dynamic Customer Group Rules in B2C Commerce
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/cc/264-0-0/b2c_dynamic_customer_group_rules.md
canonical_url: https://help.salesforce.com/s/articleView?id=cc.b2c_dynamic_customer_group_rules.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: b2d07ba8ab14d9592d6fdfb010807bc4c65512dda87b74aa408c53b96a79c45f
description: A dynamic customer group has exactly one rule with one or more conditions. A condition is an individual line in the editor, for example, Company equals ‘Salesforce’.
products:
  - Commerce
  - B2C Commerce
release: "264"
---
# Dynamic Customer Group Rules in B2C Commerce

A dynamic customer group has exactly one rule with one or more conditions. A condition is an individual line in the editor, for example, Company equals ‘Salesforce’.

Each rule must have at least one condition in the inclusion list.

Each condition consists of an _attribute_, (for example, _Company_), an _operator_, (for example, _equals_), and one or more _values_ (for example, _Salesforce_).

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-cc-b2c_merchandiser_administrator-264-0-0-production-enus/ea76f372-6cfa-42a6-8e7c-05c6df7abed8/images/icon_note.png)

Note When using the _exist_ or _doesn't exist_ opeors, there’s’s no value.

When defining dynamic customer group rules, consider the following:

- A rule can have multiple include and exclude condition groups, following a pre-defined syntax. See [Dynamic Customer Group Attributes.](https://help.salesforce.com/s/articleView?id=cc.b2c_dynamic_customer_group_attributes.htm&release=264.0.0&type=5 "Use these attributes for dynamic customer groups.")
    - Each group can use certain operators. See [Dynamic Customer Group Operators.](https://help.salesforce.com/s/articleView?id=cc.b2c_dynamic_customer_group_operators.htm&release=264.0.0&type=5 "These are the supported operators.")
    - Condition groups are linked with an implicit OR operator.
        
        For example, "Include customers registered 1 year or longer AND #orders > 50 OR customers registered 2 years or longer and #orders > 100".
    - The list of included groups and the list of excluded groups are linked with the AND NOT semantic.
- Use certain attribute types. (See [Dynamic Group Attribute Types.](https://help.salesforce.com/s/articleView?id=cc.b2c_dynamic_group_attribute_types.htm&release=264.0.0&type=5 "There are seven supported attribute types.")
    - The following attribute types are supported: String, Set-of-String, Enum-of-String, Integer, Set-of-Integer, Enum-of-Integer, Number, Set-of-Number, Boolean, Date, Date+Time.
    - The following attribute types aren’t supported: Password, Email, Html, Text, Image.
- Define value selection and evaluation criteria.
    - Specify multiple values with some operators. Multiple values are separated by commas and are evaluated with the OR semantic. For example, "Country is 'United States', 'Germany'" is evaluated as "Country is 'United States' OR 'Germany'".
    - String values can be single-word or multi-word. For example, "Country is 'United States'".
    - String values can't include wildcards. For example, '\*' or '?' are interpreted as regular characters.
    - String operations are case-insensitive. For example, a string comparison "firstname is Mike" matches customers with first name "mike", "Mike" and "mIke".
    - Set-of-String, Set-of-Integer, and Set-of-Number conditions are evaluated against all values in the value set. For example, if a customer has three hobbies "Reading", "Sailing" and "Diving", and the condition is "hobby is Diving", the customer meets this condition.
    - With Enum-of-String and Enum-of-Integer, one or more values are selected from a defined value list (values aren’t entered by the user). The value select dialog box shows the values already selected and allows the customer to select new values or deselect already selected values.
    - Conditions evaluate to 'false' if no attribute value exists for the customer for the attribute. For example, 'age less than or equal 18' is false if the customer attribute 'age == null'.
- Operators enable you to include or exclude customers with undefined (none-existing) attribute values. For example, rules such as "exclude customers age < 17 or unknown age", exclude certain customers.
- Storefront session data is processed as follows:
    - To evaluate Referrer URL, Host, and Keywords attributes, compare their value with the corresponding attributes of the customer's session. Values are compared case-insensitive using string operators. See [Using Referrer Attributes.](https://help.salesforce.com/s/articleView?id=cc.b2c_using_referrer_attributes.htm&release=264.0.0&type=5 "When configuring dynamic customer group attributes, specify referrer parameters.")
    - session.customergroups only checks for static and system groups, not dynamic groups.
    - For Source Code Group, each value of a "Source Code" condition is compared with the source code group attached to the customer's session. If at least one of the condition values matches the source code group, the condition matches
    - For Locale Only, locales allowed in the selected site are considered during rule evaluation. A rule condition matches if the locale at the customer’s request is equal to the locale configured at the condition. If the request holds a locale that isn’t allowed in the selected site, the condition doesn't match and (potentially) the whole rule doesn't match. If the request doesn't contain a locale, the rule evaluation uses the default locale of the selected site to match it with the rule condition.
    - Session Custom Attribute conditions can only be evaluated in a meaningful way if the condition is applicable for the actual type of the session custom attribute. The condition type is used to deduce the expected type of the session custom attribute. If the actual type of the session custom attribute is different, the condition evaluates to _false._ For example, if during rule evaluation, the session custom attribute evaluates to a number from the customer's session, but the actual type is Boolean, the condition evaluates to _false._ See [Using Session Custom Attributes.](https://help.salesforce.com/s/articleView?id=cc.b2c_using_session_custom_attributes.htm&release=264.0.0&type=5 "Using session custom attributes, you can customize unique session information to identify customers for a customer group. To do this, configure customized session custom attributes in Business Manager and in your application.")

## Related Links

[Using Dynamic Customer Groups for Active Merchandising](https://help.salesforce.com/s/articleView?id=cc.b2c_using_dynamic_customer_groups_for_active_merchandising.htm&release=264.0.0&type=5 "Dynamic customer groups enable you to create customer segments for targeted campaigns, micro-sites, and product lines.")

[Creating a Dynamic Customer Group](https://help.salesforce.com/s/articleView?id=cc.b2c_creating_a_dynamic_customer_group.htm&release=264.0.0&type=5 "A dynamic customer group is a group with changing membership. Membership is based on purchase history, profile, address, or active data. You can also base membership on membership in system and static customer groups. You can't base membership on dynamic customer groups.")

#### See Also

- [Create a Dynamic Customer Group in B2C Commerce (Video)](https://salesforce.vidyard.com/watch/zwGd7j2pQzjTbdpkjTRDwW)