snowplow/snowplow-javascript-tracker

View on GitHub
api-docs/docs/browser-tracker/markdown/browser-tracker.setuserid.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; [setUserId](./browser-tracker.setuserid.md)

## setUserId() function

Set the business-defined user ID for this user.

<b>Signature:</b>

```typescript
declare function setUserId(userId?: string | null, trackers?: Array<string>): void;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  userId | string \| null | The business-defined user ID |
|  trackers | Array&lt;string&gt; | The tracker identifiers which will be configured |

<b>Returns:</b>

void