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

@convious/convious-analytics

v1.0.4

Published

A library that allows recording page views and transactions for Convious pricing API

Downloads

8

Readme

Convious Analytics

This is a JavaScript library, similar to Google Analytics, that should be added to your website. It allows registering events that are needed for pricing API to function.

Installing

By adding a script tag

<script type="text/javascript" src="https://resources.convious.com/analytics.js"></script>

You can add our script to the head element of your website. In order to function properly, this script must be present on every page.

Using NPM

npm install @convious/convious-analytics

You can also bundle the script in your JavaScript using npm/yarn.

Initializing

If installed by adding a script tag:

conviousPricing.init(accountId, cookieId);

If installed using npm/yarn:

import * as conviousPricing from '@convious/convious-analytics'
conviousPricing.init(accountId, cookieId);

In order to function, the library must first be initialized with the ID of your Convious account and the cookie ID of the user.

Parameters:

Name | Type | Required | Description --------- | ----------- | ----------- | ----------- accountId | string | yes | Account ID of your Convious account cookieId | string | yes | Cookie ID of the user browsing the website

Sending events

Once initialized, events can be sent using the library.

Page viewed event

conviousPricing.logPageView(refererUrl, currentUrl);

This event notifies that the user has visited a page in the website. In conventional websites the page visits are logged automatically and this does not need to be called directly. However, if your website is a single-page application, it must be called on each application route change.

Parameters:

Name | Type | Required | Description --------- | ----------- | ----------- | ----------- refererUrl | string | yes | The URL the user is coming from currentUrl | string | yes | The URL the user has arrived in

User entered checkout event

conviousPricing.logUserEnteredCheckout();

This event notifies that the user has opened a page where he can buy products or opened a html widget within a page that allows him to buy products.

User selected date event

conviousPricing.logUserSelectedDate();

This event notifies that the user has selected event date when buying a product.

User viewed products event

conviousPricing.logUserViewedProducts();

This event notifies that the user has seen a list of available products he can buy.

User viewed prices event

conviousPricing.logUserViewedPrices();

This event notifies that the user has seen prices for the products.

User added an item to cart event

conviousPricing.logUserAddedAnItemToCart();

This event notifies that the user has added a product to cart.

Order created event

conviousPricing.logOrderCreated({
    orderId: '<order_id>',
    items: [{
        productId: '<product_id>',
        amount: 2,
        price: 12.99,
        eventDate: new Date(2018, 4, 1),
        location: 'Almere',
    }, {
        productId: '<product_id>',
        amount: 1,
        price: 11.99,
        eventDate: new Date(2018, 4, 1),
        location: 'Almere',
    }]
});

This event notifies that the user has created an order.

Parameters:

Name | Type | Required | Description --------- | ----------- | ----------- | ----------- orderId | string | yes | The ID of the order being made items.productId | string | yes | The ID of a product in the order items.amount | number | yes | The number of items of a product in the order items.price | number | yes | The item price of a product in the order items.eventDate | Date | no | The date when the event is taking place in case the product is time based items.location | string | no | The location id where the product is being sold (in case of multiple venues at different locations)

Transaction event

conviousPricing.logTransaction(orderId, totalAmount);

This event notifies that the user has made a purchase.

Parameters:

Name | Type | Required | Description --------- | ----------- | ----------- | ----------- orderId | string | yes | The ID of the order that was paid totalAmount | number | yes | The total sum of the order