moengage
v0.1.3
Published
Moengage events integration for web
Downloads
1,683
Maintainers
Readme
Moengage Events
To include the web tracking js on your website please read https://docs.moengage.com/docs/overview.
Installation
Install the dependencies.
$ npm i moengage
Example
import Moengage from 'moengage';
const MoEvent=new Moengage({appID:"your key",debugMode:1,swPath:"./sw.js"})
//To Create unique user
MoEvent.createUniqueUser("uniqueID")
//To update unique user
MoEvent.updateUniqueUser("def")
//Destroy Session
MoEvent.destroySession()
// Track User Attribute - Add Event with multiple attribute
MoEvent.addEvent("event name",{name:"xyz",age:19})
//setCustomAttribute
MoEvent.setCustomAttribute("age",20)
MoEvent.setCustomAttribute("adjjk",'ghj')
//Pre-defined User Attributes - All attribute are optional
MoEvent.updateAttributes({name:"dsf",email:"dsfd@",mobile:"8980",addFirstName:"abc",addLastName:"sdf",addGender:"M",addBirthday:new Date(1980, 2, 31)})
License
MIT
Free Software, Hell Yeah!