@fingerprint/gtm-adapter

中文文档
2.0.0发布于 2026/06/17Apache-2.0ES Module构建来源已验证近 30 天下载 4202

Fingerprint JS agent adapter for Google Tag Manager

原始使用文档
文档目录5 节
  1. Usage
  2. Template Fields
  3. Limitations
  4. Support and Feedback
  5. License

Fingerprint logo

CI status

Fingerprint Google Tag Manager template

This repository contains a Google Tag Manager template you can use to add Fingerprint to your website.

For step-by-step instructions on using this integration, see the full Google Tag Manager guide in the Fingerprint documentation.

Usage

  1. Sign up for a Fingerprint account if you haven't already.
  2. Import this template.tpl from latest release into your Google Tag Manager workspace.
  3. Add a Fingerprint tag to your website. You will need your public API key and workspace region.
  4. Use the FingerprintResult or your own Custom result name to access the Fingerprint result in GTM's dataLayer.
  5. Use the Fingerprint.started and Fingerprint.identified event names to create custom events and trigger actions after the JS agent is loaded or the visitor is identified.

Template Fields

For more information and the full API reference, see Fingerprint JS Agent in our documentation.

Tag type – The way you want to use the tag. There are 3 options:

  • Start and identify – the default behavior. Start the JS agent and identify the browser immediately. If you want to start the JS agent first and identify the browser later based on some event, use two separate Start and Identify Fingerprint tags.
  • Start – only load the JS Agent.
  • Identify – identify the browser. The JS Agent must be started before. You can collect additional metadata data first and then trigger this tag with the metadata inside linkedId or tag.

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

Region - The region of your subscription.

endpoints - This parameter should only be used with the custom subdomain or proxy integrations. Specify the API endpoint URL for those integrations in this field.

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

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

Limitations

Some advanced JavaScript agent properties (storageKeyPrefix and cache) 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.

Support and Feedback

To report problems, ask questions, or provide feedback, please use Issues. If you need private support, you can email us at [email protected].

License

This project is licensed under the Apache 2.0 license.

版本与发布记录

@fingerprint/gtm-adapter 共发布 2 个版本,首次发布于 2026/06/12;过去 12 个月发布了 2 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
2.0.0latest2026/06/174 个月前
2.0.0-test.1test2026/06/125 个月前

关于 @fingerprint/gtm-adapter 的常见问题

@fingerprint/gtm-adapter 是什么?

Fingerprint JS agent adapter for Google Tag Manager

如何安装 @fingerprint/gtm-adapter?

在项目目录运行 npm install @fingerprint/gtm-adapter,或使用 pnpm add / yarn add / bun add。

@fingerprint/gtm-adapter 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/fingerprint__gtm-adapter 是否存在。

@fingerprint/gtm-adapter 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@fingerprint/gtm-adapter 可以商用吗?

@fingerprint/gtm-adapter 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@fingerprint/gtm-adapter 的下载量有多少?

根据 npm 官方下载统计,@fingerprint/gtm-adapter 在 2026/10/15 – 2026/11/13 这 30 天内被下载 4,202 次,日均约 140 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@fingerprint/gtm-adapter 还在维护吗?

最新版本 2.0.0 发布于 2026/06/17(4 个月前);至今共发布 2 个版本,其中过去 12 个月发布了 2 个;首次发布于 2026/06/12。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。