Package: rapidsms-xray
RapidSMS app for web and SMS split test experiments & event trackingBelow you will find basic setup instructions for the rapidsms-xray
project. To begin you should have the following applications installed on your
local development system:Python >= 2.6 (2.7 recommended)pip >= 1.1Redis >= 2.6.0InstallationPlease note: at the time of this writing, Ubuntu installs an older,
incompatible version of Redis (prior to the introduction of theBITOPandBITCOUNTcommands).
You can use the following PPA to install a more recent version:sudo add-apt-repository ppa:chris-lea/redis
sudo apt-get update
sudo apt-get install redis-serverInstall necessary python requirements with pip:pip install -r requirements/base.txtIn your rapidsms projectsettings.py, addxrayto yourINSTALLED_APPSand
addxray.context_processors.web_experimentsto yourTEMPLATE_CONTEXT_PROCESSORSIn your rapidsms projecturls.py, add xray’s urls tourlpatterns:(r'^xray/', include('xray.urls')),You may need to run django’scollectstaticto ensure xray’s static assests are
available:django-admin.py collectstaticExperimentsrapidsms-xray usesCleaverfor split testing experiments. Please note that rapidsms-xray currently uses a
custom fork of Cleaver pending upstream merging of the RedisBackend (which will
be installed properly bypython setup.py installorpip install -r requirements/base.txt).To conduct web split testing experiments, add your experiments to
your app’scontext_processors.pywhich makes the experiment choice
available in the RequestContext. You don’t have to put your experiments in a
context_processor – its just a convenient location so they can all be in one place.Seexray/context_processors.pyandthousand/templates/thousand/index.htmlfor example usage.To conduct sms split testing experiments, add your experiments to your app.py or handler and
ensure that theexperimentsapp is listed in your setting.py’sINSTALLED_APPSxray/app.pywill deal with identifying experiment participation during the router’sfilterphase, so experiments can be conducted in any of the subsequent incoming phases.Please be aware that experiment participation is handled separately for web and sms
split testing (specifically, web participant identity is cookie-based for non-logged-in
uses and is user_id-based for logged-in users, whereas sms participant identity
is based on mobile number) – that is, a web experiment participant cannot be scored
by a SMS conversion event and vice-versa.Seexray/app.pyfor example usage.Eventsrapidsms-xray usesbitmapistfor event tracking and cohort analysis.To use, import and instantiatexray.events.Trackerand then callmy_tracker.web_eventormy_tracker.sms_eventwith an event name and the
user’s cleaver identity.xray.rolodex.Rolodexcaches identity information for
quick user lookup and issues a unique integer for each web and sms user. These
unique integer ids are used by bitmapist to track event participation using
Redis bitmaps for fast, arbitrary querying. See the bitmapist documentation for
additional information.
Seexray/app.pyandxray/views.pyfor example usage.When performing custom event analysis, use theEvents classes (with separate
Weband SMS* classes for each time period) inxray.eventsrather than the
bitmapist classes – rapidsms-xray adds prefixes to namespace the bitmapist
keys as well as prefixes to separate sms and web events.xray.events.Tracker’s event methods add the appropriate prefixes, so you will
only need to worry about them if you are accessing bitmapist or the stored data
in Redis directly.Dashboardrapidsms-xray includes a dashboard summarizing experiment and event
participation as well as drilldown pages showing experiment details and cohort
analysis of event participation.