Tracking User Events #25

Closed
votinhthieugia opened this Issue Jan 5, 2012 · 6 comments

Projects

None yet

3 participants

@votinhthieugia

The doc says: We can select user and follow them step by step but i cant get it working.
Is there a way to track user events. What I did is:

  • I set users 'A' and 'B' through 3 special events ( '_pageview', '_set_name' and '_set_picture')
  • I post the event 'attack' with user session 'A' (on the client i see: event 'attack' belongs to user 'A') (post data: { '_type' => 'attack', '_session' => 'abc' })
  • Then I post the event 'rob' with user session 'B' ((post data: { '_type' => 'rob', '_session' => 'def' })
    After that I see all the posted events before become 'rob' with user 'B'.
    Did I do something wrong or it is not supported to do it yet?
@paulasmuth
Owner

I hope this helps...

to set the username and picture send these events to fm
-> you don't need to define any event handlers
-> the session token (_session) could be your unique session id
or the unique user id (it's hashed)

# set the user name
{ "_type": "_set_name", "name": "Tingle Tangle Bob", "_session": "mysessiontoken" }

# set the user picture
{ "_type": "_set_picture", "url": "http:#myhost/123.jpg", "_session": "mysessiontoken" }

if you want to count action/events unique per session you can
set up an event handler like this:

gauge :myaction_uniqe, 
  :tick => 1.day.to_i, 
  :unique => true

event :myaction do
  incr :myaction_uniqe
end

and send events like this one:
{ "_type": "myaction", "_session": "mysesstiontoken" }

the gauge will only be incremented once per session token (and tick/interval)
so this gauge would show "daily unique myactions"

if you want e.g. the average body size of all users on a given day:

gauge :average_body_size, 
  :tick => 1.day.to_i, 
  :unique => true,
  :average => true

event :user_body_info do
  incr :average_body_size, data[:body_size]
end

# events:
{ "_type": "user_body_info", "body_size": 186, "_session": "userid_1" }
{ "_type": "user_body_info", "body_size": 162, "_session": "userid_2" }
{ "_type": "user_body_info", "body_size": 173, "_session": "userid_3" }
@votinhthieugia

Well, thanks for your quickly response but I think you misunderstand my problems.

  1. The first is how do I keep track of each user's events (by clicking one user on the right tab Active User), can it show all the events that user does (for i.e 1pm he attacks, 2pm he robs, when i select this user it will show me these 2 events)?
  2. The second is: the event 'attack' belongs to user 'A' after the first post but after the second post (event 'rob' with session 'B'), the event 'attack' of user 'A' is changed to 'rob' of user 'B')?
@kazjote
Contributor
kazjote commented Jan 9, 2012

@votinhthieugia I guess you can't track particular user activity right now. I will work on it now as it seems to be quite easy to implement and extremly handy.

@kazjote
Contributor
kazjote commented Jan 11, 2012

@votinhthieugia here you are: #32

@paulasmuth
Owner

Merged! :)

@paulasmuth paulasmuth closed this Jan 11, 2012
@votinhthieugia

Thank guys :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment