Hi
I am using the GeoIP data in the instruction text of a survey, to suggest that the events occurred in the respondent's state. However the GeoIP data is in abbreviation form rather than the proper names. I am not at all proficient in coding. Searched github but can't find anything. Anyone able to share some javacript for this?!
Thanks!
Chris
Code to change piped GeoIP state data from abbreviation symbol (e.g. CO) to word (e.g. Colorado)?
+3
Have you tried using ${loc://CountryName} as embedded data value as opposed to Area Code:
!
!
@cmbell,
Create a JavaScript object keyed by abbreviation, then do a lookup:
```
var states = {
...
"CO" : "Colorado",
...
};
Qualtrics.SurveyEngine.setEmbeddedData("state",states['${loc://Region}']);
Create a JavaScript object keyed by abbreviation, then do a lookup:
```
var states = {
...
"CO" : "Colorado",
...
};
Qualtrics.SurveyEngine.setEmbeddedData("state",states['${loc://Region}']);
Leave a Reply
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.