JavaScript SDK

Integrate the Wondering snippet on your website using the JavaScript SDK.

Getting started


To integrate Wondering on your website, simply add this JavaScript snippet to your web application:

<!-- Wondering Integration Snippet -->
<script type="text/javascript">
(function(w,o,n,d,e,r,ing) {
        window.wondering = function(){W._q.push(arguments)}
        var W = window.wondering; W.wonderingID = n; W.env = o; W._q = [];
        f.parentNode.insertBefore(s, f);
    })(document, '', 'YOUR_WONDERING_ID');

Replace YOUR_WONDERING_ID with your own Wondering ID, which you can find on the JavaScript SDK page in your Wondering account.

Add the snippet to every page in your web application that you want to recruit research participants from. You can add this snippet anywhere on your page, but for the best performance we recommend adding it as the first item in the tag.

You may also need to allow Wondering's domains to your site's permissions policy in order for users to respond to studies using the microphone:

Permissions-Policy: microphone=(self "" "")