Skip to content

Commit e1cd04b

Browse files
Apply suggestions from code review
1 parent c60ce06 commit e1cd04b

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

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

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ Segment also provides a Chrome web extension, [Segment Inspector](/docs/connecti
2020

2121
Solution: [Follow the Analytics.js Quickstart Guide](/docs/connections/sources/catalog/libraries/website/javascript/quickstart/)
2222

23-
## Loading Multiple Instances of Analytics.js
23+
## Loading multiple instances of Analytics.js
2424

25-
### Analytics.js Snippet Loaded More Than Once
25+
### Analytics.js snippet loaded more than once
2626

27-
It is not possible to load the Analytics.js snippet twice on the same page, even if different write keys are used. Doing so often results in errors like `Uncaught RangeError: Maximum call stack size exceeded`. However, you can conditionally set the write key based on an environment variable:
27+
You cannot load the Analytics.js snippet twice on the same page, even if different write keys are used. Doing so might result in errors like `Uncaught RangeError: Maximum call stack size exceeded`.
28+
29+
However, you can conditionally set the write key based on an environment variable:
2830

2931
Example:
3032
```js
@@ -34,11 +36,12 @@ ENV === 'production' ? writeKey = 'A' : writeKey = 'B';
3436

3537
### Multiple Versions of Analytics.js
3638

37-
It is possible to load multiple versions of Analytics.js, such as a snippet version and an npm version (with different writekeys), in the same environment without them interfering with each other. This allows the npm library and the browser snippet to coexist without conflicting.Just keep in mind the following limitations with this approach:
39+
You can load multiple versions of Analytics.js in the same environment. For example, you could have both a snippet version and an npm version on one page, each with different write keys. This allows the npm library and the browser snippet to coexist without conflicting.
3840

39-
**1. Device-Mode Destination Conflicts**: If you are using the same device-mode destination in both instances (i.e., across different writekeys), conflicts may occur. This is due to third-party scripts that don't support global instances. To avoid issues, ensure you are not using the same device-mode destination between different write keys.
41+
Keep the following limitations in mind:
4042

41-
**2. CDN URL Customization:** We currently do not support overriding the CDNURL when using multiple instances of Analytics.js.
43+
- **Device-Mode Destination Conflicts**: If you are using the same device-mode destination in both instances (for example, across different write keys), conflicts may occur. This is due to third-party scripts that don't support global instances. To avoid issues, ensure you are not using the same device-mode destination with different write keys.
44+
- **CDN URL Customization:** Segment does not support overriding the CDNURL when using multiple instances of Analytics.js.
4245

4346
## Do you see events appear in your debugger?
4447

0 commit comments

Comments
 (0)