Skip to content

Commit 8a3ba7f

Browse files
stayseesongrchinn1
andauthored
Apply suggestions from code review
Co-authored-by: rchinn1 <93161299+rchinn1@users.noreply.github.com>
1 parent a58ffdb commit 8a3ba7f

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ The Identify call has the following fields:
7171
| `callback` | optional | Function | A function executed after a timeout of 300 ms, giving the browser time to make outbound requests first. |
7272

7373

74-
If you want to set the `userId` without sending an identify call, you can use `analytics.user().id('123')`. On the NPM package, use `analytics.instance.user().id(xxx)`. This method updates the stored `userId` locally without triggering a network request. This is helpful if you want to associate a user ID silently, without sending additional data to Segment or connected destinations. Be cautious when changing the `userId` mid-session to avoid double-counting users or splitting their identity history.
74+
If you want to set the `userId` without sending an identify call, you can use `analytics.user().id('123')`. In the NPM package, use `analytics.instance.user().id(xxx)`. This method updates the stored `userId` locally without triggering a network request. This is helpful if you want to associate a user ID silently, without sending additional data to Segment or connected destinations. Be cautious when changing the `userId` mid-session to avoid double-counting users or splitting their identity history.
7575

7676
By default, Analytics.js caches traits in the browser's `localStorage` and attaches them to each Identify call.
7777

src/connections/spec/best-practices-identify.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ The Segment ID cookie is set with a one year expiration. However, there are some
312312
- If you invoke any call before you set an `anonymousId`, Segment automatically sets the `anonymousId` first. This means if you explicitly set an `anonymousId`, you might give the user two `anonymousId`s or overwrite an existing one.
313313
- If you fetch the `anonymousId` using `analytics.user().anonymousId()` before one is set, Segment generates and sets an `anonymousId` rather than returning `null`.
314314
- If you call `analytics.identify()` with a `userId` that is different from the currently cached `userId`, this can overwrite the existing one and cause attribution problems.
315-
- If you call `analytics.identify(xxx)` or `analytics.instance.user().id(xxx)`(On the NPM package, use `analytics.instance.user().id(xxx)`) with a `userId` that is different from the currently cached `userId`, this can overwrite the existing one and cause attribution problems.
315+
- If you call `analytics.identify(xxx)` or `analytics.instance.user().id(xxx)`(In the NPM package, use `analytics.instance.user().id(xxx)`) with a `userId` that is different from the currently cached `userId`, this can overwrite the existing one and cause attribution problems.
316316
- If you generate a new `anonymousId` on a server library, and pass it from the server to the browser, this could overwrite the user's existing `anonymousId`.
317317

318318

src/guides/usage-and-billing/mtus-and-throughput.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ Check to see if you changed how you call `analytics.reset()`. This utility metho
182182

183183
#### Overwriting an existing identity
184184

185-
Segment’s analytics libraries include methods that allow you to overwrite both the `userId` (using `identify(xxx)` or `analytics.instance.user().id(xxx)`) and `anonymousId` (using `analytics.user().anonymousId(xxx)`).Using these methods on a user whose tracking information already includes an ID can cause the user to be counted more than once.
185+
Segment’s analytics libraries include methods that allow you to overwrite both the `userId` (using `identify(xxx)` or `analytics.instance.user().id(xxx)`) and `anonymousId` (using `analytics.user().anonymousId(xxx)`). Using these methods on a user whose tracking information already includes an ID can cause the user to be counted more than once.
186186

187187
If you find you need to use one of these overwrite methods, you should check to make sure that the field you are changing is `null` first. If the field is _not_ null, you probably don't want to overwrite it and lose the user's original tracked identity.
188188

0 commit comments

Comments
 (0)