Allow a context generator to return an array object for use in addGlobalContexts()
#1137
Labels
type:enhancement
New features or improvements to existing features.
Is your feature request related to a problem? Please describe.
I may have multiple global contexts that depend on some globalstate/the event type/schema etc. Currently to have multiple global contexts be dynamically generated I have to create a generating function for each context and then combine them in an array in the
addGlobalContexts()
call, as a single generating function that returns a list does not work (no contexts are tracked).Describe the solution you'd like
addGlobalContexts()
to take as an input acontextGenerator
type function that returns an array objectDescribe alternatives you've considered
Creating multiple
contextGenerator
type functions and passing an array of them toaddGlobalContexts()
e.g.addGlobalContexts([contextGenerator1, contextGenerator2, ...])
Additional context
Relevant docs https://docs.snowplow.io/docs/collecting-data/collecting-from-own-applications/javascript-trackers/browser-tracker/browser-tracker-v3-reference/tracking-events/#context-generators
The text was updated successfully, but these errors were encountered: