Skip to content

Commit 47d59b0

Browse files
authored
DOC-296: Analytics.js 2.0 update [netlify-ignore]
1 parent 703f964 commit 47d59b0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/connections/sources/catalog/libraries/website/javascript/upgrade-to-ajs2.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ There are two cases where upgrading to Analytics.js 2.0 requires manual effort b
4141

4242
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.
4343

44+
### When relying on Analytics.js Classic's `ajs_anonymous_id` cookie format
45+
46+
Analytics.js 2.0 removes inbuilt quotes from cookie values, resulting in a different format for the `ajs_anonymous_id` value when compared to Analytics.js Classic. Though you can retrieve cookie values with [standard support functions](/docs/connections/sources/catalog/libraries/website/javascript/identity/#retrieve-the-anonymous-id), you'll need to configure your environment to accept the new format if your implementation relies on accessing the cookie value directly.
47+
4448
### When using a strict content security policy on the page
4549

4650
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:

0 commit comments

Comments
 (0)