snowplow/snowplow-javascript-tracker

View on GitHub
api-docs/docs/browser-tracker/markdown/browser-tracker.addglobalcontexts.md

Summary

Maintainability
Test Coverage
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@snowplow/browser-tracker](./browser-tracker.md) &gt; [addGlobalContexts](./browser-tracker.addglobalcontexts.md)

## addGlobalContexts() function

All provided contexts will be sent with every event

<b>Signature:</b>

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

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  contexts | Array&lt;ConditionalContextProvider \| ContextPrimitive&gt; | An array of contexts or conditional contexts |
|  trackers | Array&lt;string&gt; | The tracker identifiers which the global contexts will be added to |

<b>Returns:</b>

void