Skip to content

Commit 40d04a9

Browse files
authored
Merge pull request #1457 from segmentio/pj/ajs-next-manual-upgrade
updating the docs to account for edge cases that require manual upgrade
2 parents 5a7b8b0 + 5dac102 commit 40d04a9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/connections/sources/catalog/libraries/website/javascript/analytics-js-2.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,19 @@ Once enabled, after 5 minutes or less, the updated code is delivered.
4242

4343
To revert back to the previous version of Analytics.js, disable the Analytics 2.0 toggle on any source you've enabled it.
4444

45+
## Cases that require manual upgrade
46+
We identified the following two cases where upgrading Analytics 2.0 requires manual effort beyond just enabling the Analytics 2.0 toggle.
47+
48+
### When using in-domain instrumentation CDN aliasing
49+
If your source uses the in-domain instrumentation as well as a custom "Alias for analytics.js", then you should update the AJS snippet to the latest version (4.13.2
50+
or higher) before toggling Analytics 2.0 on.
51+
52+
### When using a strict content security policy on the page
53+
Analytics 2.0 asynchronously loads different pieces of the library as needed, and therefore, if your source uses a strict Content Security Policy (CSP) that allows Javascript to be downloaded from specific locations, then you need to update the CSP to account for all the pieces used for Analytics 2.0. Therefore, beyond allowing the main analytics.min.js script, you should allow the following paths in your CSP:
54+
- `https://cdn.segment.com/v1/projects/<WRITE_KEY>/settings`
55+
- `https://cdn.segment.com/analytics-next/bundles/*`
56+
- `https://cdn.segment.com/next-integrations/integrations/*`
57+
4558
## Open source libraries
4659

4760
Analytics.js 2.0 includes the following open source components:

0 commit comments

Comments
 (0)