|
1 | 1 | ---
|
2 | 2 | title: Analytics.js 2.0 (Beta)
|
3 | 3 | strat: ajs
|
4 |
| -hidden: true |
5 | 4 | ---
|
6 | 5 | > warning "Analytics.js 2.0 is recommended for use in staging"
|
7 | 6 | > Analytics.js 2.0 was built with backwards compatibility in mind. However, Segment recommends thorough testing in a Staging environment before you upgrade your production source.
|
@@ -43,14 +42,15 @@ Once enabled, after 5 minutes or less, the updated code is delivered.
|
43 | 42 | To revert back to the previous version of Analytics.js, disable the Analytics 2.0 toggle on any source you've enabled it.
|
44 | 43 |
|
45 | 44 | ## 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. |
| 45 | +There are two cases where upgrading to Analytics.js 2.0 requires manual effort beyond enabling the Analytics.js 2.0 toggle. |
47 | 46 |
|
48 | 47 | ### 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. |
| 48 | + |
| 49 | +If the source you intend to upgrade 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 or higher) before you toggle on Analytics.js 2.0. |
51 | 50 |
|
52 | 51 | ### 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: |
| 52 | + |
| 53 | +Analytics.js 2.0 asynchronously loads different pieces of the library as needed. If the source you're upgrading 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.js 2.0. Therefore, beyond allowing the main analytics.min.js script, you should allow the following paths in your CSP: |
54 | 54 | - `https://cdn.segment.com/v1/projects/<WRITE_KEY>/settings`
|
55 | 55 | - `https://cdn.segment.com/analytics-next/bundles/*`
|
56 | 56 | - `https://cdn.segment.com/next-integrations/integrations/*`
|
|
0 commit comments