How do you know which custom contexts are attached to an event?

Let’s say you have a page_view event with a few contexts attached:

  1. weather
  2. webpage
  3. geolocation

How do you guys keep track of the contexts attached to events? Event dictionaries?

Would it make sense to have a field that lists the custom contexts on the event for discoverability later?

Hi Rob,

It’s a great question.

We don’t have a good solution at the moment. This should ideally be documented, but in general is not. The only way to tell, looking at the data, which contexts to join, is to try a join (on root_id = event_id and root_tstamp = collector_tstamp and if the join is successful then great, if not, then there isn’t the context for that event.

Going forwards we’d like us to add a field to the central events table with an array of the different contexts attached. (So you wouldn’t have to do the join.) The other piece of metadata that we’d like to attach to the data is the part of speech that each context occupies: so if one context describes the ‘subject’ of the event (i.e. the user that performed the action) then that would be stored in the data.

3 Likes

Thanks @yali - that’s pretty much how we’ve been doing it too.

It’s not a big deal as most of our events have predictable contexts.