Possible to use the IP address during a survey? | XM Community
Solved

Possible to use the IP address during a survey?

  • 27 August 2018
  • 8 replies
  • 316 views

Badge
Hi,

Is it possible to use the IP address while the survey is running? I tried ${e://Field/ipaddress} but this doesn't seem to refer to anything.

Thanks,
Thomas
icon

Best answer by PraDeepKotian_Ugam 27 August 2018, 05:06

View original

8 replies

Userlevel 6
Badge +21
hello @tgrayguy ,

You can grab ip address of user using jQuery api from another website.
Here is the link for the website.

* To implement the same create a embedded variable in survey flow eg. embeddedDataVariable
* Paste below code in any question before using the embedded variable.


jQuery(function() {
jQuery.getJSON("https://api.ipify.org?format=jsonp&callback=?",
function(json) {
Qualtrics.SurveyEngine.setEmbeddedData( 'embeddedDataVariable', json.ip);
}
);
});
!
Userlevel 7
Badge +20
@tgrayguy

Please check if this is not against the GDPR policy...
https://en.wikipedia.org/wiki/General_Data_Protection_Regulation
@PraDeepKotian_Ugam

I tried something that I think is equivalent to your solution through the 'web service' element in survey flow (see image). Unfortunately however, when I test it, records my IP as an amazon server in my country rather than my actual IP address. It seems to have something to do with this issue: https://github.com/rdegges/ipify-api/issues/19. I've tried similar services and had the same problem.

!
Userlevel 7
Badge +27
@"t.bainbridge" - You can pipe ${loc://IPAddress}.

The reason you get a server when you call the web service is because you are making the call from the Qualtrics server, so ipify.org is returning the IP of the server (they probably use Amazon cloud services).
Badge
Yes, I also tried the web service option before realising, as @TomG points out, that it doesn't run client side.

Just an additional note: the JavaScript solution works even when the IP address is not being saved (because Anonymize Response has been selected in the Survey Options). This is useful if you want to _use_ the IP address in some way (looking up the country would be the obvious example) without storing it.
Userlevel 7
Badge +27
> @tgrayguy said:
> Just an additional note: the JavaScript solution works even when the IP address is not being saved (because Anonymize Response has been selected in the Survey Options). This is useful if you want to _use_ the IP address in some way (looking up the country would be the obvious example) without storing it.

GeoIP Location pipes (e.g., ${loc://IPAddress}) work regardless of whether Anonymize Response is turned on or not. The Anonymize Response setting only impacts what gets saved to the response data.
Thank you so much @TomG. I was looking for something like that, but couldn't find it anywhere. Works perfectly now.
Userlevel 5
Badge +11

Hi All, just came across this post about recording the IP address. Unfortunately it still records the internet facing IP address. eg if you have zscaler installed on your PC it then reports back that address.
Does anyone have any suggestions on how best to improve traceability of an anonymous link?
Thanks
Rod Pestell

Leave a Reply