Customer Grouping

A Customer in Embermind represents a unique user, identified by combining transaction attributes. The system automatically groups transactions belonging to the same person.

Overview

Customer grouping can be based on the following attributes:

AttributeDescription
External IDYour internal customer identifier
EmailCustomer email address
PhoneCustomer phone number
Card TokenTokenized card identifier
FingerprintBrowser fingerprint
IP AddressCustomer IP address

Example: If grouping by email is enabled and two transactions share the same email address, they will be merged into a single customer profile — even if other fields (phone, card, etc.) differ.

Configuration Methods

Customer grouping settings can be configured:


API Configuration

Request Parameters

ParameterTypeRequiredDescription
isCompanyCustomerGroupByExternalIdbooleanNoEnable grouping by external identifier
companyCustomerGroupByExternalIdRegExpstringNoRegex to validate external identifier
isCompanyCustomerGroupByEmailbooleanNoEnable grouping by email
companyCustomerGroupByEmailRegExpstringNoRegex to validate email
isCompanyCustomerGroupByPhonebooleanNoEnable grouping by phone
companyCustomerGroupByPhoneRegExpstringNoRegex to validate phone
isCompanyCustomerGroupByCardTokenbooleanNoEnable grouping by card token
companyCustomerGroupByCardTokenRegExpstringNoRegex to validate card token
isCompanyCustomerGroupByFingerpintbooleanNoEnable grouping by fingerprint
companyCustomerGroupByFingerpintRegExpstringNoRegex to validate fingerprint
isCompanyCustomerGroupByIpAddressbooleanNoEnable grouping by IP address
companyCustomerGroupByIpAddressRegExpstringNoRegex to validate IP address
badScoreBordernumberNoBad score border threshold
fingerprintUseTypestringNoFingerprint type. Values: CLIENT / INTERNAL / EXTERNAL

Example Request

curl -X POST 'https://api.embermind.ch/api/v1/client/company-settings/update' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: YOUR_API_KEY' \
  -d '{
    "isCompanyCustomerGroupByExternalId": true,
    "companyCustomerGroupByExternalIdRegExp": null,
    "isCompanyCustomerGroupByEmail": true,
    "companyCustomerGroupByEmailRegExp": null,
    "isCompanyCustomerGroupByPhone": true,
    "companyCustomerGroupByPhoneRegExp": null,
    "isCompanyCustomerGroupByCardToken": true,
    "companyCustomerGroupByCardTokenRegExp": null,
    "isCompanyCustomerGroupByFingerpint": true,
    "companyCustomerGroupByFingerpintRegExp": null,
    "isCompanyCustomerGroupByIpAddress": false,
    "companyCustomerGroupByIpAddressRegExp": null,
    "badScoreBorder": 50,
    "fingerprintUseType": "CLIENT"
  }'

Response (200 OK)

{
  "message": "OK"
}

Regex Validation

Each grouping attribute can be validated using a regular expression. If a value doesn't match the regex pattern, grouping by that attribute will be skipped.

Example: Only group by emails from specific domains:

curl -X POST 'https://api.embermind.ch/api/v1/client/company-settings/update' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: YOUR_API_KEY' \
  -d '{
    "isCompanyCustomerGroupByEmail": true,
    "companyCustomerGroupByEmailRegExp": "^[a-zA-Z0-9._%+-]+@(gmail\\.com|yahoo\\.com)$"
  }'

Important Notes

  • If all grouping attributes are disabled, customers will not be merged — each transaction will create a separate customer.
  • Grouping is performed at transaction creation time. Changing settings does not retroactively regroup existing customers.
  • IP address grouping is disabled by default because many users may share the same IP (e.g., corporate networks, mobile carriers).

Fingerprint Use Type

ValueDescription
CLIENTUse the fingerprint field sent in transaction request
INTERNALUse Embermind's internally collected fingerprint
EXTERNALUse fingerprint from external provider (e.g., FingerprintJS Pro)

Next Steps