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.

  1. Log in to experience.adobe.com using your Adobe ID credentials.
  2. Navigate to Data Collection > Tags.
  3. Select the desired tag property.
  4. Navigate to Rules, then select the desired rule.
  5. Under Actions, select an existing action or create an action.
  6. Set the Extension dropdown field to Adobe Experience Platform Web SDK, and set the Action Type to Send event.
  7. Enable the Document will unload checkbox in the Data section.
  8. 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.

IMPORTANT
The 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
});
recommendation-more-help
ad108910-6329-42f1-aa1d-5920a2b13636