Skip to content

Commit b77176e

Browse files
committed
init ajs 2 doc
1 parent ddeab82 commit b77176e

File tree

3 files changed

+74
-0
lines changed

3 files changed

+74
-0
lines changed

src/_data/sidenav/strat.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ sections:
8383
section:
8484
- path: /connections/sources/catalog/libraries/website/javascript
8585
title: Analytics.js (Javascript) Source
86+
- path: /docs/connections/sources/catalog/libraries/website/javascript/analytics-js-2
87+
title: Analytics.js 2.0 (Beta)
8688
- path: /connections/sources/catalog/libraries/website/javascript/supported-browsers
8789
title: Analytics.js supported browsers
8890
- path: /connections/sources/catalog/libraries/website/javascript/quickstart
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
---
2+
title: Analytics.js 2.0 (Beta)
3+
strat: ajs
4+
---
5+
Analytics.js is Segment's most popular library source. This new major version has been re-engineered to be more performant and provide greater extensibility. It is fully backwards compatible with the previous version of Analytics.js.
6+
7+
## Benefits of Analytics.js 2.0
8+
9+
The Analytics.js 2.0 Beta provides two key benefits over the previous version.
10+
11+
### Performance
12+
13+
Analytics.js 2.0 provides a reduction in page load time, which improves overall site performance. Its package size is **~70%** smaller than the previous Analytics.js.
14+
15+
> info ""
16+
> There are many factors that impact page load time, including page weight, network conditions, and hosting locations.
17+
18+
### Developer experience
19+
20+
Analytics.js 2.0 introduces new ways for developers to augment events throughout the event timeline. This enables teams to support:
21+
22+
- New privacy and consent controls before an event occurs
23+
- Enriching events with additional customer or page context in-flight using middleware
24+
- Collecting better metrics related to deliverability *after* a message is sent
25+
26+
## Start using Analytics.js 2.0
27+
28+
Analytics.js is released as a Public Beta, on an opt-in basis, *per source*. The updated code is delivered through your existing snippet, so there's no need to update code on your site.
29+
30+
To opt in:
31+
32+
1. Navigate to the **Settings** tab of the javascript source you want to enable.
33+
2. Enable the Analytics 2.0 toggle.
34+
35+
Once enabled, after 5 minutes or less, the updated code is delivered.
36+
37+
## Disable Analytics.js 2.0
38+
39+
To revert back to the previous version of Analytics.js, disable the Analytics 2.0 toggle on any source you've enabled it.
40+
41+
## Open source libraries
42+
43+
Analytics.js 2.0 includes the following open source components:
44+
45+
**uuid v2.0.0** ([https://github.com/lukeed/uuid](https://github.com/lukeed/uuid))
46+
Copyright Luke Edwards <[[email protected]](mailto:[email protected])> ([lukeed.com](lukeed.com))
47+
License: MIT License, available here: [https://github.com/lukeed/uuid/blob/master/license](https://github.com/lukeed/uuid/blob/master/license)
48+
49+
**component-url v0.2.1** ([https://github.com/component/url](https://github.com/component/url))
50+
Copyright (c) 2014 Component
51+
License: MIT License, available here: [https://github.com/component/url/blob/master/Readme.md](https://github.com/component/url/blob/master/Readme.md)
52+
53+
**dset v2.0.1** ([https://github.com/lukeed/dset](https://github.com/lukeed/dset))
54+
Copyright (c) Luke Edwards <[[email protected]](mailto:[email protected])> ([lukeed.com](lukeed.com))
55+
License: MIT License, available here: [https://github.com/lukeed/dset/blob/master/license](https://github.com/lukeed/dset/blob/master/license)
56+
57+
**js-cookie v2.2.1**
58+
Copyright (c) 2018 Copyright 2018 Klaus Hartl, Fagner Brack, GitHub Contributors
59+
  License: MIT License, available here: [https://github.com/js-cookie/js-cookie/blob/master/LICENSE](https://github.com/js-cookie/js-cookie/blob/master/LICENSE)
60+
61+
**md5 v2.3.0** ([https://github.com/pvorb/node-md5](https://github.com/pvorb/node-md5))
62+
Copyright (c) 2011-2012, Paul Vorbach.
63+
Copyright (c) 2009, Jeff Mott.
64+
License: BSD-3-Clause “New” or “Revised” License, available at:
65+
[https://github.com/pvorb/node-md5/blob/master/LICENSE](https://github.com/pvorb/node-md5/blob/master/LICENSE)
66+
67+
**unfetch v4.1.0** ([https://github.com/developit/unfetch](https://github.com/developit/unfetch))
68+
Copyright (c) 2017 Jason Miller
69+
License: MIT License, available at: [https://github.com/developit/unfetch/blob/master/LICENSE.md](https://github.com/developit/unfetch/blob/master/LICENSE.md)

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ strat: ajs
99

1010
Analytics.js, Segment's Javascript source, makes it simple to send your data to any tool without having to learn, test or implement a new API every time.
1111

12+
> info "Analytics.js 2.0 Beta"
13+
> A new version of Analytics.js is available for use in Beta. Click [here](/docs/connections/sources/catalog/libraries/website/javascript/analytics-js-2.md) for more information.
14+
1215
## Getting Started
1316

1417
Read through the [Analytics.js QuickStart Guide](/docs/connections/sources/catalog/libraries/website/javascript/quickstart/) which explains how to add Analytics.js to your site in just a few minutes. Once you've installed the library, read on for the detailed API reference!

0 commit comments

Comments
 (0)