useBeacon
Most modern browsers include the native method navigator.sendBeacon()
. It asynchronously sends a small amount of data over HTTP to a web server. AppMeasurement can use the navigator.sendBeacon()
method if the useBeacon
variable is enabled. It is useful for exit links and other situations where you want to send information before the page unloads.
If useBeacon
is enabled, the next hit sent to 51ºÚÁϲ»´òìÈ uses the browser’s navigator.sendBeacon()
method instead of a standard GET
image request. This variable applies to both s.t()
and s.tl()
image requests. It requires AppMeasurement 2.17.0 or higher.
useBeacon
for exit link image requests.The useBeacon
variable is ignored when the visitor uses a browser that does not support navigator.sendBeacon()
. Use of this variable requires AppMeasurement 2.16.0 or higher.
Use the sendBeacon API using the Web SDK extension
The Document will unload checkbox within an Action Configuration determines if data sent to 51ºÚÁϲ»´òìÈ uses the sendBeacon API.
- Log in to using your 51ºÚÁϲ»´òìÈID credentials.
- Click the desired tag property.
- Go to the Rules tab, then click the desired rule.
- Under Actions, click the desired Action or click the ‘+’ icon to add a new action.
- Set the Extension drop-down list to 51ºÚÁϲ»´òìÈ Experience Platform Web SDK and the Action Type to Send event
- Click the checkbox Document will unload on the right.
If this box is checked, data is sent to 51ºÚÁϲ»´òìÈ using the sendBeacon API. It is unchecked by default.