You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/connections/sources/catalog/libraries/website/javascript/index.md
+12-12Lines changed: 12 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ Analytics.js 2.0, the latest version of Segment's JavaScript source, enables you
12
12
13
13
> info ""
14
14
> Analytics.js 2.0 is available as an [open-source project](https://github.com/segmentio/analytics-next/){:target="_blank"}.
15
-
> <br><br> All sources created on April 5, 2022 and after default to use Analytics.js 2.0.
15
+
> <br><br> All sources created on April 5, 2022 and after default to use Analytics.js 2.0.
16
16
17
17
18
18
## Benefits of Analytics.js 2.0
@@ -43,7 +43,7 @@ Use the [Analytics.js QuickStart Guide](/docs/connections/sources/catalog/librar
43
43
44
44
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).
45
45
46
-
### Upgrade your existing Javascript sources
46
+
### Upgrade your existing JavaScript sources
47
47
48
48
For information about upgrading your existing JavaScript sources, see [Upgrade to Analytics.js 2.0](/docs/connections/sources/catalog/libraries/website/javascript/upgrade-to-ajs2).
`form(s)` | | Element or Array | The form element to track or an array of form elements or jQuery objects. _Note: trackForm takes an element, not a CSS selector._
188
-
`event` | | Element or Array | The form element to track or an array of form elements or jQuery objects. _Note: trackForm takes an element, not a CSS selector._
189
-
`form(s)` | | Element or Array | The form element to track or an array of form elements or jQuery objects. _Note: trackForm takes an element, not a CSS selector._
188
+
`event` | | String or Function | 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.
190
189
`properties` | optional | Object or Function | 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.
191
190
191
+
192
192
Example:
193
193
194
194
```js
@@ -302,7 +302,7 @@ Find more details about `group`, including the `group` payload, in [the Group Sp
302
302
303
303
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.
304
304
305
-
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?-->
305
+
This is an advanced method, but it is required to manage user identities successfully in *some*Segment destinations like[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?-->
306
306
307
307
The Alias method follows the format below:
308
308
@@ -319,7 +319,7 @@ Field | | Type | Description
319
319
`options` | optional | Object | A dictionary of options. For example, [enable or disable specific destinations](#managing-data-flow-with-the-integrations-object) for the call.
320
320
`callback` | optional | Function | A function that is executed after a short timeout, giving the browser time to make outbound requests first.
321
321
322
-
For more details about Alias, including the **`alias` call payload**, check out our [Spec](/docs/connections/spec/alias/).
322
+
For more details about Alias, including the **`alias` call payload**, check out the [Segment Spec](/docs/connections/spec/alias/).
323
323
324
324
325
325
## Utility Methods
@@ -418,7 +418,7 @@ analytics.timeout(500);
418
418
```
419
419
420
420
> success "Tip"
421
-
> If you're triggering ad network conversion pixels, we recommend extending timeout to 500ms to account for slow load times.
421
+
> If you're triggering ad network conversion pixels, Segment recommends extending timeout to 500ms to account for slow load times.
422
422
423
423
424
424
### Reset or Logout
@@ -478,7 +478,7 @@ You don't need to include `'All': true` in this call because it is implied as th
478
478
Destination flags are **case sensitive** and match [the destination's name in the docs](/docs/connections/destinations/) (for example, "AdLearn Open Platform", "awe.sm", "Mailchimp", etc). If a Destination has more than one acceptable name, this appears in the documentation for that destination.
479
479
480
480
> success "Tip"
481
-
> Business tier customers can filter Track calls from the Source Schema page in the Segment UI. We recommend that you use the UI to simplify filter management and make updates without changing your site's code.
481
+
> Business tier customers can filter Track calls from the Source Schema page in the Segment UI. Segment recommends that you use the UI to simplify filter management and make updates without changing your site's code.
You can check to see if batching works by checking your source's debugger in **Sources > Debugger**. When you select an event and view the **Raw** code, the `receivedAt` time of all the events in the batch should be the same.
554
554
555
555
#### Batch size
556
-
The batch size is the threshold that forces all batched events to be sent once it's reached. For example, `size: 10` means that after triggering 10 events, Analytics.js sends those 10 events together as a batch to Segment.
556
+
The batch size is the threshold that forces all batched events to be sent once it's reached. For example, `size: 10` means that after triggering 10 events, Analytics.js sends those 10 events together as a batch to Segment.
557
557
558
558
Your total batched events can't exceed the maximum payload size of 500 KB, with a limit of 32 KB for each event in the batch. If the 500 KB limit is reached, the batch will be split.
0 commit comments