This API allows you to request a new device tracker URL for your users so they can embed a JavaScript fraud tracker into their domain.
- Proxy & VPN Detection API
- Email Verification API
- Phone Number Validation API
- Device Fingerprint API
- Malicious URL Scanner API
- Mobile Device Fingerprinting SDK
- Gaming Fraud Detection SDK
- Dark Web Leak API
- Malware File Scanner API
- Request List API
- Fraud Reporting API
- Account Management APIs
- Bulk Validation CSV API
- Allowlist & Blocklist APIs
- Plugins Platforms & Integrations
- IP Reputation Database
- Email Verification Database
- Custom Integrations
- Country List API
Device Tracker
About Device Tracking in Custom Integrations
API Request URL
Warning: You should only call this API server-side for security reasons. |
You can use the following URL to request a new device tracker URL:
Request Parameters
Parameter | Description | Example Value / Format |
key | Required. Your site's domain or the domain that requested this integration. | google.com |
secret | Required. Your user's current secret created during the authentication process. | char(128) |
domain | The domain this JavaScript/pixel will be placed on. If this parameter is not passed the domain will default to your key. | varchar(256) |
Response Parameters
The result of this API will provide you with both the tracking JavaScript link and the pixel link. You can use both, provided the pixel is wrapped in a NoScript tag.
Note: Only JSON responses are available from this API. |
Parameter | Description | Example Value / Format |
message | Description of the status of this call. May contain errors if errors exist. | text |
success | Boolean result of if the request was successful or not. | boolean |
domain | The domain which these URLs can be used on. | varchar(256) |
tracker | The unique authentication key for these tracker links. This can also be found in the URLs below. | char(256) |
script_url | The URL to the device tracking JavaScript without the script open/closing tags. | string |
pixel_url | The URL to the device tracking pixel without the img open/closing tags. | string |
EXAMPLE CODE
xxxxxxxxxx
1
// URL for this request.
2
$URL = 'https://www.ipqualityscore.com/webhooks/ExampleIntegration/json/generate_device_tracker';
3
4
// Configuration items for this request. NOTE: $secret will be user specific not application specific.
5
$key = 'example.com';
6
$secret = 'YOUR_API_KEY_HERE';
7
8
// The domain where these tracking links will be used on.
9
$domain = 'google.com';
10
11
// Prepare POST fields.
12
$fields = array(
13
'secret' => $secret,
14
'key' => $key,
15
'domain' => $domain
16
);
17
18
// Create CURL.
19
$curl = curl_init();
20
21
// Configure CURL
22
curl_setopt($curl, CURLOPT_URL, $URL);
23
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
24
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
25
curl_setopt($curl, CURLOPT_POST, 1);
26
27
// Set POST Parameters
28
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($fields));
29
30
// Fetch URL
31
$result = curl_exec($curl);
32
33
// GET response code.
34
$response_code = curl_getinfo($curl, CURLINFO_HTTP_CODE);
35
36
// Close CURL
37
curl_close($curl);
38
39
// Handle result.
40
if((int) $response_code === 200){
41
// JSON Decode
42
$output = json_decode($result, true);
43
44
// Was the request successful?
45
if($output['success'] === true){
46
echo '<script src="'.$output["script_url"].'"></script><noscript><img src="'.$output["pixel_url"].'" /></script>';
47
} else {
48
echo "Unable to generate tracking links.";
49
}
50
} else {
51
echo "There appears to be an unforeseen error. Please contact IPQualityScore support if this persists.";
52
}