You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/connections/sources/catalog/libraries/website/javascript/troubleshooting.md
+9-6Lines changed: 9 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,11 +20,13 @@ Segment also provides a Chrome web extension, [Segment Inspector](/docs/connecti
20
20
21
21
Solution: [Follow the Analytics.js Quickstart Guide](/docs/connections/sources/catalog/libraries/website/javascript/quickstart/)
22
22
23
-
## Loading Multiple Instances of Analytics.js
23
+
## Loading multiple instances of Analytics.js
24
24
25
-
### Analytics.js Snippet Loaded More Than Once
25
+
### Analytics.js snippet loaded more than once
26
26
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:
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.
38
40
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:
40
42
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.
0 commit comments