-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Replace segmnet with mixpanel to track events
- Loading branch information
Showing
7 changed files
with
12 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
import analytics | ||
from mixpanel import Mixpanel | ||
|
||
from django.conf import settings | ||
|
||
FYLE_SLACK_APP_MIXPANEL_TOKEN = settings.FYLE_SLACK_APP_MIXPANEL_TOKEN | ||
|
||
mixpanel_client = Mixpanel(FYLE_SLACK_APP_MIXPANEL_TOKEN) | ||
|
||
analytics.write_key = settings.FYLE_SLACK_APP_SEGMENT_KEY | ||
|
||
def identify_user(user_email) -> bool: | ||
analytics.identify(user_email, {}) | ||
mixpanel_client.people_set(user_email, {}) | ||
return True | ||
|
||
|
||
def track_event(user_email, event_name, event_data) -> bool: | ||
analytics.track(user_email, event_name, event_data) | ||
mixpanel_client.track(user_email, event_name, event_data) | ||
return True |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters