Created
August 14, 2013 18:21
-
-
Save cooncesean/6233932 to your computer and use it in GitHub Desktop.
Design pattern to handle anonymous users and event tracking using bitmapist.
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
import bitmapist | |
ANONYMOUS_USER_KEY = 'anonymous_user' | |
def generate_event(event_name, user_id=None): | |
if user_id is None: | |
user_id = 'anon:%s' % bitmapist.get_redis().incr(ANONYMOUS_USER_KEY) | |
bitmapist.mark_event(event_name, user_id) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment