Skip to content

Easily integrate analytics providers in your chatbot.

License

Notifications You must be signed in to change notification settings

toni-ai/chatbot-analytics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chatbot Analytics for node.js

A helper library for that allows to easily integrate analytics in your chatbot. You can read more about how to integrate and use Google Analytics in to your chatbot here.

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.

About

Easily integrate analytics providers in your chatbot.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published