Installation
Add the following script to your page's <head> element. This will load the script in parallel with the page and execute it immediately once it's ready.
<script>
(function (w, d, s, o, f, a, js, fjs) {
w[o] = function () {
const [action, ...params] = arguments;
(w[o].q = w[o].q || []).push([action, ...params]);
};
(js = d.createElement(s)), (fjs = d.getElementsByTagName(s)[0]);
js.id = o;
js.src = f;
js.async = 1;
js.setAttribute('data-widget-id', a.id);
js.setAttribute('data-variant', a.variant);
w[`${o}_context`] = a.context;
w[`${o}_options`] = a.variantOptionOverrides;
w[`${o}_trackingParameters`] = a.trackingParameters;
fjs.parentNode.insertBefore(js, fjs);
})(
window,
document,
'script',
'_asurion_widget',
'https://app.widget-loader.service-initiation.asurion.com/widget-loader.js',
{
id: '<WIDGET_ID>',
variant: 'floating-action-card',
// ...additional configuration options (see below)
}
);
</script>
Configuration Options
| Option | Type | Required | Description |
|---|---|---|---|
id | string | true | Your unique widget identifier provided by Asurion |
variant | string | true | Widget variant type. Available options: 'floating-action-card', 'floating-action-button', 'embedded' |
parentElementId | string | false | ID of the DOM element to append the widget to. Defaults to 'body' |
context | object | false | Additional context data to pass to the widget. Can contain any key-value pairs |
trackingParameters | object | false | Tracking parameters that will be appended to external links within the widget. Must be string key-value pairs |