<Place for badges>
Adapter for FingerprintJS Pro JS agent to use in Google Tag Manager (GTM) template. GTM uses javascript subset that doesn't support Pomises and this is the reason for this library.
Example of usage
TODO: add link to GTM template when it will be ready
In GTM template use code like this:
const injectScript = require('injectScript');
const callInWindow = require('callInWindow');
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);
};
const onFailure = () => {
data.gtmOnFailure();
};
injectScript(url, onSuccess, onFailure);