Skip to content

Commit a4f0268

Browse files
authored
Add portion to grab the anonymousId with npm library
1 parent 7b1f937 commit a4f0268

File tree

1 file changed

+5
-0
lines changed
  • src/connections/sources/catalog/libraries/website/javascript

1 file changed

+5
-0
lines changed

src/connections/sources/catalog/libraries/website/javascript/identity.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ analytics.user().anonymousId();
4545

4646
If the user's `anonymousId` is `null` (meaning not set) when you call this function, Analytics.js automatically generated and sets a new `anonymousId` for the user.
4747

48+
Using the npm library you'll need to grab the user's current `anonymousId` with the following:
49+
50+
```js
51+
analytics.instance?.user().anonymousId()
52+
```
4853
4954
### Refreshing the Anonymous ID
5055

0 commit comments

Comments
 (0)