Skip to content

Commit

Permalink
refactor: Analytics mixpanel
Browse files Browse the repository at this point in the history
  • Loading branch information
abhijeetnishal committed May 19, 2024
1 parent c9bfdfd commit c737c63
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/config/mixpanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ const Mixpanel = require("mixpanel");
// track an event with optional properties
const trackEvent = (eventName, value) => {
const mixPanelProjectToken = process.env.MIXPANEL_PROJECT_TOKEN;
console.log(mixPanelProjectToken);

if (mixPanelProjectToken) {
const mixpanel = Mixpanel.init(mixPanelProjectToken, {
geolocate: true,
});

console.log("mixpanel init");
mixpanel.track(eventName, {
url: value,
});
Expand Down

0 comments on commit c737c63

Please sign in to comment.