Device Fingerprint is an identifier that acts in payment processing to improve fraud risk analysis.
By collecting non-sensitive data, Device Fingerprint identifies and analyzes the security level of the device used to perform a given transaction. It also analyzes transactions previously performed with that device.
Each store must have only one Device Fingerprint registered. Check if you have already registered the Device Fingerprint in another connector, before proceeding with the steps below.
This article will explain how to associate the Device Fingerprint feature with the Niubiz affiliation.
This requires generating an identifier using Google Tag Manager and then associating it to the affiliation via the Admin.
Creating the identifier
This step may be outdated as it is performed in an external environment.
First, you need to create the identifier.
Follow these instructions:
- Log in to your Google Tag Manager account.
- From the left-nav menu, select the__ Tags tab and click on new__.
- Then click on Tag configuration.
- From the right-nav tag type menu, select the "Custom HTML" option.
- Fill in the HTML field with the following javascript code.
<script>window.vtex.deviceFingerprint = getuuid() ;console.log('fingerprint: '+window.vtex.deviceFingerprint);initDFP(window.vtex.deviceFingerprint);var localSessionId = null;function doProfile(orgId, sessionId, hostname){console.log('Starting profile using ' + hostname + ' for orgId ' + orgId + ' with sessionId ' + sessionId + ' on ' + Math.floor(Date.now() / 1000));var head = document.getElementsByTagName("head").item(0);var url = "https://" + hostname + "/tags.js?org_id=" + orgId + "&session_id=" + sessionId + "&page_id=1&allow_reprofile=1";console.log(url);var script = document.createElement("script");script.setAttribute("type", "text/javascript");script.setAttribute("src", url);head.appendChild(script); console.log('Profile should have started...');body = document.getElementsByTagName("body").item(0);noscript = document.createElement("noscript");iframe = document.createElement("iframe");iframe.setAttribute("style", "width: 100px; height: 100px; border: 0; position:absolute; top: -5000px;");iframe.setAttribute("src", url);noscript.appendChild(iframe);body.insertBefore(noscript, body.childNodes[0]);}function initDFP(sessionId) {localSessionId = sessionId;console.log('Init profiling ', Math.floor(Date.now() / 1000))var timeout = 3000;var sasOrgId = "507f9ifk";var csOrgId = "1snn5n9w";var merchantId = "vndp";var hostname = "h.online-metrix.net/fp";doProfile(sasOrgId, sessionId, "m.vnforapps.com");setTimeout(startOnTimer(sessionId) , timeout); }function startOnTimer(sessionId) {var csOrgId = "1snn5n9w";var merchantId = "vndp";var hostname = "h.online-metrix.net/fp";doProfile(csOrgId, merchantId + sessionId, hostname); }function getuuid() {var dt=new Date().getTime();var uuid='xxxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g,function(c){var r = (dt + Math.random()*16)%16 | 0;dt = Math.floor(dt/16);return (c=='x' ? r : (r&0x3|0x8)).toString(16);});return uuid;}function tmx_profiling_complete(sessionId) {console.log('Finished ', sessionId, '-', Math.floor(Date.now() / 1000));}</script>
- In the "Advanced settings" section, leave the values empty.
- Click on Triggers.
- Choose the "Custom event" option.
- Fill in the "Event name" field with the value ".*"
- Check the "Use regex matching" box.
- Under "This trigger fires on", click on the "Some custom events" option.
- Save and publish the settings.
Google Tag Manager will then create the identifier.
Please write down the ID in a place you can easily find it.
Configuration in the VTEX Admin
With the ID in hand, you must link it with the Niubiz affiliation in the Admin.
Follow the step by step instructions below:
- In the VTEX Admin, go to Store Settings > Storefront > Checkout, or type Checkout in the search bar at the top of the page.
- In the "Default" configuration box, click on the blue gear button.
- On top of the page, select the "Checkout" tab.
- Fill in the "Google Tag Manager" field with the newly generated ID.
- Save your changes.