Adding Embedded Data from React state | XM Community
Skip to main content

I have integrated Qualtrics into my React website using a Webpack partial that I copied from the Qualtrics portal:

<!--BEGIN QUALTRICS WEBSITE FEEDBACK SNIPPET-->
<script type='text/javascript'>
// Some content here
</script>
<div id="secret id"><!--DO NOT REMOVE-CONTENTS PLACED HERE--></div>
<!--END WEBSITE FEEDBACK SNIPPET-->

This works fine and I’m getting survey responses, but I’d like to be able to idenify my customers based on their id number which is stored in a react context without them having to insert this manually.

I can’t see any ways to add this data using `QSI.API`, which I expected to have a function such as `setString` that the react-native library has.

I see you can retrieve this from the survey url params, but can’t tell how to add the id to the params programatically as the survey is triggered when the web page loads and is being viewed.

How can you programmatically (on the client side) set embedded data based on React context? And if this isn’t possible, what is the most secure alternative?

Be the first to reply!

Leave a Reply