Analytics

The SDK offers a callback function that you can implement, which the SDK will then use to send events.

onTrace: (trace) => {
  console.debug("trace callback function ", trace);
}

Trace is the object passed to your callback function and you can use it with any of your analytics tools or any custom tracing mechanism.

Trace is the object passed to your callback function and has the following properties (see index.d.ts of the SDK module for details):

Property
Type
Optional
Default
Description

deviceIdentifier

String

No

None

This value uniquely identifies multiple sessions from a given device (persisting until browser local storage is cleared)

sessionId

String

No

None

Session id (UUID v4) created by the SDK or passed by your application

category

TraceCategory

No

None

See below

event

TraceEvent

No

None

See below

status

TraceStatus

No

None

See below

page

TracePage

Yes

null

See below

statusCode

TraceStatusCode

Yes

null

See below

statusMessage

String

Yes

null

Description of the status code if any

documentType

DocumentType

Yes

null

Document type

timestamp

Date

No

Timestamp of the event

Timestamp of the event

TraceCategory has the following properties:

Property
Type
Description

ENROLLMENT

Enum String

For events related to the enrollment flow

FACE_SESSION

Enum String

For events related to the face session flow

TraceEvent has following properties:

Property
Type
Description

VIEW

Enum String

Event when a screen is presented to the user. Can be used to track the screen sessions.

START

Enum String

Event when a certain process starts, e.g. scanning of a document starts

IN_PROGRESS

Enum String

Event during document scanning and facial recognition

COMPLETE

Enum String

Event when any process completes, e.g. scanning of a document completes

SKIP

Enum String

Event when a specific step is skipped. Only available in the background check step when the view is enabled, consent is enabled the the enduser declines the consent

FINISH

Enum String

Event when the overall flow is terminated

TraceStatus has the following parameters:

Property
Type
Description

SUCCESS

Enum String

Status when an event is successful

FAILURE

Enum String

Status when an event is not successful

TracePage has following properties:

Property
Type
Description

SCAN

Enum String

Document scanning page

FACE

Enum String

Facial recognition page

BACKGROUND_CHECK

Enum String

Background check page

TraceStatusCode has the following properties:

Note: Please be aware that all codes with event IN_PROGRESS, except for SCAN_DOCUMENT_FRONT_PROCESSED and SCAN_DOCUMENT_BACK_PROCESSED, are throttled (limited to one identical event every 5 seconds). This is to ensure that your client is not overwhelmed and to accommodate varying speeds of different devices, which may send different numbers of events.

Property
Type
Description

USER_CANCEL

Enum String

Status defined when user cancels the flow, or user declines the background check or users stops the chip reading process (only iOS)

SESSION_EXPIRED

Enum String

Flow terminates because the session expires, e.g. auth token not valid anymore

UNEXPECTED_ERROR

Enum String

Flow terminates because of an unexpected error

SCAN_DOCUMENT_FRONT_BACK_MISMATCH

Enum String

When scanning fails because the front and back of the document don’t match, e.g. emirates id number in the front doesn’t match the id in the MRZ in the back page.

SCAN_DOCUMENT_NOT_RECOGNIZED

Enum String

When scanning fails because either the wrong document type is selected or not able to read data due to lighting conditions.

SCAN_DOCUMENT_EXPIRED

Enum String

When scanning an expired document

SCAN_DOCUMENT_FRONT_PROCESSED

Enum String

Front of the document was successfully scanned

SCAN_DOCUMENT_BACK_PROCESSED

Enum String

Back of the document was successfully scanned

SCAN_DOCUMENT_AGE_VERIFICATION_FAILED

Enum String

When age is below the one defined in the configuration

FACE_LIVENESS_FAILED

Enum String

When liveness detection fails during facial recognition

FACE_NO_MATCH

Enum String

When face doesn’t match the picture provided with the document, or from the chip if available, during facial recognition

FACE_RECOGNITION_TOO_MANY_ATTEMPTS

Enum String

Session gets invalidated because of too many failed facial recognition attempts

FACE_INCORRECT_POSITION_DETECTED

Enum String

Incorrect face position detected

FACE_INCORRECT_DISTANCE_DETECTED

Enum String

Incorrect face distance detected

FACE_EYES_CLOSED_DETECTED

Enum String

Eyes closed detected

CAMERA_NOT_AVAILABLE

Enum String

Session gets invalidated because the camera is not available

CAMERA_PERMISSION_NOT_GRANTED

Enum String

Session gets invalidated because camera the end user denies camera access

MEDIA_VIRTUAL_CAMERA_DETECTED

Enum String

Session gets invalidated because virtual camera usage was detected

Note: The status codes listed below are available only from SDK 4.x and above

Property
Type
Description

SCAN_DOCUMENT_DARK_ENVIRONMENT_DETECTED

Enum String

Dark environment detected

SCAN_DOCUMENT_INCORRECT_DISTANCE_DETECTED

Enum String

Incorrect distance detected between the camera and the document

SCAN_DOCUMENT_INCORRECT_POSITION_DETECTED

Enum String

Incorrect position detected, e.g. document positioned too on the top or the bottom of the screen

SCAN_DOCUMENT_BLUR_DETECTED

Enum String

Blur or noisy image detected

SCAN_DOCUMENT_INCORRECT_TYPE_DETECTED

Enum String

Incorrect document type dected, e.g. presenting another document type

SCAN_DOCUMENT_INCORRECT_SIDE_DETECTED

Enum String

Incorrect document side dected, e.g. presenting the back of the document instead of the front side

SCAN_DOCUMENT_GLARE_DETECTED

Enum String

Reflections detected on the document

SCAN_DOCUMENT_ID_PHOTO_BAD_QUALITY_DETECTED

Enum String

ID photo on the document is not clear

SCAN_DOCUMENT_FINGER_DETECTED

Enum String

Fingers are obstructing the document

FACE_MULTIPLE_FACES_DETECTED

Enum String

Multiple faces detected during facial recognition

FACE_INCORRECT_DISTANCE_DETECTED

Enum String

Incorrect face distance detected

FACE_INCORRECT_POSITION_DETECTED

Enum String

Incorrect face position detected

FACE_DARK_ENVIRONMENT_DETECTED

Enum String

Dark environment detected

FACE_BLUR_DETECTED

Enum String

Blur or noisy image detected

FACE_MOUTH_COVER_DETECTED

Enum String

Mouth covered detected

FACE_EYES_COVER_DETECTED

Enum String

Eyes covered detected

FACE_EYES_CLOSED_DETECTED

Enum String

Eyes closed detected

FACE_SPOTLIGHT_DETECTED

Enum String

Bright spotlight on the face detected

FACE_SHADOW_DETECTED

Enum String

Shadow on the face detected

FACE_EYES_SHADOW_DETECTED

Enum String

Shadow on the eyes detected

VIDEO_PLAYS_INLINE_DISABLED

Enum String

It’s returned when HTML5 videos default to the native full-screen player instead of playing inline, something that only occurs when the SDK is embedded in an iOS WebView with allowsInlineMediaPlayback set to false. This status code helps you identify and correct your WebView settings

Last updated

Was this helpful?