Web 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 () {
(w[o].q = w[o].q || []).push(Array.prototype.slice.call(arguments));
};
((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://asurion-widget.prd.aws.service-initiation.asurion.com/widget-loader.js',
{
id: '<WIDGET_ID>',
variant: '<WIDGET_VARIANT>',
// ...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. See Variant Options below |
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 |
Variant Options
| Value | Description |
|---|---|
floating-action-card | A floating card anchored to the corner of the page |
floating-action-button | A compact floating button anchored to the corner of the page |
floating-input-card | A floating input bar that can be moved to the corners of the page |
embedded | Embeds the widget inline within a host element |