Skip to content

Commit 6c2f713

Browse files
authored
Add info about keepalive flag in AJS
1 parent 2f4908f commit 6c2f713

File tree

1 file changed

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

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ The Analytics.js utility methods help you change how Segment loads on your page.
342342
- [On (Emitter)](#emitter)
343343
- [Timeout](#extending-timeout)
344344
- [Reset (Logout)](#reset-or-log-out)
345+
- [Keepalive](#keepalive)
345346

346347
### Load
347348

@@ -472,6 +473,9 @@ The `reset` method only clears the cookies and `localStorage` created by Segment
472473

473474
Segment doesn't share `localStorage` across subdomains. If you use Segment tracking on multiple subdomains, you must call `analytics.reset()` for each subdomain to completely clear out the user session.
474475

476+
### Keepalive
477+
478+
This can be utilised in instances where an API call is firing on a hard redirect, and are being missed from getting captured in Segment, you can then set this flag to true, which enables firing the event before the redirect. This was earlier availble only for [batched events](https://segment.com/docs/connections/sources/catalog/libraries/website/javascript/#will-analyticsjs-deliver-events-that-are-in-the-queue-when-a-user-closes-the-browser), we have now made this available for all events. You can read more about this in our PR [here](https://github.com/segmentio/analytics-next/issues/768#issuecomment-1386100830)
475479

476480

477481
## Managing data flow with the Integrations object

0 commit comments

Comments
 (0)