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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@thg-altitude/tracking

v1.2.25

Published

A reusable package for managing Ingenuity GA/BI/UA events.

Downloads

1,802

Readme

Tracking SDK

A reusable package for managing Ingenuity GA/BI/UA events.

Installation

    <script is:inline>
      window.Tracker = {
        store: {
          get(k) {
            return Tracker.store[k]
          },
          set(k,v) {
            return Tracker.store[k] = Tracker.store[k] ? Object.assign(Tracker.store[k], v) : v
          }
        }
      }
    </script>
    <script src="https://unpkg.com/@thg-altitude/[email protected]/index.js" async></script>

How-to-use

Events can be triggered in to ways:

  1. Data Attributes
<button data-track="addToCard" data-track-push="yourStoreKey"/>
  1. Handlers
Tracker.handlers.addToCart({ store: 'yourStoreKey' })

In both cases when you're dependant on enriching the tracking event with meta data (e.g. product page data, list page data, basket contents) you will need to populate a store.

You can populate at store at any time by running the following:

Tracker.store.set('yourStoreKey', {
  ...
})

In the event that objects in the store need to change over time (for e.g. a custom changes quantities for the product after initial load) the store supports records being upserted as long as the keys are the same.

Events

| event | store | supported | | -------- | ------- | --------| | addToCart | { product } | ✅ | | selectItem | { product } | ✅ |

Store Objects

Product

An structure for product would be the following.

{
  item_name: "Donut Friday Scented T-Shirt",
  item_id: "67890",
  price: 33.75,
  item_brand: "Google",
  item_category: "Apparel",
  item_category2: "Mens",
  item_category3: "Shirts",
  item_category4: "Tshirts",
  item_variant: "Black",
  item_list_name: "Search Results",
  item_list_id: "SR123",
  index: 2,
  quantity: 1
}

Publishing

In order to publish a new version you will need a local .npmrc to publish to @thg-altitude.

Update the package.json with the new version before running npm publish