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

@insertcoinab/gwen-analytics

v0.0.9

Published

A small Plug'n'play script which automates creation of anonumous users and sends basic events such as page-visits.

Downloads

5

Readme

gwen-analytics

A small Plug'n'play script which automates creation of anonumous users and sends basic events such as page-visits.

How to use

To use the script a Tracking Code is needed.

The GWEN Tracking script can be used in two different ways:

  • As an inline script added to your HTML <head> section
  • As a NPM package

Inline script

To use GWEN Tracking as an inline script add the following to the <head> section of pages which you want tracked:

<script async src="https://cdn.jsdelivr.net/npm/@insertcoinab/gwen-analytics@latest/dist/index.js"></script>
<script>
;(function(a,f,g){a[f]?g():Object.defineProperty(a,f,{configurable:!0,enumerable:!0,writeable:!0,get:function(){return a["_"+f]},set:function(i){a["_"+f]=i,g()}})})(window,"GWEN",function(){
    GWEN.Analytics.init(*TRACKING_CODE*)
})

</script>

The second script is required in order to make sure that the script has loaded before initialization. Replace *TRACKING_CODE* with the tracking code from the GWEN admin page!

NPM package

To use GWEN Tracking as a NPM package in a NodeJS project simply install with your preferred package manager

Example:

npm install @insertcoinab/gwen-analytics

After installing the package initialize the script as follows:

import {Analytics} from "@insertcoinab/gwen-analytics"

await Analytics.init(*TRACKING_CODE*);

making sure to replace *TRACKING_CODE* with the tracking code of your GWEN product.

Documentation

_constructor_

Properties

trackingCode: The tracking code of your GWEN product. Can be found here as an authenticated GWEN member.

userId: (Optional) The userID of the current user. Only needed if you have an existing GWEN user that should be the one to make progress.

init

Description

Has no properties. Is used to initialize the tracking and sending of events.

identify

Properties

userId: the GWEN userId of the logged in user

Description

If you add the package to a Single Page Application and you want to identify a user after a login step use this function. This will make it so that the give userId is being used when events are sent.