Identify Users

Associate your company's userIDs with participants on Wondering.

You are able to identify your users in the Wondering platform through assigning identifiers within your platform to ours. This is done through the integration, calling our identify method with the id - you are then able to see this identifier associated with each participant under the Participants page.

To identify who a current user is, simply set the identify method and pass along a unique User ID:

window.wondering('identify', 'user-1234567890')

πŸ“˜

The Identify method is not required for anonymous visitors

You don't need to call the identify method for anonymous users of your product, as Wondering will automatically assign them an anonymous ID.

Examples

For example, if you want to simply identify a logged in user and their id is available in the browser, you can simply run on the Wondering script load:

<!-- 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 = [];
        s=w.createElement('script');
        s.async=!0;s.src=o+'?wid='+W.wonderingID;
        f=w.getElementsByTagName('script')[0];
        f.parentNode.insertBefore(s, f);
    })(document, 'https://cdn.wondering.com/ribbon.js', 'YOUR_WONDERING_ID');
    
    window.wondering('identify', 'user-1234567890')
</script>

🚧

Note - in this example, we run the identify method immediately after we have ran the integration script. This is because we want to identify the user as soon as possible, so when we send our first trigger it contains this ID.

If you call the identify method too late (after the Wondering script has run) only trigger calls made after the script has run will use the identify method.

The above snippet sets the user ID to 'user-1234567890' - if they join a study or schedule for a study, this information will be available in the participant summary. Once a widget is shown, they are unable to show widgets until after the 'Repeat study cooling period'.

It is safe to repeatedly call this, and it's suggested to call this whenever the integration is ran.