High availability questions

@pkr2 ,

Is “**duid” in snowplow is a concept of “universally unique ID/visitor ID”?

It is the user ID set by the tracker. While it is typically stored in the first party cookie, it is set by Javascript. This means that browsers like Safari can alter its life expectancy to as low as 1 day. Alternatively, there is nuid (network_userid) set by the collector as opposed to Javascript. If the collector is on the same domain as your web application (and preferably in the same IP network) nuid will also be stored in the 1st party cookie and thus would be considered the most reliable (not a subject to browser vendor tracking prevention mechanism).

Can we use our own website visitor ID in Snowplow? We have a visitor ID on our website as well. By this, I mean that Snowplow is providing the flexibility to bring our own visitor ID ?

By all means. There is a dedicated field for that, uid (user_id). If you have a designated user ID set by your application, do use it - see https://docs.snowplow.io/docs/collecting-data/collecting-from-own-applications/javascript-trackers/javascript-tracker/javascript-tracker-v3/tracker-setup/additional-options/#setuserid.

sid” is for Session Id, whatever events are to be done by the visitor , that will be bound to the current sessionId which is running for that ?

Yes. Actually both duid (domain_userid) and sid (domain_sessionid) are stored in the same cookie as per https://docs.snowplow.io/docs/collecting-data/collecting-from-own-applications/javascript-trackers/browser-tracker/cookies-and-local-storage/. By default, the session last for 30 mins but could br changed to whatever duration is more suitable for your application.

Can we terminate or close this session ID by some kind of method so that I can set this method on my LogOut button?

Yes, you can. Depending on the version of the tracker, it looks like this

snowplow('clearUserData', { preserveSession: false, preserveUser: true});

See Need to generate new session_id if user_id changes for more details.

How can we get the auto-trigger if the session is abandoned by the visitor, which means the user has been inactive for the last 30 minutes? Is there any native method that needs to be overridden for this so that I can get the real-time trigger in my backend that the visitor has abandoned the session?

If user is inactive for longer than the session duration, the session will be reset automatically. I’m not aware of any native tracker means to detect the fact the session has expired. However, you should be able to do it client-side yourself as you have access to the session cookie with getDomainUserInfo.