Embed the JavaScript tag
Add the JavaScript tag to a web page so the browser builds a fingerprint of the device and sends it on every request as a session cookie.
The JavaScript tag (JS TAG) is a browser-level script that you add to a web page. It captures data about the browser, builds a unique identifier from that data, and sets the identifier as a session cookie named _azfp_sc. The browser sends cookies in every request it makes, so the identifier reaches your application with each one.
The script runs on the page you want to fingerprint, a process also known as JavaScript injection. It captures the following data from the browser:
- Audio and video support.
- Canvas rendering.
- Access to device-level APIs, such as the accelerometer and the gyroscope.
- Manufacturer’s data.
- Timezone.
- WebGL rendering.
Before it creates a cookie, the script checks whether _azfp_sc already exists. If it does, the script creates no new one.
Prerequisites
- Access to the HTML source of the web page you want to fingerprint.
- To serve your own copy of the script, a project folder that your domain serves.
Embed the script
Azion provides the script as a file that you can load from your HTML source. To load it from Azion, add this element to your HTML source:
You can also serve your own copy of the script. To do so:
Copy the code in the script file.
In this example, the file name is fingerprint-script.js.
Add this element to your HTML source:
Replace the values in the element as follows:
| Value | Replace with |
|---|---|
https://example.com/ | Your domain. |
fingerprint-script.js | Your JavaScript file name. |
The script then sets the _azfp_sc session cookie in each browser that loads the page.