UNPKG

moengage

Version:

Moengage events integration for web

59 lines (30 loc) 1.05 kB
# Moengage Events ![Build Status](https://travis-ci.org/joemccann/dillinger.svg?branch=master) To include the web tracking js on your website please read https://docs.moengage.com/docs/overview. ### Installation Install the dependencies. ```sh $ npm i moengage ``` ### Example ```js 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!**