Skip to content

Commit 1ec2d27

Browse files
authored
Updated Insight Code for clear authentication token
1 parent fd6a589 commit 1ec2d27

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

view/frontend/web/insights.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,11 @@ define(
5858
algoliaAnalytics.addAlgoliaAgent(userAgent);
5959

6060
var userToken = getCookie('aa-search');
61+
var unsetAuthenticationToken = getCookie('unset_authentication_token');
6162
if (userToken && userToken !== '') {
6263
algoliaAnalytics.setAuthenticatedUserToken(userToken);
64+
} else if (unsetAuthenticationToken && unsetAuthenticationToken !== '') {
65+
algoliaAnalytics.setAuthenticatedUserToken('undefined');
6366
}
6467
},
6568

0 commit comments

Comments
 (0)