Skip to content

Commit cc5341e

Browse files
committed
partial vale [netlify-ignore]
1 parent 5a3be85 commit cc5341e

File tree

1 file changed

+22
-22
lines changed
  • src/connections/sources/catalog/libraries/website/javascript

1 file changed

+22
-22
lines changed

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

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ Analytics.js 2.0 provides a reduction in page load time, which improves site per
3030
Analytics.js 2.0 introduces new ways for developers to augment events throughout the event timeline. This enables teams to support:
3131

3232
- New privacy and consent controls before an event occurs
33-
- Enriching events with additional customer or page context in-flight using middleware
33+
- Enriching events with customer or page context in-flight using middleware
3434
- Collecting better metrics related to deliverability *after* a message is sent
3535

3636
## Getting Started
3737

38-
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!
38+
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. Once you've installed the library, read on for the detailed API reference!
3939

4040
For information about upgrading to Analytics.js 2.0, see [Upgrade to Analytics.js 2.0](/docs/connections/sources/catalog/libraries/website/javascript/upgrade-to-ajs2).
4141

@@ -57,7 +57,7 @@ These names might be familiar, because they are the basic methods covered by the
5757
The `identify` method is how you link your users, and their actions, to a recognizable `userId` and `traits`. You can see [an `identify` example in the Quickstart guide](/docs/connections/sources/catalog/libraries/website/javascript/quickstart/#step-3-identify-users) or [find details on the identify method payload](/docs/connections/spec/identify/).
5858

5959
> note ""
60-
> Segment recommends _against_ using `identify` for anonymous visitors to your site. Analytics.js automatically retrieves an `anonymousId` from localStorage or assigns one for new visitors, which is attached to all `page` and `track` events both before and after an `identify`.
60+
> Segment recommends _against_ using `identify` for anonymous visitors to your site. Analytics.js automatically retrieves an `anonymousId` from localStorage or assigns one for new visitors, and attaches it to all `page` and `track` events both before and after an `identify`.
6161
6262
The Identify method follows the format below:
6363

@@ -95,7 +95,7 @@ The Identify call has the following fields:
9595
</table>
9696

9797

98-
By default, traits are cached in the browser's `localStorage` and are attached to each subsequent Identify call.
98+
By default, Analytics.js caches traits in the browser's `localStorage` and are attaches them to each Identify call.
9999

100100
For example, you might call Identify when someone signs up for a newsletter, but hasn't yet created an account on your site. The example below shows an Identify call (using hard-coded traits) that you might send in this case.
101101
```js
@@ -143,7 +143,7 @@ The `track` call has the following fields:
143143
<td>`event`</td>
144144
<td></td>
145145
<td>String</td>
146-
<td>The name of the event you're tracking. You can read more about the [track method](/docs/connections/spec/track) and what event names we recommend.</td>
146+
<td>The name of the event you're tracking. You can read more about the [track method](/docs/connections/spec/track) and recommended event names.</td>
147147
</tr>
148148
<tr>
149149
<td>`properties`</td>
@@ -161,7 +161,7 @@ The `track` call has the following fields:
161161
<td>`callback`</td>
162162
<td>optional</td>
163163
<td>Function</td>
164-
<td>A function that is executed after a short timeout, giving the browser time to make outbound requests first.</td>
164+
<td>A function that runs after a short timeout, giving the browser time to make outbound requests first.</td>
165165
</tr>
166166
</table>
167167

@@ -184,7 +184,7 @@ The only required argument on Track calls in Analytics.js is an `event` name str
184184
#### Track Link
185185

186186
`trackLink` is a helper method that attaches the `track` call as a handler to a link.
187-
With `trackLink` a short timeout (300 ms) is inserted to give the `track` call more time. This is useful when a page would redirect before the `track` method could complete all requests.
187+
With `trackLink`, Analytics.js inserts a short timeout (300 ms) to give the `track` call more time. This is useful when a page would redirect before the `track` method could complete all requests.
188188

189189
The `trackLink` method follows the format below.
190190

@@ -196,17 +196,17 @@ analytics.trackLink(element, event, [properties])
196196
<tr>
197197
<td>`element(s)` </td>
198198
<td>Element or Array</td>
199-
<td>DOM element to be bound with `track` method. You may pass an array of elements or jQuery objects. _Note: This must be an element, **not** a CSS selector._</td>
199+
<td>DOM element to bind with `track` method. You may pass an array of elements or jQuery objects. _Note: This must be an element, **not** a CSS selector._</td>
200200
</tr>
201201
<tr>
202202
<td>`event` </td>
203203
<td>String or Function</td>
204-
<td>The name of the event, passed to the `track` method. Or a **function** that returns a string to be used as the name of the `track` event.</td>
204+
<td>The name of the event, passed to the `track` method. Or a **function** that returns a string to use as the name of the `track` event.</td>
205205
</tr>
206206
<tr>
207207
<td>`properties` optional</td>
208208
<td>Object or Function</td>
209-
<td>A dictionary of properties to pass with the track method. Or a **function** that returns an object to be used as the `properties` of the event.</td>
209+
<td>A dictionary of properties to pass with the track method. Or a **function** that returns an object to use as the `properties` of the event.</td>
210210
</tr>
211211
</table>
212212

@@ -240,12 +240,12 @@ analytics.trackForm(form, event, [properties])
240240
<tr>
241241
<td>`event` </td>
242242
<td>String or Function</td>
243-
<td>The name of the event, passed to the `track` method. Or a **function** that returns a string to be used as the name of the `track` event.</td>
243+
<td>The name of the event, passed to the `track` method. Or a **function** that returns a string to use as the name of the `track` event.</td>
244244
</tr>
245245
<tr>
246246
<td>`properties` optional</td>
247247
<td>Object or Function</td>
248-
<td>A dictionary of properties to pass with the track method. Or a **function** that returns an object to be used as the `properties` of the event.</td>
248+
<td>A dictionary of properties to pass with the track method. Or a **function** that returns an object to use as the `properties` of the event.</td>
249249
</tr>
250250
</table>
251251

@@ -262,11 +262,11 @@ analytics.trackForm(form, 'Signed Up', {
262262

263263
### Page
264264

265-
The [Page](/docs/connections/spec/page/) method lets you record page views on your website, along with optional extra information about the page being viewed.
265+
The [Page](/docs/connections/spec/page/) method lets you record page views on your website, along with optional extra information about the page viewed by the user.
266266

267267
Because some destinations require a `page` call to instantiate their libraries, **you must call `page`** at least once per page load. You can call it more than once if needed, for example on virtual page changes in a single page app.
268268

269-
A Page call is included by default as the final line in [the Analytics.js snippet](/docs/connections/sources/catalog/libraries/website/javascript/quickstart/#step-2-copy-the-segment-snippet). You can modify this `page` call within the guidelines below.
269+
Analytics.js includes a Page call by default as the final line in [the Analytics.js snippet](/docs/connections/sources/catalog/libraries/website/javascript/quickstart/#step-2-copy-the-segment-snippet). You can update this `page` call within the guidelines below.
270270

271271
The `page` method follows the format below.
272272

@@ -293,7 +293,7 @@ The `page` call has the following fields:
293293
<td>`properties`</td>
294294
<td>optional</td>
295295
<td> Object </td>
296-
<td>A dictionary of properties of the page. Note: `url`, `title`, `referrer` and `path` are collected automatically! Additionally this defaults to a `canonical url`, if available, and falls back to `document.location.href`.</td>
296+
<td>A dictionary of properties of the page. Note: Analytics.js collects `url`, `title`, `referrer` and `path` are automatically. This defaults to a `canonical url`, if available, and falls back to `document.location.href`.</td>
297297
</tr>
298298
<tr>
299299
<td>`options`</td>
@@ -305,20 +305,20 @@ The `page` call has the following fields:
305305
<td>`callback`</td>
306306
<td>optional</td>
307307
<td>Function</td>
308-
<td>A function that is executed after a short timeout, giving the browser time to make outbound requests first.</td>
308+
<td>A function that runs after a short timeout, giving the browser time to make outbound requests first.</td>
309309
</tr>
310310
</table>
311311

312312

313313
#### Default Page Properties
314314

315-
A few properties are automatically added to each `page` call.
315+
Analytics.js adds some properties to each `page` call.
316316

317317
```js
318318
analytics.page('Pricing');
319319
```
320320

321-
Segment adds the following information without any extra work from you:
321+
Segment adds the following information:
322322

323323
```js
324324
analytics.page('Pricing', {
@@ -385,7 +385,7 @@ The Group call has the following fields:
385385
<td>`callback`</td>
386386
<td>optional</td>
387387
<td>Function</td>
388-
<td>A function that is executed after a short timeout, giving the browser time to make outbound requests first.</td>
388+
<td>A function that runs after a short timeout, giving the browser time to make outbound requests first.</td>
389389
</tr>
390390
</table>
391391

@@ -401,13 +401,13 @@ analytics.group('UNIVAC Working Group', {
401401
});
402402
```
403403

404-
By default, group `traits` are cached in the browser's local storage and attached to each subsequent `group` call, similar to how the `identify` method works.
404+
By default, Analytics.js caches group `traits` in the browser's local storage and attaches them to each `group` call, similar to how the `identify` method works.
405405

406406
Find more details about `group` including the **`group` payload** in [the Group Spec](/docs/connections/spec/group/).
407407

408408
### Alias
409409

410-
The Alias method combines two previously unassociated user identities. Segment usually handles aliasing automatically when you call Identify on a user, however some tools require an explicit `alias` call.
410+
The Alias method combines two unassociated user identities. Segment usually handles aliasing automatically when you call Identify on a user, however some tools require an explicit `alias` call.
411411

412412
This is an advanced method, but it is required to manage user identities successfully in *some* of our destinations such as [Kissmetrics](/docs/connections/destinations/catalog/kissmetrics/#alias) and [Mixpanel](/docs/connections/destinations/catalog/mixpanel/#alias). <!-- TODO: LR Dests question: is this still true? Is there a list of the ones that require this?-->
413413

@@ -633,7 +633,7 @@ analytics.load('writekey', { integrations: { All: false, 'Google Analytics': tru
633633
```
634634

635635
> info ""
636-
> **Note:** To use this feature, you must be on snippet version 4.1.0 or later. You can get the latest version of the snippet [here](https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/quickstart/#step-2-copy-the-segment-snippet).
636+
> **Note:** To use this feature, you must be on snippet version 4.1.0 or later. You can get the latest version of the snippet [here](/docs/connections/sources/catalog/libraries/website/javascript/quickstart/#step-2-copy-the-segment-snippet).
637637
638638
This way, you can conditionally load integrations based on what customers opt into on your site. The example below shows how you might load only the tools that the user agreed to use.
639639

0 commit comments

Comments
 (0)