Configuring scanner identifiers for customer profiles
This feature enables the scanner to identify whether the scanned code such as QR code or barcode contains customer information that can be utilized in the customer profile search. When a match is found during the scan, the app navigates to the customer profile search using the value extracted from the code.
The search functionality doesn't support searching within extended attributes.
The supported fields include:
- displayId: Specified by the retailer during imports.
- email: An email ID of the customer.
- fullName: The full name of the customer.
- phoneNumber: An E.164 formatted phone number.
Pre-requisites
The feature is disabled by default. To enable scanner identifiers for your business:
Use the Update app configuration.
Set
release_toggle
>new_customer_profile
totrue
.ImportantEnabling this feature will disrupt any active custom app extensions that you have configured for customer profile screens in the app.
For
customizations
>customer_profile_scanner_identifiers
, add multiple identifier objects containing ascanner_code_type
and a correspondingregex
pattern.noteThe first matching identifier will be used. We recommend you to arrange the identifiers in a hierarchical order, starting with the most precise ones and progressing towards more abstract ones.
After making any changes to the configuration, restart all running apps for the identifiers to take effect.
Scanner code types
To identify the code type, use the following number values:
code type | value |
---|---|
QR | 1 |
Databar | 2 |
Databar Expanded | 4 |
EAN8 | 8 |
EAN13 | 16 |
UPCA | 32 |
UPCE | 64 |
Data Matrix | 128 |
code39 | 256 |
code93 | 512 |
code128 | 1024 |
pdf417 | 2048 |
interleaved 2 of 5 | 4096 |
Regex
The regex patterns support JavaScript syntax.
The first regex group ()
can be used to extract the search string to be used in the profile search.
Do not use regex patterns that match EAN13 codes, such as 2900010002910
. For example, ^[0-9]+$
. Using such patterns will disrupt product scanning functionality.
To avoid regex patterns matching existing identifiers, you can use regex groups with a prefix or suffix, such as email:...
or
Don't use JSON strings in the code values, as they will not work for profile identification.
Don't use values in your codes that match the following reserved regex patterns, as they are intended for identifying other items such as orders or baskets:
/^(.*)\$MGRAPPR$/i
/^(https?:\/\/ .*)\$BASKET$/i
/<open_logistic_order><([\w-]+)>/
Example
The scanner identifiers for customer profiles:
{
"customizations": {
"customer_profile_scanner_identifiers": [
{
"scanner_code_type": 1,
"regex": "^email:(.+@[^\\.].*\\.[a-z]{2,})$"
},
{
"scanner_code_type": 1024,
"regex": "[0-9]{9}"
}
]
}
}
Related topics