Developer Docs
Search…
API
🔓
Authentication
⚡
Events
Javascript SDK
👾
Get Session ID
Powered By
GitBook
👾
Get Session ID
The visitor ID will be automatically stored in the
dataLayer
under the attribute name
w_session_id
as soon as the SDK loads
How to retrieve the visitor ID:
setInterval
(
function
()
{
var
dataLayer
=
window
.
dataLayer
;
var
isDefined
=
dataLayer
&&
dataLayer
.
find
(
item
=>
!!
item
.
w_session_id
);
var
visitorId
=
isDefined
&&
isDefined
.
w_session_id
;
},
1000
)
For more info on the dataLayer:
https://developers.google.com/tag-platform/tag-manager/web/datalayer
API - Previous
Events
Last modified
5mo ago
Copy link
Outline