edx/edx-platform — pull request #3411 by rlucioni (2014-04-21 19:32:55+00:00)
Title: Add registration, enrollment, and unenrollment tracking

This PR uses Segment.io's [Python module](https://segment.io/docs/libraries/python/) to track the creation of new accounts, course enrollments, and course unenrollments. Miles Steeles' `analytics` module has been renamed `instructor_analytics` to avoid a naming conflict with Segment.io's module, which has been added as a new dependency (@feanil). Segment.io's module uses a single extra thread to batch messages and flush them asynchronously to Segment.io's servers. Flushes occur the very first time a message is received and every 50 messages thereafter, or if 10 seconds have passed since the last flush. The message batch size is configurable - I've changed it from the default 20 to 50, but am interested in what others think the best size is.

This PR also resolves a potential issue where the Segment.io browser library's `page` function was called before the `identify` function.

@mulby, could you help me review this?