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

@funnelsgrove/analytics

v0.1.65

Published

Shared analytics package for public funnels.

Readme

@funnelsgrove/analytics

Shared analytics package for public funnels.

Read this file before editing analytics code. Deeper runtime SDK docs live in docs/funnel-sdk/analytics-sdk.md.

Owns event identity and delivery

@funnelsgrove/analytics owns the browser identity, event-shaping, and delivery contract for public funnel analytics. Funnel code may decide when a business event happened, but this package decides how that event becomes a normalized SDK/PostHog/partner payload.

Use This Package For

  • browser user-id persistence
  • SDK user bootstrap for public funnel identity
  • public analytics event batching and transport
  • identify, track, step lifecycle, and checkout event helpers
  • Stripe purchase metadata shaping before payment metadata reaches the API
  • Google Tag and Meta Pixel event adapters
  • local-only no-op behavior when a real publishable key is not configured

Do Not Use This Package For

  • step routing
  • manifest logic
  • checkout orchestration
  • billing plan resolution
  • Stripe checkout UI
  • funnel-specific step components or copy

Public Surfaces

  • publicAnalyticsSdk: the canonical browser SDK for identify, track, lifecycle, checkout, and flush calls.
  • bootstrapPublicAnalyticsUser: public SDK identity bootstrap helper.
  • sdk-user-id.storage: shared browser user-id storage contract.
  • buildStripePurchaseMetadata and purchase attribute helpers: safe metadata shaping for payment handoff.
  • trackStripePaymentCheckoutReturn: parses and deduplicates Stripe browser-return diagnostics without claiming a purchase conversion.
  • google-tag.service and meta-pixel.service: partner event adapters.
  • experiment-result-metrics.service: shared experiment result metric helpers.

Engineering Rules

  • Keep transport details here; do not duplicate event batching in funnels.
  • Keep provider adapters dumb: they map canonical events, not funnel business flow.
  • Do not import payment UI or runtime routing from this package.
  • Sensitive values must be filtered before metadata reaches Stripe or partner tools.
  • A Stripe browser return is diagnostic state only. Use trackStripePaymentCheckoutReturn; never turn query parameters into checkout_completed or trusted purchase_completed.

Google Tag Configuration

NEXT_PUBLIC_GOOGLE_ANALYTICS_ID and NEXT_PUBLIC_GOOGLE_TAG_MANAGER_ID configure which Google tags load. Google Ads conversion actions also need the full send_to destination, such as AW-123456789/ConversionLabel.

  • NEXT_PUBLIC_GOOGLE_TAG_LEAD_SEND_TO sends an Ads conversion event when the SDK records a lead/email capture.
  • NEXT_PUBLIC_GOOGLE_TAG_LEAD_VALUE sets the numeric value for the lead Ads conversion. Empty or invalid values default to 0.
  • NEXT_PUBLIC_GOOGLE_TAG_PURCHASE_SEND_TO sends an Ads conversion event when the SDK records a paid checkout completion.

Ads conversion values only fire when NEXT_PUBLIC_GOOGLE_TAG_ENABLED=true. The AW-... prefix is used to load and configure gtag.js; the full AW-.../... value is sent on the conversion event.

Build, Test, Publish

npm run test:run --workspace @funnelsgrove/analytics
npm run build --workspace @funnelsgrove/analytics
npm publish --workspace @funnelsgrove/analytics --access public

The build normalizes generated relative ESM imports to explicit .js files for published package consumers.