👾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

Last updated