Session History shows no sessions under User Profile

I am running Countly Enterprise Edition v18.04 and testing with both the Android SDK and Web SDK to track user sessions and page views.

Under the User Profiles option, I can see that the User Profile has been created and am able to change the user details such as the name and username and assign custom attributes, so I know the device_id is being matched appropriately to the User Profile.

However, when viewing the User Profile, there are no details under Session History.

When looking under the Analytics option and drilling into Sessions and Views, we can see that sessions and views are being recorded, but it doesn't appear to be associating to the User Profile.

Below is a sample of the code we are testing with via the Web SDK

        <script type='text/javascript'>
            // Some default pre init
            var Countly = Countly || {};
            Countly.q = Countly.q || [];
            // Provide your app key that you retrieved from Countly dashboard
            Countly.app_key = "xxxxx";
            // Provide your server IP or name. Use or 
            // or for EE trial server.
            // If you use your own server, make sure you have https enabled if you use
            // https below.
            Countly.url = "xxxx"; 
            // Start pushing function calls to queue
            // Track sessions automatically (recommended)
            //track web page views automatically (recommended)
            // Uncomment the following line to track web heatmaps (Enterprise Edition)
            // Countly.q.push(['track_clicks']);
            // Uncomment the following line to track web scrollmaps (Enterprise Edition)
            // Countly.q.push(['track_scrolls']);

            // Load Countly script asynchronously
            (function() {
                var cly = document.createElement('script'); cly.type = 'text/javascript'; 
                cly.async = true;
                // Enter url of script here (see below for other option)
                cly.src = 'xxxx/sdk/web/countly.min.js';
                cly.onload = function(){Countly.init()};
                var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(cly, s);
        <script type='text/javascript'>
            //send event on button click
            function clickEvent(ob) {
                    segmentation: {

            //send event on button click
            function userProfile(ob) {
                Countly.q.push(['user_details', {
                    name: "name",
                    username: "username",
                    custom: {
                        custom1: "custom1",
                        custom2: "custom2"
        <input type="button" id="asyncTestButton" onclick="clickEvent(this)" value="Test Button">
        <input type="button" id="asyncTestButton1" onclick="userProfile(this)" value="User Profile">

Anyone have some suggestion on how to troubleshoot or see anything that needs to be changed in the code snippet to make this work?

Thank you.



  • Hello,
    does it happen for both Android and Web SDK? Are they both used on same Countly app in dashboard?
    My main point here is, that most probably same user on Android and same user on Web would not match in dashboard and would be 2 different users.

    Comment actions Permalink
  • The behavior occurs regardless of using either the Android SDK or Web SDK.

    We are only using the different SDKs as a way to test and see if the problem is related to the SDK rather than merging the results.

    Unfortunately, neither method seems to record the Session History against a User Profile.

    Have also tried the REST API as well and same result.

    So right now we are a bit confused as to why there is no Session History being captured against the User Profile. Hoping there is something we can check.

    Comment actions Permalink
  • Ok, so one of the reasons could be periods. But it also means it would match with drill.
    So what you can try is to go to Drill section and there input some simply query, like platform=Android and Apply, and then select Action and View User list, it should take you to user profiles list with users who had session in that period, there click on any profile and check if it has sessions.

    Feel free to also post screenshots here, if you are ok with it, so we could try to spot if there are any problems.

    Comment actions Permalink
  • Interesting, looking under the Drill section, there is actually no data being reported for the entire year of 2018, although looking at the Overview and Analytics section there is data being reported.

    Attached is a merged screenshot, unfortunately as a new user I can only upload a single image, so have to put them all together.

    As you can see, there was total of 46 sessions captured.

    Is there a background process that processes the data for this?

    I can see there is a countly_drill database, but no collections. Would this be a cause for the Session History not showing under a User Profile? Does the data originate from this database?

    Looking under Management, the Plugins for Drill Segmentation and User Profiles are both enabled.

    Comment actions Permalink
  • Just an update, it appears that the database user didn't have access to the countly_drill database.

    After getting this updated, I can now see the Session History against the User Profile. Hope this helps someone else with the issue.

    Is there anything else I should be aware of in this regards? If not, thanks for the pointer, helped isolate and troubleshoot.

    Comment actions Permalink
  • Ok, great it is resolved

    Per securing MongoDB guide:

    you should also add same user to countly_fs database too

    Comment actions Permalink
  • Thanks, yes we have already done that as well. After realizing it was potentially related to the permissions we reviewed the documentation and found that there was also a countly_fs database too. We have now authorized access to all 3 databases.

    Comment actions Permalink

Please sign in to leave a comment.