I am trying to use IPQS to remove bots from my survey queue and am not able to get fraudScore to show as data output.
I defined fraudScore in the Survey Flow:

I added this javascript to a lower block:
I can check the IPQS dashboard, and it is correctly receiving the IP addresses, but Qualtrics is not recording the fraudScore. Please help--I am very rusty in my javascript, but have read a ton of stuff, and just not getting it
Qualtrics.SurveyEngine.addOnload(function()
{
//IPQS API key: API KEY: IcMWciLGUIxmVe8c1wSz00UqQBHHu8nH
//Can only do 1000 per month with free account.
// Ensure this script is placed within a JavaScript block in Qualtrics,
// usually in a question's JavaScript or a Header/Footer script.
// var ipAddress = '${loc://IPAddress}'; // Get the IP address from Qualtrics or
// get the visitor's public IP address using an external service like ipify
jQuery.getJSON("https://api.ipify.org?format=jsonp&callback=?", function(data) {
var ipAddress = data.ip;
var ipqsApiKey = "IcMWciLGUIxmVe8c1wSz00UqQBHHu8nH"; // Replace with your actual IPQS API key
var strictness = 1; // This optional parameter controls the level of strictness for the lookup. Setting this option higher will increase the chance for false-positives as well as the time needed to perform the IP analysis. Increase this setting if you still continue to see fraudulent IPs with our base setting (level 1 is recommended) or decrease this setting for faster lookups with less false-positives. Current options for this parameter are 0 (fastest), 1 (recommended), 2 (more strict), or 3 (strictest).
var allow_public_access_points = 'true'; // Bypasses certain checks for IP addresses from education and research institutions, schools, and some corporate connections to better accommodate audiences that frequently use public connections. This value can be set to true to make the service less strict while still catching the riskiest connections.
var ipqsApiUrl = "https://www.ipqualityscore.com/api/json/ip/" + ipqsApiKey + "/" + ipAddress;
var fraudScore = "IPQS_FraudScore"; // The name of your embedded data field
jQuery.ajax({
url: ipqsApiUrl,
//type: "GET",
dataType: "jsonp",
success: function(ipqsData) {
if (ipqsData && ipqsData.fraud_score !== undefined) {
// Process the IPQS response
// For example, set embedded data based on the response
//Qualtrics.SurveyEngine.setJSEmbeddedData("isProxy", response.proxy);
Qualtrics.SurveyEngine.setJSEmbeddedData("IPQS_FraudScore", ipqsData.fraud_score); //75+ = suspicious | 85+ = risky | 90+ = high risk
//Qualtrics.SurveyEngine.setJSEmbeddedData("region", response.region);
//Qualtrics.SurveyEngine.setJSEmbeddedData("city", response.city);
//Qualtrics.SurveyEngine.setJSEmbeddedData("ISP", response.ISP);
//Qualtrics.SurveyEngine.setJSEmbeddedData("bot_status", ipqsData.bot_status);
//Qualtrics.SurveyEngine.setJSEmbeddedData("vpn", response.vpn);
//Qualtrics.SurveyEngine.setEmbeddedData("connection_type", response.connection_type); //not eligible with free ipqs account
// ... set other relevant data points from IPQS response
}
},
error: function() {
Qualtrics.SurveyEngine.setEmbeddedData("IPQS_FraudScore", "Error");
}
});
});
});