get() function to send identification requests to Fingerprint and get the browser’s visitor ID.
If you are just getting started with Fingerprint, we recommend reading the following guides first:
If you encountered errors using the JavaScript agent, see the Error handling reference.
get() options
extendedResult
Required: noTwo types of responses are supported: default and extended. You don’t need to pass any parameters to get the default response. Extended result format includes geolocation, incognito mode, and other information. It can be requested by setting the
Default:false
Type:boolean
extendedResult parameter to true. See more details about the responses, see get() response.
products
Required: noAs of JS Agent version 3.9.3, this option has been deprecated and will likely be removed in the next major version. You can enable or disable Fingerprint products that will handle this request. Using this option does not affect billing in any way.
Default: (depends on the API key)
Type:string[]
Since: v3.7.0
linkedId
Required: no
Default:undefined
Type:string
Constraint: the number of characters must not exceed 256
linkedId is a way of linking the current analysis event with a custom identifier. This will allow you to filter visit information when using the Server API.
JavaScript
linkedId is not available on the client when the event happens, it is possible to set it through our Update Event Server API.
To learn more about tag and linkedId use cases, see Linking and tagging information.
tag
Required: no
Default:undefined
Type: any simple value or an object (not arrays)
Constraint: the size must not exceed 16KB
tag is a customer-provided value or an object that is saved with the identification event and returned back to you in a webhook message or Server API response. You can use tag to associate the visit event with other information you have about the visitor.
You can use any simple value (string, number, boolean) or an object. An object is saved as provided. A simple value (for example 123) is returned wrapped in an object like this: { "tag": 123 }.
Examples of using the tag option:
JavaScript
JSON
tag is not available on the client when the event happens, it is possible to set it through our Update Event Server API.
To learn more about tag and linkedId use cases, see Linking and tagging information.
timeout
Required: noClient timeout controls the total time (both client-side and server-side) that any analysis event can run. It doesn’t include the time when the page is in the background (not visible) because the browser may suspend the analysis process during that time. By default, it’s 10 seconds. You can set the client-side timeout in milliseconds using the
Default:10000
Type:number
timeout option. Example usage:
JavaScript
get() response
fp.get() returns a promise that resolves to an object. The object format depends on the extendedResult option. The format summary:
requestId are replaced with default values.
Response fields:
requestId
Required: yesThe request identifier is unique for every request. Use it to request information about a specific identification request from the Server API.
Type:string
visitorId
Required: yesThe browser identifier (or device identifier for mobile platforms) The field will contain an empty string if the visitor can’t be identified, for example, a search bot. If the identification product is disabled, a dummy value is used.
Type:string
visitorFound
Required: yesIf
Type:boolean
true, it means this visitor has already appeared in and identified for your workspace.
If false, it means this is the first time the visitor has appeared in your workspace.
You can use firstSeenAt to get a precise timestamp of the browser’s very first visit to your workspace. On the other hand, lastSeenAt represents this browser’s most recent visit to your workspace.
If the identification product is disabled, a dummy value is used.
confidence
Required: yesA number between 0 and 1 that represents the probability of accurate identification. The higher the number, the higher the chance of the visitor identifier being true. To learn more about how Fingerprint calculates this value, see Understanding your confidence score.
Type:{ score: number, comment?: string }
sealedResult
Required: noSee more details in the Sealed Client Results guide. The field will miss if Sealed Client Results are disabled or unavailable for another reason.
Type:string(base64-encoded binary data)
zeroTrust
Required: noSee more details in the Zero Trust Mode guide.
Type:{ hiddenFields: string[], comment?: string }
incognito
Only whenWhether the visitor is in incognito/private mode. If the identification product is disabled, a dummy value is used.extendedResultistrue
Required: yes
Type: boolean
browserName
Only whenBrowser name. Examples:extendedResultistrue
Required: yes
Type:string
'Safari', 'Chrome'.
If the identification product is disabled, a dummy value is used.
browserVersion
Only whenBrowser version. Example:extendedResultistrue
Required: yes
Type:string
'78.0.3904'.
If the identification product is disabled, a dummy value is used.
device
Only whenDevice. For desktop/laptop devices, the value will be “Other”. Example:extendedResultistrue
Required: yes
Type:string
'Samsung SM-J330F'.
If the identification product is disabled, a dummy value is used.
ip
Only whenIP address. Only IPv4 addresses are returned. If the identification product is disabled, a dummy value is used.extendedResultistrue
Required: yes
Type:string
ipLocation
Only whenThis field is deprecated and will not return a result for workspaces created after January 23rd, 2024. See IP Geolocation for a replacement available in our Smart Signals product. Can be empty for anonymous proxies. The value type:extendedResultistrue
Required: no
Type:Object
TypeScript
os
Only whenOperating system name. Examples:extendedResultistrue
Required: yes
Type:string
'Mac OS X', 'Android'.
If the identification product is disabled, a dummy value is used.
osVersion
Only whenOperating system version. Examples:extendedResultistrue
Required: yes
Type:string
'10.13.6'.
firstSeenAt
Only whenThe very first time a browser appeared in your workspace. See Visitor Footprint Timestamps for more information. If the identification product is disabled, a dummy value is used.extendedResultistrue
Required: yes
Type:{ subscription: string | null, global: string | null }
lastSeenAt
Only whenThe most recent instance (i.e. before this request) the browser visited your workspace. See Visitor Footprint Timestamps for more information. If the identification product is disabled, a dummy value is used.extendedResultistrue
Required: yes
Type:{ subscription: string | null, global: string | null }