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

Possible to use the IP address during a survey?

  • August 27, 2018
  • 8 replies
  • 738 views

Forum|alt.badge.img
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

Best answer by PraDeepKotian_XM

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); } ); }); !

8 replies

PraDeepKotian_XM
QPN Level 5 ●●●●●
Forum|alt.badge.img+21
  • QPN Level 5 ●●●●●
  • 230 replies
  • Answer
  • August 27, 2018
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); } ); }); !

MohammedAli_Rajapkar
QPN Level 5 ●●●●●
Forum|alt.badge.img+20
@tgrayguy Please check if this is not against the GDPR policy... https://en.wikipedia.org/wiki/General_Data_Protection_Regulation

  • 2 replies
  • October 29, 2018
@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. !

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 6083 replies
  • October 29, 2018
@"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).

Forum|alt.badge.img
  • Author
  • 3 replies
  • October 29, 2018
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.

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 6083 replies
  • October 29, 2018
> @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.

  • 2 replies
  • October 30, 2018
Thank you so much @TomG. I was looking for something like that, but couldn't find it anywhere. Works perfectly now.

Forum|alt.badge.img+11
  • Level 4 ●●●●
  • 367 replies
  • September 26, 2022

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