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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@getpimms/analytics

v1.2.0

Published

Easily track and optimize your lead and sales conversions using PIMMS across multiple channels and applications.

Readme

@getpimms/analytics

Easily track and optimize your lead and sales conversions using PIMMS across multiple channels and applications.

Overview

@getpimms/analytics provides a streamlined way to implement conversion tracking on your site or application, helping you identify exactly what generates your leads and conversions.

Quick Start

Follow these steps to quickly integrate PIMMS analytics:

1. Enable Conversion Tracking

Activate conversion tracking for your PIMMS links via the PIMMS dashboard.

2. Install the Analytics Package

Add the @getpimms/analytics package to your project:

npm install @getpimms/analytics

3. Inject the Analytics Script

Integrate the tracking script into your application:

React Example:

import { Analytics as PimmsAnalytics } from '@getpimms/analytics/react';

export default function RootLayout({ children }: { children: React.ReactNode }) {
  return (
    <html lang="en">
      <body>{children}</body>
      <PimmsAnalytics />
    </html>
  );
}

Alternatively, for other frameworks, use the inject() method.

Available Props

Customize the analytics script by passing props to the Analytics component:

apiHost

Defines a custom API host for tracking requests. Useful when using reverse proxies to bypass ad-blockers.

  • Default: https://api.pimms.io

domainsConfig

Configure domains for accurate tracking:

<PimmsAnalytics
  domainsConfig={{
    site: "pim.ms",
    outbound: ["yourdomain.com", "anotherdomain.com"],
  }}
/>
  • site: Short domain provided by PIMMS.
  • outbound: Array of domains enabling cross-domain tracking.

attributionModel

Defines which touchpoint receives conversion credit:

  • Default: last-click

Available options:

  • first-click: Credits the initial user interaction.
  • last-click: Credits the final user interaction.

Example:

<PimmsAnalytics attributionModel="first-click" />

cookieOptions

Customize the cookie behavior for tracking:

| Key | Default | Description | Example | |-----------------|---------------------|--------------------------------------------------------------|---------------------------| | domain | null | Domain scope of the cookie | example.com | | expires | 90 days from now | Explicit expiry date | new Date('2024-12-31') | | expiresInDays | 90 | Number of days before the cookie expires | 60 | | path | / | URL path the cookie applies to | / |

Example (set a 60-day cookie lifespan):

<PimmsAnalytics cookieOptions={{ expiresInDays: 60 }} />

queryParam

Specifies the URL parameter to use for tracking (e.g., referral codes):

  • Default: via

Example:

?ref=john_doe

To use ref instead of the default:

<PimmsAnalytics queryParam="ref" />

scriptProps

Custom attributes for the injected <script> tag. See MDN documentation for all available options.

Example:

<PimmsAnalytics scriptProps={{ defer: true }} />

Next Steps

Sign up for PIMMS today →

Introduction to conversion tracking | blog →