documentUnloading
The documentUnloading
property allows you to use JavaScript’s sendBeacon
method to send data to Adobe. If a typical request takes too long, the browser can cancel the request. You can tell the Web SDK to use sendBeacon
so that the request runs in the background after you navigate away from the page. Enable this property to help prevent data requests from getting canceled by the browser when unloading.
Several browsers impose a limit of 64 KB to the amount of data that can be sent with sendBeacon
at one time. If the browser rejects the event because the payload is too large, the Web SDK falls back to using its normal transport method.
Configure document unloading using the Web SDK tag extension
Enable the Document will unload checkbox within the actions of a tag rule.
- Log in to experience.adobe.com using your Adobe ID credentials.
- Navigate to Data Collection > Tags.
- Select the desired tag property.
- Navigate to Rules, then select the desired rule.
- Under Actions, select an existing action or create an action.
- Set the Extension dropdown field to Adobe Experience Platform Web SDK, and set the Action Type to Send event.
- Enable the Document will unload checkbox in the Data section.
- Click Keep Changes, then run your publishing workflow.
Configure document unloading using the Web SDK JavaScript library
Set the documentUnloading
boolean when running the sendEvent
command. Its default value is false
. Set this property to true
if you want to use the sendBeacon
method to send data to Adobe.
documentUnloading
property is incompatible with the renderDecisions
property. You should not set both properties to true
simultaneously.alloy("sendEvent", {
"xdm": adobeDataLayer.getState(reference),
"documentUnloading": true
});