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

@breadstone/ziegel-platform-analytics

v0.0.9

Published

Includes analytics functionalities. The analytics data can be push to the given provider. This package includes contains providers. (e.g. google analytics)

Downloads

2

Readme

@breadstone/ziegel-platform-analytics

MIT License TypeScript npm

Analytics and tracking infrastructure for the ziegel platform. Provides analytics managers, multiple analytics providers (Google Analytics, etc.), data sanitization, and tracking utilities for enterprise applications.

Analytics: Enterprise analytics with multiple providers, data sanitization, and comprehensive tracking capabilities.

🚀 Overview

@breadstone/ziegel-platform-analytics provides:

  • Analytics Manager: Centralized analytics tracking and management
  • Multiple Providers: Support for Google Analytics, custom providers, and callback-based tracking
  • Data Sanitization: Configurable data sanitization and privacy protection
  • Provider Architecture: Extensible provider system for different analytics services
  • Console Analytics: Development and debugging analytics provider
  • Type Safety: Strongly typed analytics events and configurations

📦 Installation

npm install @breadstone/ziegel-platform-analytics
# or
yarn add @breadstone/ziegel-platform-analytics

🧩 Features & Usage Examples

Event Tracking

import { AnalyticsManager, TrackingEvent } from '@breadstone/ziegel-platform-analytics';

const analytics = new AnalyticsManager();

// Track custom events
analytics.track('button_click', {
  buttonId: 'save-button',
  page: 'user-profile',
  userId: '123'
});

// Track page views
analytics.trackPageView('/dashboard', {
  referrer: document.referrer,
  userAgent: navigator.userAgent
});

Metrics Collection

import { MetricsCollector, Counter, Gauge, Histogram } from '@breadstone/ziegel-platform-analytics';

const metrics = new MetricsCollector();

// Counter metrics
const apiCallsCounter = new Counter('api_calls_total');
apiCallsCounter.increment({ endpoint: '/users' });

// Gauge metrics
const activeUsersGauge = new Gauge('active_users');
activeUsersGauge.set(150);

// Histogram metrics
const responseTimeHistogram = new Histogram('response_time_ms');
responseTimeHistogram.observe(250);

Performance Monitoring

import { PerformanceMonitor, PerformanceTracker } from '@breadstone/ziegel-platform-analytics';

const monitor = new PerformanceMonitor();

// Track function performance
const tracker = new PerformanceTracker('database_query');
tracker.start();
await performDatabaseQuery();
tracker.end();

// Monitor Web Vitals
monitor.trackWebVitals();
monitor.trackResourceTiming();

A/B Testing

import { ExperimentManager, ABTest } from '@breadstone/ziegel-platform-analytics';

const experimentManager = new ExperimentManager();

// Define A/B test
const buttonColorTest = new ABTest('button-color-test', {
  variants: ['red', 'blue', 'green'],
  weights: [0.33, 0.33, 0.34]
});

// Get user variant
const variant = experimentManager.getVariant('button-color-test', userId);

// Track conversion
experimentManager.trackConversion('button-color-test', userId, {
  action: 'purchase',
  value: 99.99
});

User Analytics

import { UserAnalytics, UserSession } from '@breadstone/ziegel-platform-analytics';

const userAnalytics = new UserAnalytics();

// Start user session
const session = userAnalytics.startSession(userId);

// Track user actions
session.trackAction('product_view', { productId: 'abc123' });
session.trackAction('add_to_cart', { productId: 'abc123', quantity: 2 });

// End session
session.end();

Custom Dashboards

import { DashboardManager, Widget, Chart } from '@breadstone/ziegel-platform-analytics';

const dashboard = new DashboardManager();

// Create widgets
const userCountWidget = new Widget('active-users', {
  type: 'counter',
  query: 'SELECT COUNT(*) FROM active_sessions'
});

const salesChart = new Chart('sales-trend', {
  type: 'line',
  query: 'SELECT date, SUM(amount) FROM sales GROUP BY date'
});

dashboard.addWidget(userCountWidget);
dashboard.addWidget(salesChart);

📚 Package import points

import {
    // Analytics Manager
    AnalyticsManager, IAnalyticsManager,

    // Analytics Providers
    AnalyticsProviderBase, IAnalyticsProvider, IAnalyticsProviderConfig,
    CallbackAnalyticsProvider, ConsoleAnalyticsProvider,
    GoogleAnalyticsProvider,

    // Callbacks & Types
    AnalyticCallback,

    // Data Sanitization
    AnalyticsSanitizerBase, AnalyticsSanitizer, IAnalyticsSanitizer,
    IAnalyticsSanitizerConfig, SanitizerKind
} from '@breadstone/ziegel-platform-analytics';

} from '@breadstone/ziegel-platform-analytics';


## 📚 API Documentation

For detailed API documentation, visit: [API Docs](./../../.docs/api/ziegel-platform-analytics/index.md)

## Related Packages

- **@breadstone/ziegel-platform**: Core platform services
- **@breadstone/ziegel-platform-logging**: Logging infrastructure
- **@breadstone/ziegel-core**: Foundation utilities

## License

MIT

## Issues

Please report bugs and feature requests in the [Issue Tracker](https://github.com/RueDeRennes/ziegel/issues)

---

*Part of the [ziegel Enterprise TypeScript Framework](../../README.md)*