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

multiplytix

v0.0.9

Published

Unified analytics API

Downloads

15

Readme

multiplytix

NPM

A Unified analytics API

Providers:

  • Mixpanel
  • Google Analytics
  • Google Remarketing Tag
  • Facebook pixel
  • Reddit pixel
  • Twitter pixel
  • Hotjar

Features:

  • Unified API
  • Landen.io Integration
  • React context provider

ES6

Install

npm install --save multiplytix

or

yarn add multiplytix

Usage

import Multiplytix from 'multiplytix'

const multiplytixConfig = {
  google_analytics: <GOOGLE_ANALYTICS_ID>,
  google_remarketing: <GOOGLE_REMARKETING_TAG>,
  mixpanel: <MIXPANEL_ID>,
  hotjar: <HOTJAR_ID>,
  facebook_pixel: <FACEBOOK_PIXEL_ID>,
  twitter_pixel: <TWITTER_ID>,
  pinterest_pixel: <PINTEREST_ID>,
  reddit_pixel_q: <REDDIT_PIXEL_Q>,
  reddit_pixel_s: <REDDIT_PIXEL_S>,
}

const multiplytix = new Multiplytix(multiplytixConfig)

multiplytix.event(`MY_EVENT`, {me: 'ta', da: 'ta'})
multiplytix.view('/thank-you.html')

Vanilla JavaScript

<!-- Include the script -->
<script src='//unpkg.com/[email protected]/build/index.js'></script>

<script>
  // Specify your analytics IDs
  var multiplytixConfig = {
    google_analytics: 'GOOGLE_ANALYTICS_ID',
    mixpanel: 'MIXPANEL_ID',
    facebook_pixel: 'FACEBOOK_PIXEL_ID'
  }

  // Initialize Multiplytix
  var multiplytix = new Multiplytix(multiplytixConfig);

  // Run any page view
  multiplytix.view('/thank-you.html');

  // Attach listeners to things
  var button = document.getElementById('submitButton');
  button.addEventListener('click', function(ev) {
    // Broadcast custom events in response to user actions
    multiplytix.event(`MY_EVENT`, {me: 'ta', da: 'ta'});
  });
</script>

API

constructor(options: Object)

Set the following keys on the options object, to activate corresponding modules: google_analytics, google_remarketing, mixpanel, hotjar, facebook_pixel, twitter_pixel, pinterest_pixel, reddit_pixel_q, reddit_pixel_s.

view(pathname: String)

Trigger a Page View event in GA, and a custom PageView event elsewhere. Pathname is the URL reported.

Examples:

multipllytix.view('/thank_you.html')

multiplytix.view() // will infer pathname from window.location

event(name: String, properties: Object)

Trigger a custom event specified by name (i.e.: 'ConversionClick'). Add any metadata you wish to the properties hash.

Example:

multiplytix.event('ConversionClick', { buttonColor: 'orange' })

Logging

The library will log things to the console when in development (process.env.NODE_ENV === 'development'). You can also turn on logging by setting window.LOG_MULTIPLYTIX to true.

Landen.io

Drop in version for Landen: https://github.com/cofablab/multiplytix-landen

React

Context provider for React: https://github.com/cofablab/multiplytix-react

License

MIT © Cofab