No commit activity in last 3 years
No release in over 3 years
Built-in state tracking for Stealth bots with Mixpanel.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

= 3.8.0

Runtime

 Project Readme

Stealth Mixpanel

This gem provides out-of-the-box tracking of state transitions inside of Stealth via the Mixpanel service. You are free to track additional events as needed, and we may add more baseline events in the future.

Gem Version

Setup

Once you have your Mixpanel Project Token, set the MIXPANEL_PROJECT_TOKEN environment variable. That's the only setup required!

Events Tracked

Here are the events that are tracked automatically:

  • State Change: these are sent to Mixpanel each time a state transition takes place. The user's recipient_id is sent to Mixpanel as the distinct_id. Additional properties for flow and state are also sent with the event. Please note that when an update_session_to is called, the user's session is updated immediately and therefore an event is also sent to Mixpanel.

Tracking Custom Events

If you'd like to track custom events or store user profiles, you can use the following:

tracker = Stealth::Mixpanel.new

# Track events

tracker.track(current_session_id, 'event-to-track')

# Store/update user profiles

tracker.people.set(current_session_id, { offer_code: '1234-2', happy: 'yes' })

For more information about tracking custom events or user profiles, please check out the mixpanel-ruby gem. The tracker instance above is just a Mixpanel::Tracker object.