analytics-event-tracking
Version:
Analytics Event Tracking, a private Node.js module in TypeScript
42 lines (41 loc) • 1.21 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const AnalyticsClient_1 = require("../AnalyticsClient");
const analytics = new AnalyticsClient_1.AnalyticsClient({
mixpanelToken: "", // add updated mixpanel token
moengageAppId: "", // add updated moengage app id
dataCenterNumber: "", // add moengage data center number
authToken: "", // add updated auth token,
});
analytics
.createUser({
name: "Ali Hussain Rizvi",
first_name: "Ali",
last_name: "Rizvi",
email: "ali.rizvi@tcgre.com",
mobile: "9812342337",
}, {
moengage: true,
moengageOptions: {
customerId: "90989777688876777887777736",
platform: "WEB",
},
})
.then(() => {
console.log("User creation successful");
})
.catch((error) => {
console.error("Error creating user:", error);
});
analytics
.trackEvent("Lead Qualified", { name: "Ali Hussain Rizvi", phone: "9812342337" }, {
mixpanel: false,
moengage: true,
moengageOptions: { customerId: "90989777688876777887777736" },
})
.then(() => {
console.log("Event tracked successfully");
})
.catch((error) => {
console.error("Error tracking event:", error);
});