Set value to embedded data using Javascript on a website intercept | XM Community
Question

Set value to embedded data using Javascript on a website intercept

  • 21 April 2023
  • 3 replies
  • 466 views

Userlevel 1
Badge +6

Hello, 

We are currently working on setting up an embedded data value using Javascript for a web intercept. The thing is that we are using an in-site embedded intercept (see first image below), but we can’t find how to code the Javascript function in order to set its result to be the embedded data value (see second image and code below).

 

Qualtrics.SurveyEngine.addOnUnload(function() {Qualtrics.SurveyEngine.setEmbeddedData( 'q_test', "testing" )});

Is it possible to set the embedded data value this way?

Best,

Daniel


3 replies

Userlevel 7
Badge +36

@dduarte 

You can use “static value” instead of value from JavaScript for just punching in the details in embedded data.

Embedded Data in Website Feedback (qualtrics.com)

Additionally, value from JavaScript is to bring data from website and not for any custom value.

Hope it helps!

Userlevel 1
Badge +6

Hi @Deepak!

Thank you for your prompt response!

Got it, so value from Javascript is only for bringing data from the website. What we want to do is get the current date and time so we can categorize the responses per Quarter.

Do you know by any chance what would be a field we could pull from a website to achieve the above? We are no experts on website development unfortunately. 😓

Thanks,

Daniel

Userlevel 7
Badge +36

You can use static value like this and it should work

Hope it helps!

Leave a Reply