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-advertising

v1.1.0

Published

PmeWeb advertising plugin: the Meta pixel and Google Tag Manager, loaded only after the visitor grants « Publicité » in the @pmeweb/consent card.

Readme

@pmeweb/plugin-advertising

The Meta pixel and Google Tag Manager for a PmeWeb site, loaded only after the visitor grants « Publicité » (the advertising purpose) in the @pmeweb/consent card. Replaces the Meta and GTM parts of phase 1's @pmeweb/plugin-consent. GTM belongs here, not with audience measurement, because a container can load anything: it takes the strictest purpose.

  • Installed and inactive by default. Listed in pmeweb.json plugins with neither meta nor gtm, it renders nothing, and @pmeweb/consent builds no card for it.
  • Nothing in the page but one « use » tag. <Advertising> renders <script type="application/json" data-pmw-consent-use> with the ids that are set and the URL of dist/load.js. Once the purpose is granted, the decider of @pmeweb/consent pushes ad_storage, ad_user_data and ad_personalization as granted, imports the module and calls load({ meta, gtm }): the Meta pixel bootstrap (init and PageView) and/or the GTM container (gtm.start, gtm.js). No inline code (inlineBudget: 0), nothing at page open, nothing off the site's real hosts.

Config (pmeweb.json plugins.advertising)

| Key | Pattern | Meaning | |---|---|---| | meta | ^[0-9]{15,16}$ | The Meta pixel id. | | gtm | ^GTM-[A-Z0-9]+$ | The Google Tag Manager container id. Set by PmeWeb only, for good (phase 4 never makes it client-editable). |

Either one makes the plugin active.

The client sets meta in the portal, « Contenu › Modules › Publicité » (manifest portal.config, plugin system phase 4): a change is a draft that ships with « Publier ». gtm is shown there read-only; it stays with PmeWeb.

GTM: what the operator checks before setting gtm

A container can load anything, and neither this package nor the gate can see inside it.

  • The privacy text must describe the container. The gtm paragraphs say the container loads Google Ads: conversion measurement, remarketing, and enhanced conversions from the hashed email typed into the site's forms. That is what the one site with a container (gestion-reno) does. A container that does something else (another vendor, no enhanced conversions) needs this text changed in a release first, never a site-side edit.
  • One source of GA4. The container must not configure the GA4 id that @pmeweb/plugin-audience loads: every page view would count twice, and that tag would run under « Publicité » instead of « Mesure d’audience ». Remove that tag from the container.
  • A tag added inside the container may need a CSP host this package does not list (Google Ads needs www.googleadservices.com, *.doubleclick.net, www.google.com; CallTrackingMetrics *.tctm.co, *.calltrackingmetrics.com). That is a site change (the site worker's own directives), and a vendor loaded that way is still named on the site's privacy page by the site.

Privacy

privacy/fr.json and privacy/en.json: { heading, paragraphs, byKey: { meta, gtm } }. <PluginPrivacy> of @pmeweb/consent renders paragraphs, then byKey[k] for each key set, 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. Providers: Meta and Google, both outside Quebec (manifest.json privacy.providers). Meta's cookie lifetimes are not stated: the text points to Meta's own policy instead.

CSP

cspHosts({ meta, gtm }) from @pmeweb/plugin-advertising/csp, per key set: meta needs connect.facebook.net (script) and www.facebook.com (img, connect); gtm needs www.googletagmanager.com (script, frame, img, connect), *.google-analytics.com, *.analytics.google.com and *.g.doubleclick.net. {} when inactive.

Check after a deploy

@pmeweb/consent's README « Check after a deploy », advertising case: nothing before answering; after a grant, fbevents.js and/or gtm.js go out, and dataLayer holds consent update with ad_storage, ad_user_data and ad_personalization granted.