![]() ![]() Upon receiving the beforeunload browser event, Analytics.js attempts to flush the queue using fetch requests with keepalive set to true. Batching FAQs Will Analytics.js deliver events that are in the queue when a user closes the browser?Īnalytics.js does its best to deliver the queued events before the browser closes, but the delivery isn’t guaranteed. For example, timeout: 5000 sends every event in the batch to Segment once 5 seconds passes. Timeout is the number of milliseconds that forces all events queued for batching to be sent, regardless of the batch size, once it’s reached. If the 500 KB limit is reached, the batch will be split. 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. For example, size: 10 means that after triggering 10 events, Analytics.js sends those 10 events together as a batch to Segment. The batch size is the threshold that forces all batched events to be sent once it’s reached. When you select an event and view the Raw code, the receivedAt time of all the events in the batch should be the same. You can check to see if batching works by checking your source’s debugger in Sources > Debugger. Note: If you do not pass a traits object, pass an empty object (as an ‘) For example, enable or disable specific destinations for the call. You can read more about traits in the identify reference.Ī dictionary of options. You can read more about identities in the identify reference.Ī dictionary of traits you know about the user, like email or name. If you don’t know who the user is yet, you can omit the userId and just record traits. The Identify call has the following fields: Field ![]() The documentation on this page explains how to use these methods in Analytics.js.Īnalytics. These methods correspond with those used in the Segment Spec. ![]() They include Identify, Track, Page, Group, and Alias. The basic tracking methods below serve as the building blocks of your Segment tracking. Upgrade your existing JavaScript sourcesįor information about upgrading your existing JavaScript sources, see Upgrade to Analytics.js 2.0. Once you’ve installed the library, read on for the detailed API reference.įor information about upgrading to Analytics.js 2.0, see Upgrade to Analytics.js 2.0. Use the Analytics.js QuickStart Guide to learn how to add Analytics.js to your site.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |