Skip to main content

browser-tracker.addglobalcontexts

Home > @snowplow/browser-tracker > addGlobalContexts

addGlobalContexts() function

All provided contexts will be sent with every event

Signature:
declare function addGlobalContexts(contexts: Array<ConditionalContextProvider | ContextPrimitive> | Record<string, ConditionalContextProvider | ContextPrimitive>, trackers?: Array<string>): void;

Parameters

ParameterTypeDescription
contextsArray<ConditionalContextProvider | ContextPrimitive> | Record<string, ConditionalContextProvider | ContextPrimitive>An array of contexts or conditional contexts
trackersArray<string>The tracker identifiers which the global contexts will be added to
Returns:

void