npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@fingerprintjs/fingerprintjs-pro-gtm

v1.0.0

Published

FingerprintJS pro version adapter for Google Tag Manager

Downloads

8,933

Readme

Repository content

  1. FingerprintJS Pro Google Tag Manager template
  2. FingerprintJS Pro adapter for Google Tag Manager

:warning: Work in progress: This is a beta version of the library

FingerprintJS Pro Google Tag Manager template

You can find an example of using this integration on our website

Usage

  1. You should have FingerprintJS account
  2. Add FingerprintJS Pro Tag in your GTM admin panel (you can import it from github repo)
  3. Set up the public API key and choose the region
  4. Use FingerprintJSPro.loaded event to get data from dataLayer. You can create trigger for this event.
  5. Use Result custom name field to change the variable name for the result.

Template Fields

You can find more info on the FingerprintJS Pro agent documentation page https://dev.fingerprint.com/docs/js-agent

Public API key - Your public API key that authenticates the agent with the API.

Region - The region of your subscription.

Endpoint - This parameter should only be used with the Custom subdomain. Specify your custom endpoint here.

tag - a customer-provided value or an object that will be saved together with the identification event and will be returned back to you in a webhook message or when you search for the visit in the server API.

linkedId - is a way of linking current identification event with a custom identifier. This will allow you to filter visit information when using the Server API

Extended result - The response object includes a confidence score field representing the probability of accurate identification. The extended response object also includes several fields with useful timestamps related to a visitor. See more information on firstSeenAt/lastSeenAt timestamps here.

Result custom name - you can specify the result field name in dataLayer

FingerprintJS Pro adapter for Google Tag Manager

Since GTM (Google Tag Manager) uses a subset of JavaScript API that doesn't support Promises, we created this adapter for the FingerprintJS Pro JS agent that can be used in a GTM template.

Adapter code hosted on CDN and accessible via the next URL https://opencdn.fpjs.sh/fingerprintjs-pro-gtm/v0/iife.min.js

More information about CDN you can get in CDN repository

Example of usage

In GTM template we can load FingerprintJS Pro this way:

const injectScript = require('injectScript');
const callInWindow = require('callInWindow');
const url = 'https://opencdn.fpjs.sh/fingerprintjs-pro-gtm/v0/iife.min.js';

const onSuccess = () => {
  const onFpJsLoad = (result) => {
    const dataLayerPush = createQueue('dataLayer');
    dataLayerPush({
      event: 'FingerprintJS.loaded',
      visitorId: result.visitorId
    });
    data.gtmOnSuccess();
  };

  callInWindow('FingerprintjsProGTM.load', {apiKey: data.apiKey}, onFpJsLoad);
};

// If the script fails to load, log a message and signal failure
const onFailure = () => {
  data.gtmOnFailure();
};

injectScript(url, onSuccess, onFailure);

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.