lib/countly.js
function reportViewDuration(){
        if(lastView){
            if(!platform){
                getMetrics();
            }
            var segments = {
                "name": lastView,
                "segment":platform
            };

            //track pageview
            if(Countly.check_consent("views")){
                add_cly_events({
                    "key": "[CLY]_view",
                    "dur": getTimestamp() - lastViewTime,
                    "segmentation": segments
                });
            }
            lastView = null;
        }
    }
function reportViewDuration(){
        if(lastView){
            if(!platform){
                getMetrics();
            }
            var segments = {
                "name": lastView,
                "segment":platform
            };

            //track pageview
            if(Countly.check_consent("views")){
                add_cly_events({
                    "key": "[CLY]_view",
                    "dur": getTimestamp() - lastViewTime,
                    "segmentation": segments
                });
            }
            lastView = null;
        }
    }
PRIVATE METHODS