Session duration not recorded on browser refresh and all track views are not updated on dashboard
Hey countly team, I'm facing two issues in my Web SDK integration.
- The session duration is not recorded after the browser refresh. It just stops sending session_duration just after the browser refresh.
- I am pushing track_views in Countly queues but only a few I can see on the dashboard.
Required information:
- I'm using manual sessions. Using begin_session at login and end_session on logout.
- Configurations
Countly.init({
app_key: <app_key>
debug: true,
url: <countly_url>
app_version: <app_version>
});
- track_views
router.events.subscribe((e: RouterEvent) => {
if (e instance of NavigationEnd) {
Countly.q.push(['track_pageview', e.urlAfterRedirects]);
}
});
Comments
Hi, thank you for informing us about your situation.
Regarding your first question, when you refresh your browser, Countly normally reinitializes, triggering a new begin session request if automatic sessions are enabled. If you're using manual sessions, this would depend on how you call the session methods. To observe the SDK's state, we can check the SDK logs and see what's happening before and after the refresh.
For your second question, the SDK logs can also show us if the "if check" is passed, and the SDK records the view. If the SDK works as intended, we can further evaluate the issue on your Countly Server by clarifying the expected behavior and what is actually observed.
You can access the SDK logs by following the instructions in this documentation: https://support.count.ly/hc/en-us/articles/900000908046-Getting-started-with-SDKs#web-browser
Hi Deniz,




For your second answer, "the SDK logs can also show us if the "if check" is passed"
Can you please clarify what 'if check' is to be passed?
Attaching the logs here:
Hi, thank you for sharing the screenshots. When I referred to the "if check," I meant the code snippet: "if (e instanceof NavigationEnd)." This check must pass for the view to be recorded. Based on the logs, it appears that some views have been recorded. Could you confirm whether you can see these views on your dashboard when you deselect the current session (as shown in the screenshot, where a session is currently selected)?
Hey Deniz, the "if check" is passing all the views, but views are still not being updated.

Here in the logs, you can see the view requests are being sent
But views are not being updated on the dashboard

Hi Vinay, if possible, can you please check if those views are received at Utilities > Incoming Data Logs and there is no filtering enabled at Utilities > Filtering Rules?
Hey Deniz, PFA.


Thank you. There seems to be no filtering rules enabled however it looks like the incoming data logs are disabled. Can you check if you can enable it from Management > Feature Managements?
Hey Deniz, I couldn't find the Feature Managements option in the Management tab.

Please sign in to leave a comment.