You can pipe the Operating System and Screen Resolution from a MetaInfo question into a JavaScript and parse it to determine if it is a Desktop, Tablet, or Phone.
I have notice there are differences between metadata and useragent information
○ Not same information in browser vs UserAgent
○ Version unknown when more info is given in UserAgent
○ More information possible in Operating system (as per UserAgent)
Have you experience something similar?
Thanks,
Cristina
Also, since my organization is running on the JFE survey engine, I'm not able to get anything from the Browser Meta Info question (I'm certain what "pipe the Operating System and Screen Resolution from a MetaInfo question into a JavaScript and parse" means) and have to rely on the built-in UserAgent embedded data element. My problem however, is that I cannot find any information explaining how to parse the resultant text string.
Does anyone have some insight to this?
MetaInfo doesn't include browser language. The best way to do that is debatable:
https://stackoverflow.com/questions/1043339/javascript-for-detecting-browser-language-preference
Still being a newbie to this platform, how (and where) exactly would I go about installing my own JavaScript?
Generally, you add JavaScript to a question by clicking on the cog to the left of the question. If you want to add an external JavaScript library, you would add the script tag to the survey header or footer under Look & Feel.
TomG , we forgot to add device type conditions in survey flow can we now check wether respondent device type was mobile or desktop.
https://www.qualtrics.com/community/discussion/comment/27585#Comment_27585If you included a MetaInfo question or UserAgent embedded data field (you would have to decode UserAgent). Otherwise, you are probably out of luck.
TomG , i have added UserAgent but it is no in readable format. how can i use this to punch device type.
Will it work if we punch like if (UserAgent CONTAINS Mobile) punch Device as MOBILE else Desktop
https://www.qualtrics.com/community/discussion/comment/27590#Comment_27590I don't think that will be reliable. It will get a subset of mobile devices but not all of them. I'm not sure what percent. For accuracy, you need to look them up using something like browscap.
Sorry can you explain more what is browscap
response is like :Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36
browscap is a database of user agents.
Using their lookup tool, the user agent string you posted is:
Chrome 83.0 64-bit running on Windows 10
Thanks TomG. I guess I didn't understand how to use the Browser Meta Info question. I thought that the values captured would show up in the response data immediately (mine are all blank). So I will have to create embedded data elements for the attributes I want to capture and pipe-in information from the Browser Meta Info question?
Still being a newbie to this platform, how (and where) exactly would I go about installing my own JavaScript?
Hi
I’m about to deploy in infographic for desktop and another infographic for mobile and was going to use the device type display logic instead of trying to parse the width pixels value from the metadata fields.
Thanks
Rod Pestell
Device Type isn’t very effective for determining how to display something. Smartphones, tablets and desktops all come in a variety of overlapping screen sizes. The good news is you don’t need to parse the metadata fields. Using JS you can easily get the screen size or the dimensions of html elements. Screen is screen.width
. To get the width of a Qualtrics question: jQuery(this.questionContainer).width();
Hi
Thanks for that. What screen resolution would you say is the nominal width you’d say represents a mobile? I’ll work backwards from there then as we use a static theme which reduces the width slightly.
Thanks
Rod Pestell
Hi
Thanks for that. What screen resolution would you say is the nominal width you’d say represents a mobile? I’ll work backwards from there then as we use a static theme which reduces the width slightly.
Thanks
Rod Pestell
480px. That’s what Qualtrics uses in their CSS media rules.
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.