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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@d8a-tech/wt

v0.28.0

Published

The d8a web tracker provides a GA4 gtag-style API that sends GA4 gtag-compatible requests directly to a d8a collector.

Readme

Web tracker

The d8a web tracker provides a GA4 gtag-style API that sends GA4 gtag-compatible requests directly to a d8a collector.

Installation (script tag)

The script-tag bundle auto-installs on load and supports optional src query parameters:

  • ?l=<name>: d8a queue name (data layer)
  • ?g=<name>: d8a global function name
  • ?gl=<name>: gtag/GTM consent queue name (defaults to dataLayer)
<script async src="https://cdn.jsdelivr.net/npm/@d8a-tech/wt/dist/wt.min.js"></script>
<script>
  window.d8aLayer = window.d8aLayer || [];
  window.d8a = window.d8a || function(){d8aLayer.push(arguments);};

  d8a("js", new Date());
  d8a("config", "<property_id>", {
    server_container_url: "https://example.org/d/c",
  });
</script>

Installation (npm module)

npm install @d8a-tech/wt
import { installD8a } from "@d8a-tech/wt";

// Optional overrides:
// - dataLayerName: d8a queue name (defaults to "d8aLayer")
// - globalName: d8a global function name (defaults to "d8a")
// - gtagDataLayerName: gtag/GTM consent queue name (defaults to "dataLayer")
installD8a();

const d8a = window.d8a;
if (!d8a) throw new Error("d8a is not installed");

d8a("js", new Date());
d8a("config", "<property_id>", {
  server_container_url: "https://global.t.d8a.tech/<property_id>/d/c",
});

Configuration precedence

When the same key is provided in multiple places, we resolve values as:

  • Event params > config params > set params > browser defaults

Development

  • Runtime source is ESM JavaScript in src/ and types are shipped in index.d.ts.
  • Tests use tsx (Node test runner compatibility):
cd js/web-tracker
npm test

Production build

This package can produce a single browser bundle:

  • dist/wt.min.js: Script-tag bundle (auto-installs on load)
  • dist/index.min.mjs: ESM bundle

Build:

cd js/web-tracker
npm install
npm run build

Examples (dev vs prod)

The example/ directory contains two pages to quickly validate behavior in a browser:

  • example/index.html: dev/local setup (served by Vite; imports from ../src/ and calls installD8a()).
  • example/prod.html: production-like setup (loads ../dist/wt.min.js, which auto-installs on load).

Dev example (no build step)

Run:

cd js/web-tracker
npm install
npm run dev

Then open the printed URL (Vite will serve example/index.html as /).

Prod-like example (requires build)

Run:

cd js/web-tracker
npm install
npm run build
python3 -m http.server 8080

Then open:

  • http://127.0.0.1:8080/example/prod.html