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

@pmeweb/plugin-audience

v1.1.0

Published

PmeWeb audience plugin: Google Analytics 4, loaded only after the visitor grants « Mesure d’audience » in the @pmeweb/consent card.

Readme

@pmeweb/plugin-audience

Google Analytics 4 for a PmeWeb site, loaded only after the visitor grants « Mesure d’audience » (the analytics purpose) in the @pmeweb/consent card. Replaces the GA4 part of phase 1's @pmeweb/plugin-consent.

  • Installed and inactive by default. Listed in pmeweb.json plugins with no ga4, it renders nothing, and @pmeweb/consent builds no card for it. Setting ga4 turns it on.
  • Nothing in the page but one « use » tag. <Audience> renders <script type="application/json" data-pmw-consent-use> with the public id and the URL of dist/load.js. The decider of @pmeweb/consent imports that module once the purpose is granted (after load and an idle moment on a page still loading, at once on a click) and calls load({ ga4 }), which adds gtag.js and configures the property. No inline code (inlineBudget: 0), nothing at page open, nothing off the site's real hosts.
  • Measurement only. The decider grants analytics_storage for this purpose; nothing here grants an ad_* signal, so Google Signals and Ads linking get no consent from it. Using GA4 for advertising is a decision for when a client asks, not a setting.

Config (pmeweb.json plugins.audience)

| Key | Pattern | Meaning | |---|---|---| | ga4 | ^G-[A-Z0-9]+$ | The GA4 measurement id. Its presence is what makes the plugin active. | | ga4Retention | 2 or 14 | Months GA4 keeps event data, as set in the client's GA4 property: Administration > Collecte et modification des données > Conservation des données (default: 2 months). Required with ga4 (requiredWith, checked by check-plugins); it fills {ga4Retention} in the privacy text. |

Read the retention in the property itself, or ask the client; never assume the default.

The client sets both in the portal, « Contenu › Modules › Mesure d’audience » (manifest portal.config, plugin system phase 4): a change is a draft that ships with « Publier ».

One source of GA4

If the site also has a Google Tag Manager container (@pmeweb/plugin-advertising), that container must NOT configure the same GA4 id: every page view would count twice, and the GA4 tag inside GTM would run under the advertising purpose instead of analytics. The operator removes that tag from the container; this plugin is the one source of GA4.

Privacy

privacy/fr.json and privacy/en.json ({ heading, paragraphs }), rendered by <PluginPrivacy> of @pmeweb/consent on the site's privacy page when the plugin is active. The text is the package's, approved once by the operator, identical on every site; a site never edits it. Provider: Google, outside Quebec (manifest.json privacy.providers).

CSP

cspHosts({ ga4 }) from @pmeweb/plugin-audience/csp: www.googletagmanager.com (script, img, connect), *.google-analytics.com and *.analytics.google.com (img, connect). {} when inactive.

Check after a deploy

@pmeweb/consent's README « Check after a deploy », analytics case: nothing before answering; after « Accepter » (or « Personnaliser » with only « Mesure d’audience »), gtag/js goes out, _ga appears, and dataLayer holds consent update with analytics_storage: granted and no ad_* granted.