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

vantevo-analytics-sdk

v1.0.1

Published

Official Javascript client SDK for Vantevo Analytics.

Readme

The analytics of your website, but simpler

Vantevo Analytics is the alternative platform to Google Analytics that respects privacy, because it does not need cookies not compliant with the GDPR. Easy to use, light and can be integrated into any website and back-end.

This is the official JavaScript client SDK for Vantevo Analytics. For more information visit the website vantevo.io.

Installation

npm install vantevo-analytics-sdk

Usage

To start tracking page views, events, and getting statistics, you need to initialize the client first:

| Option | Type | Description | | ------------- | -------------------- | ---------------------------------------------------------------------------------------------------------------------------- | | accessToken | string (required) | To create an api key read our guide. | | domain | string (required) | Enter the domain you want to use to collect statistics.The domain must not include http, https, or www. Example: example.com | | protocol | string (required) | http or https | | userAgent | string (optional) | To monitor page views and events, requests must have a user-agent, here you can assign a global ùser-agent. | | xForwardedFor | string(optional) | To monitor page views and events requests must have anip, here you can assign a global ip. | | dev | boolean` (optional) | Tracker will not send data to server, please check console/log file to view request information. |

const { VantevoAnalytics } = require("vantevo-analytics-sdk");

var client = new VantevoAnalytics({
  accessToken: "",
  domain: "",
  protocol: "",
  userAgent: "",
  xForwardedFor: "",
  dev: false,
});

Tracking page views and events

Parameters

| Option | Type | Description | | ------------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | event | object (required) | See event parameters. | | userAgent | string (optional) | To monitor page views and events, requests must have a user-agent, you can use this parameter if you don't have a global user-agent. | | xForwardedFor | string (optional) | To monitor page views and events requests must have an ip, you can use this parameter if you don't have a global ip. |

Event parameters | Option | Type | Description | | ------------- | --------------------- | ----------------------------| | event | string (required) | Event name, remember that the name pageview will send a pageview event. | | url | string (required) | Enter url you want to save in the statistics. | | title | string (optional) | You can insert a title of the page, if this field is not used vantevo will insert the pathname of the url used. | | referrer | string (optional) | In this field you can enter a referrer for your request. Default: null. | | width | string (optional) | This field is used to save the screen size. Default: 0.| | height | string (optional) | This field is used to save the screen size. Default: 0. | | meta | object (optional) | Enter the event values meta_key and meta_value, read more how to create an event Default: {}. |

const { VantevoAnalytics } = require("vantevo-analytics-sdk");

var client = new VantevoAnalytics({....});

//without global useragent and ip
client.event({event: "pageview", url: "https://example.com/page" },  "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36", "92.16.12.2");

//with global useragent and ip
client.event({event: "pageview", url: "https://example.com/page"});

Monitoring Ecommerce

In the ecommerce section of Vantevo you can monitor specific actions affecting your ecommerce website and the sources of traffic that lead to sales.

Parameters

| Option | Type | Description | | ------------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | | event | object (required) | See event parameters. | | userAgent | string (optional) | To monitor page views and events, requests must have a user-agent, you can use this parameter if you don't have a global user-agent. | | xForwardedFor | string (optional) | To monitor page views and events requests must have an ip, you can use this parameter if you don't have a global ip. |

Event parameters | Option | Type | Description | | ------------- | --------------------- | ----------------------------| | event | string (required) | Event name, remember that the name pageview will send a pageview event. | | url | string (required) | Enter url you want to save in the statistics. | | title | string (optional) | You can insert a title of the page, if this field is not used vantevo will insert the pathname of the url used. | | referrer | string (optional) | In this field you can enter a referrer for your request. Default: null. | | width | string (optional) | This field is used to save the screen size. Default: 0.| | height | string (optional) | This field is used to save the screen size. Default: 0. | | total | number (optional) | The total amount of the order Example: 1255.00 Default: 0. | | coupon | string (optional) | The name of the coupon used. Example: newsletter | | coupon_value | number (optional) | The value of the coupon used. Example: 45.00 | | payment_type | string (optional) | The mode of payment. Example: Payal o Carta di credito. | | items | array (required) | The product information, read more. |

List events

These are the events to use to monitor your ecommerce:

| Event | Description | | :----------------- | :------------------------------------------ | | add_to_wishlist | a user adds a product to the favorites list | | view_item | a user views a product | | remove_item_cart | a user removes a product from the cart | | add_item_cart | a user adds product to the cart | | start_checkout | a user has started the checkout process | | checkout_info | a user submits personal data | | checkout_ship | a user submits shipments data | | checkout_payment | a user initiated the payment process | | purchase | a user has completed a purchase |

Example

An example for how to use the trackEcommerce function.

client.trackEcommerce(
  {
    event: "view_item",
    items: [
      {
        item_id: "SKU_123",
        item_name: "Samsung Galaxy",
        currency: "EUR",
        quantity: 0,
        price: 199.99,
        discount: 0,
        position: 1,
        brand: "Samsung",
        category_1: "Smartphone",
        category_2: "Samsung",
        category_3: "Galaxy",
        category_4: "",
        category_5: "",
        variant_1: "Black",
        variant_2: "5.5 inch",
        variant_3: "",
      },
    ],
    url: "https://example.com/samsung-galaxy"
  },
  "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36",
  "92.16.12.2"
);

Read our guide for more information of how to use the ecommerce tracking function.

Express js

To use express js middleware make sure the script can get useragent and the ip, to get the data the script uses req["useragent"] and req.headers['x-forwarded-for'].

const express = require('express');
const { VantevoAnalytics } = require("vantevo-analytics-sdk");
const app = express();

var client = new VantevoAnalytics({....});
app.use(client.express());

How to get the statistics data

Parameters

| Option | Type | Description | | ------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | filters | object (required) | Check out our guide to see all the parameters you can use like, click here. |

Example Statistics

const { VantevoAnalytics } = require("vantevo-analytics-sdk");
var client = new VantevoAnalytics({....});

client.stats({source: 'pages', period: "1m", limit: 30, offset: 0, city: "Rome", ....}).then(() => {}).catch(() => {});

Example Events

const { VantevoAnalytics } = require("vantevo-analytics-sdk");
var client = new VantevoAnalytics({....});

client.events({source: 'events', period: "1m", limit: 30, offset: 0, city: "Rome", ....}).then(() => {}).catch(() => {});

Vantevo Analytics guide

To see all the features and settings of Vantevo Analytics we recommend that you read our complete guide here.