We have an ongoing and frequent issue with out clients saying their chats have disappeared on the help desk. These people typically come through as an ‘unknown user’. We’ve applied a feature where users are asked to imput their email address, but many of them ignore this and thus still come through as unknown and end up losing the conversation.
Following an invesitgation our developers have confirmed that HubSpot sometimes ignores the identification token we setup and uses other information gathered from the user activity on the UI.
HubSpot are not able to advise why this is happening or how to resolve.
If anybody has any guidance, this would be appreciated.
Hello!
This most likely stems from HubSpot’s visitor tracking and identity resolution logic, which—if left incomplete—relies on cookies and other context clues (like local storage or IP fingerprints) to maintain session continuity. When that identification is lost or ambiguous, HubSpot treats them as new visitors, leading to lost context and apparent disappearance of prior chats.
HubSpot does not persist chat history for unidentified users once the session cookie (hubspotutk) or sessionStorage context is lost (e.g., by refreshing, ad blockers, different browser tabs, or clearing cookies).
You also mentioned your team uses an “identification token,” but HubSpot may ignore custom identifiers unless integrated using their identify API call with the HubSpot Tracking Code via Javascript:
_hsq.push([“identify”, {
email: “user@example.com”,
firstname: “John”,
lastname: “Doe”
}]);
Even then, HubSpot may defer to its own tracking logic, especially if the cookie consent banner is in use and visitor consent hasn’t been granted to drop tracking cookies.
If you’re using HubSpot’s GDPR consent banner (enabled under Settings > Privacy & Consent), tracking will not fully engage until consent is received. This includes:
-Chat transcript history
-Contact association
-Analytics tracking
This can override your identify logic and block hubspotutk setting if consent is not granted.
HubSpot may filter out certain chats depending on visitor behavior patterns or lack of interaction with the chat widget—especially when accessed via script-injected widgets without completing the initial message.
Some suggestions I have for improvement:
Force Visitor Identification Early
Where possible, force an identification step before chat starts. You can:
Use the identify API on page load (if email is pre-known or can be captured by URL or logged-in session).
Automatically prompt users with a required pre-chat form (see below).
Use Required Pre-Chat Form
In HubSpot’s chatflow builder:
1. Open the chatflow.
2. Under “Who should see this chatflow,” ensure targeting is accurate.
3. Add a “Email” question to the chatflow before the conversation starts.
4. Set this field as required.
This step is critical because:
- It associates the conversation with a contact.
- It prevents HubSpot from falling back to anonymous tracking logic.
Handle Consent & Tracking Directly
Ensure that:
- The HubSpot tracking code is present and loads before your chat widget or any custom identify logic.
- The cookie banner explicitly grants consent before any tracking or chat initiation.
- Use addPrivacyConsentListener to conditionally run chat setup only after consent is granted:
window._hsp = window._hsp || [];
_hsp.push([‘addPrivacyConsentListener’, function (consent) {
if (consent.allowed) {
// Initialize identify or chat scripts
}
}]);
Also, If your site is single-page-app (SPA) based or does complex routing, make sure you:
Preserve the hubspotutk value across pages
Prevent client-side routers from unintentionally clearing HubSpot scripts
Let me know if any of this helps!
Was I able to help answer your question? Help the community by marking it as a solution.
| Brandon Woodruff Senior Software Developer @ PearagonStill have questions? Reach out at brandon@pearagon.com ![]() |

