The JavaScript snippet tracks user interactions with your website and collects device information.
Insert this JavaScript snippet at the bottom of your webpage:
<script type="text/javascript"
src="https://securegtm.despegar.com/risk/fingerprint/statics/track-min.js"
id="deviceId_fp" org_id="{org_id}"></script>
Parameter | Type | Description |
---|---|---|
id | Required | Identifier associated with the anti-fraud integration and that is used by the script that is downloaded. |
orgId | Required | Identifier of the organization its using the service (Provider by Koin) |
With Business Session Identifier
In case you have your own session identifier at the moment of inserting the script, you can specify it as an extra attribute in the javascript snippet shown below. In fraud or payments integration we need to receive that value (session identifier) in the api call.
<script type="text/javascript"
src="https://securegtm.despegar.com/risk/fingerprint/statics/track-min.js"
id="deviceId_fp" org_id="{org_id}" session_id="{session_id}"></script>
Otherwise, if you don't have the session identifier when you insert the javascript snippet, the script has an available global method (setSessionID) which receives an argument sessionId to be used.
(Important! To execute this global method it is necessary that the script is loaded to guarantee that the global function is available)
Without Business Session Identifier
In case there is no business session identifier, the script has an available global method (getSessionID) which receives an argument function callback, this invokes the device fingerprinting functions and returns the generated session identifier to the callback function. In fraud or payments integration we need to receive that value in the api call.
getSessionID(function (sessionId) {
// Capture sessionId to later send in API calls
});
Content Security Policy (CSP)
If you have a Content Security Policy on your website, it can block the JS agent. CSP directives give you control over which domains can load specific types of resources therefore add the directives to your policy to unblock the JS agent.