To embed a spotlight session to a web page, you need to load our recorder library.

That’s a script and a stylesheet:

<link rel="stylesheet" href="https://workbench.mercuryanalytics.com/api/spotlight.css">
<script src="https://workbench.mercuryanalytics.com/api/spotlight.js"></script>

The spotlight tool has two modes of operation. In the “fullscreen” mode, the spolight image is displayed using the browser’s fullscreen mode, where it takes over the entire screen. The interaction is triggered by adding a button to the page, marked with the data-hg-spotlight attribute as follows:

<button type="button" data-hg-spotlight="1760_bcw_nike" data-hg-rid-"000000">Begin</button>

Mobile browsers don’t support the fullscreen mode, so as an alternative that supports mobile browsers, the spotlight image can be embedded into the page as an ordinary image. Once again, the data-hg-spotlight attribute marks the image as a spotlight.

<img data-hg-spotlight="1760_bcw_nike" data-hg-rid="000000">

In both cases, the “1760_bcw_nike” is the id we gave you to refer to the spotlight, and the “000000” should be replaced with the your respondent id.

It’s safe to add the stylesheet and script to your survey’s template, since it does nothing when there’s no marker tag to tell it where to put the image.

Options

Events