chatbot-analytics

0.0.2 • Public • Published

Chatbot Analytics for node.js

A helper library for that allows to easily integrate analytics in your chatbot.

Supported 3rd party services:

Support for other chatbot analytics tools planned.

Install

npm install chatbot-analytics --save

Usage

First include this module and initialize it with your Google Analytics tracking ID.

const ChatbotAnalytics = require('chatbot-analytics');

Then, simply track an event like this:

// Instantiate:
const ca = new ChatbotAnalytics({ga: {trackingId: 'YOUR_GA_TRACKING_ID'}});

// Send an event:
ca.trackEvent('[user_id_here]', '[category]', '[action]');

// Send an event (with additional paramters):
ca.trackEvent('[user_id_here]', '[category]', '[action]', '[label]', null, {locale: 'en'});

Advanced options

All possible options that can be passed in the constructor:

{
    logging: my_logger, // Something like console.log or logger.debug
    ga: { // Enable Google Analytics
        trackingId: 'YOUR_GA_TRACKING_ID', // The tracking ID (GA property ID)
        debug: true // Enable GA debug mode?
    }
}

Disclaimer

All mentions of Google Analytics and its use in this project are copyright of Google. Google does not endorse this project in any way.

Readme

Keywords

Package Sidebar

Install

npm i chatbot-analytics

Homepage

toni.ai

Weekly Downloads

1

Version

0.0.2

License

MIT

Unpacked Size

7.22 kB

Total Files

8

Last publish

Collaborators

  • klemensz