Google Tag Manager
Why use Fingerprint Pro with Google Tag Manager
Google Tag Manager is a tag management system that allows you to quickly and easily update code fragments collectively known as tags on your website. It is a no-code solution for professionals managing features on their websites. FingerprintJS Pro GTM is an open-source tag that can be imported to the GTM manually.
All standard capabilities provided by the FingerprintJS Pro JavaScript agent can be performed with this tag. The tag pushes data to the GTM's data layer which can be processed by other tags or by custom website JavaScript.
Sample usage
This scenario describes adding the Fingerprint Pro tag into your GTM container, and its configuration.
-
Import the template from the open-source repository.
-
Configure FingerprintJS Pro tag. Enter your
public API key
,region
, andendpoint
.

- In the Additional fields section, you can optionally configure the
tag
,linkedId
, and the Result custom name for theresult
object. Result custom name represents theresult
object in the dataLayer. You can also specify the extended result (the standard result is the default).

- In the Triggering section add a new Firing Trigger e.g. Initialization.

How to use Fingerprint Pro result in custom JavaScript code
Fingerprint Pro's data can be accessed through the GTM's dataLayer
API in your custom JavaScript code. It's important to check if the result data (specified by the Result custom name) has been already obtained, first.
window.dataLayer.push(function () {
if (this.get("FingerprintJSProResult")) { // Make sure the page has already received result data
const result = this.get("FingerprintJSProResult");
console.log(JSON.stringify(result)); // Use FingerprintJS Pro result
}
});
How to use Fingerprint Pro result in a custom variable
Every piece of information provided in the result
object can be exposed as a user-defined variable. Furthermore, it can be used in the configuration fields of other tags. For example, you can reuse the firstSeenAt
timestamp in the metadata in a 3rd party tag.
Note: To expose the firstSeenAt
property, you need to select Extended result in the Fingerprint Pro tag configuration.
-
In the GTM dashboard, go to the Variables section, and create a new user-defined variable. Select the Data Layer Variable type.
-
Enter
FirstSeenAt
as a variable name and specify the Data Layer Variable Name likeFingerprintJSProResult.firstSeenAt.global
. The dataLayer properties format follows the result's properties provided by the JavaScript agent. Save changes.

- Now you can use the
{{FirstSeenAt}}
macro in the tag's settings within your container. The tag needs to wait for theresult
data. Add a new Trigger to the 3rd party tag. In the tag's configuration, add a new Firing Trigger, choose Custom Event, and enterFingerprintJSPro.loaded
Event name.

Documentation
You can find the full documentation in the official GitHub repository.
Limitations
Some advanced JavaScript agent properties (tlsEndpoint
, disableTls
, storageKey
, and scriptUrlPattern
) are not currently supported. If you require to use these features in the GTM, please contact support.
Ad-blocking browser extensions such as AdBlock, uBlock Origin, etc., can block all scripts served by Google Tag Manager, including Fingerprint. If this is a problem for your use case, see Google Tag Manager documentation for Server-side tagging and Custom domain configuration.
Updated 15 days ago