Counting users that returned to the website

The following is a simplified look at our mappings in Elastic search

{
    "mappings" : {
        "properties": {
                    "userid": { "type": "keyword" },
                    "yyyy_mm_dd": { "type": "date", "format": "yyyy-MM-dd" },
                    "ts": { "type": "date"}
    }
}

Usecase
eric@cream.com, 2020-03-28, 1585357301265
paul@beatles.com, 2020-03-28, 1585382231269
john@beatles.com, 2020-03-28, 1585383569863
eric@cream.com, 2020-03-28, 1585414906564

paul@beatles.com), 2020-03-29, 1585466637966
ginger@cream.com, 2020-03-29, 1585493882027
george@beatles.com, 2020-03-29, 1585486384984

paul@beatles.com, 2020-03-30, 1585562310061
jackbruce@cream.com, 2020-03-30, 1585571947493
eric@cream.com, 2020-03-30, 1585597746891
john@beatles.com, 2020-03-30, 1585555104127
ginger@cream.com, 2020-03-30, 1585563504459
freddie@queen.com, 2020-03-30, 1585578397198

My desired Visualization for Return Users

2020-03-28 - 4 return users (timeline starts there)

2020-03-29 - 1 return user (paul)

2020-03-30 - 4 return users. (paul, eric, john and ginger)

This goes into the same direction as your last question.

Having an entity centric index helps again. If in addition to min(ts), which corresponds to "user first seen" you add a max(ts), which would be "user last seen", you can use a scripted metric to check whether max - min is above a threshold you define for "returning user".

Thank you @Hendrik_Muhs
Could you please provide additional guidance on how to implement a scripted metric?
thanks
warmly
sanjay

I thought a bit more about this usecase and realized that I misunderstood it. The suggested max to get the last time a user has been seen might be useful, but does not help to chart returned users over time, because it would only give you the last time the user has been seen, but you want all time buckets that a certain user has been seen.

I do not have a solution at hand, but can only provide ideas that might lead to a solution:

  • given the user index from the other transform, you could enrich incoming data with user information, e.g. the first time the user has been seen. That again can be used together with a scripted field to decide if the user is a new or old user
  • another transform that ceates the histogram already and filters out new users by joining with the user index

Both are very vague ideas, sorry, I can't provide more input.

Having that said, I wonder: With TSVB you could chart the total number of users and the number of new users in 1 chart. The area between the 2 graphs are the returned users. This is not exactly what you are asking for, but transports the same message.

Not at all, these are great ideas I can run with - So a big shout out of THANKS ! :slight_smile: @Hendrik_Muhs
That "enrich" fields in index1 from index2 seems promising to delve deeper into for sure

Thanks again ! I really really appreciate (and am grateful to) your alacrity.

warmly

sanjay

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.