1.0.21 • Published 4 months ago

@inleads/event-logger v1.0.21

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months ago

InLeads

Event Logger SDK for InLeads. The Smart Sales Management System.

Getting Started

Installation

NPM

npm install @inleads/event-logger --save

Yarn

yarn add @inleads/event-logger

Script

<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@inleads/event-logger/dist/events.js"></script>

Basic Usage

Node.js

const InLeads = require('@inleads/event-logger')
// The only required field is the api token
InLeads.init('api-token');

// Should be called once to initialise user, email is Mandatory
InLeads.setUser('email', 'name', { role: 'some-role' });

// track should only be called once init and setUser is completed
// event-name is mandatory
InLeads.track('event-name', { from: 'screen-name' });

ES6 module

import { init, track, setUser } from '@inleads/event-logger'
// The only required field is the api token
init('api-token');

// Should be called once to initialise user, email is Mandatory
setUser('email', 'name', { role: 'some-role' });

// track should only be called once init and setUser is completed
// event-name is mandatory
track('event-name', { from: 'screen-name' });

General JavaScript (script tag)

// The only required field is the api token
inleadsEvents.init('api-token');

// Should be called once to initialise user, email is Mandatory
inleadsEvents.setUser('email', 'name', { role: 'some-role' });

// track should only be called once init and setUser is completed
// event-name is mandatory
inleadsEvents.track('event-name', { from: 'screen-name' });

Functions Reference

init

  init('api-token')
ParameterTypeDescription
api-tokenstringRequired. Your API key

setUser

  setUser('email', 'name', {role: "userRole"})
ParameterTypeDescription
emailstringRequired. Email Id of the contact / user
namestringOptional. Name of the contact / user
optionsobjectOptional. JSON object can have any meta data to save with user data

track

  track('event-name', {from: "screenName"})
ParameterTypeDescription
event-namestringRequired. Name for the event can be any string
optionsobjectOptional. JSON object can have any meta data to save with event data

unset

  unset()

No parameters required

1.0.19

4 months ago

1.0.21

4 months ago

1.0.20

4 months ago

1.0.18

6 months ago

1.0.17

7 months ago

1.0.16

7 months ago

1.0.15

7 months ago

1.0.14

10 months ago

1.0.12

11 months ago

1.0.11

11 months ago

1.0.10

11 months ago

1.0.9

11 months ago

1.0.6

11 months ago

1.0.5

11 months ago

1.0.4

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.0

11 months ago