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
@@ -461,11 +460,6 @@ The `reset` method only clears the cookies and `localStorage` created by Segment
461
460
462
461
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.
463
462
464
-
### Keepalive
465
-
466
-
You can utilize this in instances where an API call fires on a hard redirect, and are missed from getting captured in Segment. If you set this flag to true, it enables firing the event before the redirect. This is available for all events. You can read more about this in the [Github PR](https://github.com/segmentio/analytics-next/issues/768#issuecomment-1386100830){:target="_blank"}.
467
-
468
-
469
463
## Managing data flow with the Integrations object
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.
@@ -588,6 +582,52 @@ When enabled, Analytics.js automatically retries network and server errors. With
588
582
589
583
Analytics.js stores events in `localStorage` and falls back to in-memory storage when `localStorage` is unavailable. It retries up to 10 times with an incrementally increasing back-off time between each retry. Analytics.js queues up to 100 events at a time to avoid using too much of the device's local storage. See the [destination Retries documentation](/docs/connections/destinations/#retries) to learn more.
590
584
585
+
## Delivery strategy configuration
586
+
587
+
The `deliveryStrategy.config` object lets you customize how data is delivered to Segment. This includes options like setting custom headers and enabling `keepalive` to capture events during hard redirects.
588
+
589
+
### Adding custom headers
590
+
591
+
You can override default headers by providing custom headers in your configuration. Use the `deliveryStrategy.config.headers` option to specify the headers, like in the following example:
Bydefault, `keepalive`issettofalse, becauseallfetchrequestswiththe`keepalive`flagaresubjecttoa 64kbsizelimit. Additionally, `keepalive`requestssharethissizelimitwithallotherin-flight`keepalive`requests, regardlessofwhetherthey're related to Segment. This competition for resources can lead to data loss in some scenarios.
0 commit comments