Domain_userid || '-' || domain_sessionidx vs. domain_sessionid


#1

Are there any differences between these two ways of identifying a session? If so, is there any reason I should use one over the other? The former seems far more common in SQL examples on discourse and in the Looker block.


#2

Hi @dweitzenfeld,

The two methods should be the same. The reason most of our documentation uses the index, rather than the ID, is that the ID was introduced much later.

Christophe


#3

@christophe When was domain_sessionid introduced? We’re looking into sessionization and wondering if we should use the concat of domain_userid||domain_sessionidx vs. using domain_sessionid

I assume this is also why domain_sessionid is null in our atomic.events table. Is that a configuration that we enable in the ETL side?


#4

Hi @crizposadas,

The domain_sessionid was introduced in version 2.5.0 of our Javascript tracker: http://snowplowanalytics.com/blog/2015/07/22/snowplow-javascript-tracker-2.5.0-released/#session-id

Each event has a field, v_tracker, that tells you the tracker version.

Knowing your case, I’d use domain_userid || domain_sessionidx, so you don’t have to distinguish between events that were sent in before 2.5.0, and after.

Hope this helps!

Christophe


#5

Hi @christophe

What is the logic used to infer both domain_sessionidx and domain_sessionid?

I have a case where 2 events separated by 23h belong to the same session according to domain_sessionidx but to different sessions based on domain_sessionid.

Thanks,
Alex