Question

We are tasked to integrate our project with Kontagent. Our requirements include tracking the length of user's sessions. For user activity, Kontagent support specific request type - Page Request (a.k.a. pgr, as per their documentation). This type of request is needed for identifying user visits and accumulate them by the appropriate user id, also can be used by obtaining geolocation info from the IP address. However, there is no analogous method for tracking sessions by session id.

So, I need to know how do Kontagent calculate the session length? Is it automatically done depending on the user activity frequency, or should I send some request to identify the session? I can think of 2 options, but I dislike both of them:

  • Use additional Page Request with the session id. Along with the standard request that acknowledges user activity, I might send additional one, this time passing the session ID. If Kontagent are using some algorithms to calculate session length based on user activity frequency (which is known by the Page Requests with user ID we will already be sending), this will be unnecessary, and meaningless in terms of statistics, so the question is answered.

  • Use the data parameter in the default Page Request. Kontagent support a data parameter to most of their requests. It is base64 encoded JSON map object that should contain key-value pairs, and I can put the session id there. The problem is, that the information in the data parameter does not participate/influence the statistics calculated by Kontagent - in terms of grouping by session ID for instance and extacting per-session aggregations.

I'd gladly appreciate any clues on that matter.

Was it helpful?

Solution

The answer to this question depends a little on how much granularity you want around session length information. As such, I highly recommend that you email support to get more clarification around your particular use case.

With that caveat listed, Kontagent calculates average session lengths for most customers so that you don't need to pass in or calculate "session" information on your side. This average session length is calculated by examining the stream of messages for a given user of an application and then looking for a gap in messages greater than some threshold (for social apps, the threshold is 30 minutes; for mobile apps, the threshold is 2 minutes) that indicate the termination of one session and, potentially, the start of the next session.

If you need to get more granular than examining the average session length (for example, if you wanted to look at the session lengths for a particular user) then this query can be run in our DataMine product, which allows you to query the raw message data that you pass Kontagent.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top